summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2018-05-08 22:17:45 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2018-05-08 22:17:45 (GMT)
commitb69bd0771eba5810db3db25217d5f32dc479185e (patch)
treec783a54f7cd8ef2ff504299749f5e18486a0363d /src
parent525b9f40e5c112b777a28d207ccb6fd454f156fc (diff)
parent0cc480d952e2e215f006fc172485fcbabc0f599f (diff)
downloadhdf5-b69bd0771eba5810db3db25217d5f32dc479185e.zip
hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.gz
hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.bz2
Merge branch 'develop' into hdf5_1_10.sync
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt27
-rw-r--r--src/H5.c25
-rw-r--r--src/H5A.c325
-rw-r--r--src/H5AC.c332
-rw-r--r--src/H5ACmpio.c92
-rw-r--r--src/H5ACpkg.h4
-rw-r--r--src/H5ACprivate.h62
-rw-r--r--src/H5ACproxy_entry.c5
-rw-r--r--src/H5Abtree2.c6
-rw-r--r--src/H5Adense.c355
-rw-r--r--src/H5Adeprec.c71
-rw-r--r--src/H5Aint.c976
-rw-r--r--src/H5Apkg.h157
-rw-r--r--src/H5Aprivate.h6
-rw-r--r--src/H5Atest.c29
-rw-r--r--src/H5B.c224
-rw-r--r--src/H5B2.c146
-rw-r--r--src/H5B2dbg.c30
-rw-r--r--src/H5B2hdr.c29
-rw-r--r--src/H5B2int.c194
-rw-r--r--src/H5B2internal.c172
-rw-r--r--src/H5B2leaf.c84
-rw-r--r--src/H5B2pkg.h148
-rw-r--r--src/H5B2private.h45
-rw-r--r--src/H5B2stat.c4
-rw-r--r--src/H5B2test.c29
-rw-r--r--src/H5Bdbg.c16
-rw-r--r--src/H5Bpkg.h3
-rw-r--r--src/H5Bprivate.h46
-rw-r--r--src/H5C.c669
-rw-r--r--src/H5CX.c2813
-rw-r--r--src/H5CXmodule.h33
-rw-r--r--src/H5CXprivate.h147
-rw-r--r--src/H5Cepoch.c12
-rw-r--r--src/H5Cimage.c75
-rw-r--r--src/H5Cmpio.c139
-rw-r--r--src/H5Cpkg.h30
-rw-r--r--src/H5Cprefetched.c16
-rw-r--r--src/H5Cprivate.h57
-rw-r--r--src/H5Ctag.c42
-rw-r--r--src/H5D.c133
-rw-r--r--src/H5Dbtree.c66
-rw-r--r--src/H5Dbtree2.c61
-rw-r--r--src/H5Dchunk.c511
-rw-r--r--src/H5Dcompact.c38
-rw-r--r--src/H5Dcontig.c115
-rw-r--r--src/H5Ddbg.c3
-rw-r--r--src/H5Ddeprec.c172
-rw-r--r--src/H5Dearray.c81
-rw-r--r--src/H5Defl.c6
-rw-r--r--src/H5Dfarray.c82
-rw-r--r--src/H5Dfill.c41
-rw-r--r--src/H5Dint.c720
-rw-r--r--src/H5Dio.c512
-rw-r--r--src/H5Dlayout.c64
-rw-r--r--src/H5Dmpio.c501
-rw-r--r--src/H5Dnone.c8
-rw-r--r--src/H5Doh.c81
-rw-r--r--src/H5Dpkg.h179
-rw-r--r--src/H5Dprivate.h36
-rw-r--r--src/H5Dpublic.h4
-rw-r--r--src/H5Dscatgath.c117
-rw-r--r--src/H5Dselect.c11
-rw-r--r--src/H5Dsingle.c14
-rw-r--r--src/H5Dvirtual.c277
-rw-r--r--src/H5E.c4
-rw-r--r--src/H5EA.c95
-rw-r--r--src/H5EAcache.c4
-rw-r--r--src/H5EAdbg.c56
-rw-r--r--src/H5EAdblkpage.c20
-rw-r--r--src/H5EAdblock.c36
-rw-r--r--src/H5EAhdr.c27
-rw-r--r--src/H5EAiblock.c32
-rw-r--r--src/H5EApkg.h62
-rw-r--r--src/H5EAprivate.h18
-rw-r--r--src/H5EAsblock.c32
-rw-r--r--src/H5EAtest.c4
-rw-r--r--src/H5Edeprec.c2
-rw-r--r--src/H5Eint.c13
-rw-r--r--src/H5Epkg.h2
-rw-r--r--src/H5Eprivate.h10
-rw-r--r--src/H5F.c502
-rw-r--r--src/H5FA.c72
-rw-r--r--src/H5FAcache.c4
-rw-r--r--src/H5FAdbg.c30
-rw-r--r--src/H5FAdblkpage.c19
-rw-r--r--src/H5FAdblock.c31
-rw-r--r--src/H5FAhdr.c28
-rw-r--r--src/H5FApkg.h41
-rw-r--r--src/H5FAprivate.h18
-rw-r--r--src/H5FAtest.c5
-rw-r--r--src/H5FD.c76
-rw-r--r--src/H5FDfamily.c9
-rw-r--r--src/H5FDint.c110
-rw-r--r--src/H5FDmpi.c47
-rw-r--r--src/H5FDmpio.c168
-rw-r--r--src/H5FDpkg.h8
-rw-r--r--src/H5FDprivate.h47
-rw-r--r--src/H5FDspace.c36
-rw-r--r--src/H5FO.c4
-rw-r--r--src/H5FOprivate.h2
-rw-r--r--src/H5FS.c74
-rw-r--r--src/H5FScache.c62
-rw-r--r--src/H5FSdbg.c18
-rw-r--r--src/H5FSpkg.h5
-rw-r--r--src/H5FSprivate.h63
-rw-r--r--src/H5FSsection.c116
-rw-r--r--src/H5Faccum.c153
-rw-r--r--src/H5Fcwfs.c6
-rw-r--r--src/H5Fdeprec.c19
-rw-r--r--src/H5Fefc.c139
-rw-r--r--src/H5Fint.c1129
-rw-r--r--src/H5Fio.c70
-rw-r--r--src/H5Fmount.c71
-rw-r--r--src/H5Fmpi.c31
-rw-r--r--src/H5Fpkg.h77
-rw-r--r--src/H5Fprivate.h52
-rw-r--r--src/H5Fquery.c2
-rw-r--r--src/H5Fspace.c34
-rw-r--r--src/H5Fsuper.c375
-rw-r--r--src/H5Ftest.c21
-rw-r--r--src/H5G.c181
-rw-r--r--src/H5Gbtree2.c7
-rw-r--r--src/H5Gcompact.c63
-rw-r--r--src/H5Gdense.c231
-rw-r--r--src/H5Gdeprec.c643
-rw-r--r--src/H5Gent.c26
-rw-r--r--src/H5Gint.c464
-rw-r--r--src/H5Glink.c5
-rw-r--r--src/H5Gloc.c106
-rw-r--r--src/H5Gname.c19
-rw-r--r--src/H5Gnode.c131
-rw-r--r--src/H5Gobj.c227
-rw-r--r--src/H5Goh.c116
-rw-r--r--src/H5Gpkg.h161
-rw-r--r--src/H5Gprivate.h58
-rw-r--r--src/H5Groot.c16
-rw-r--r--src/H5Gstab.c160
-rw-r--r--src/H5Gtest.c181
-rw-r--r--src/H5Gtraverse.c192
-rw-r--r--src/H5HF.c77
-rw-r--r--src/H5HFbtree2.c8
-rw-r--r--src/H5HFcache.c222
-rw-r--r--src/H5HFdbg.c63
-rw-r--r--src/H5HFdblock.c144
-rw-r--r--src/H5HFhdr.c109
-rw-r--r--src/H5HFhuge.c162
-rw-r--r--src/H5HFiblock.c662
-rw-r--r--src/H5HFiter.c18
-rw-r--r--src/H5HFman.c105
-rw-r--r--src/H5HFpkg.h181
-rw-r--r--src/H5HFprivate.h39
-rw-r--r--src/H5HFsection.c755
-rw-r--r--src/H5HFspace.c125
-rw-r--r--src/H5HFstat.c12
-rw-r--r--src/H5HG.c106
-rw-r--r--src/H5HGdbg.c7
-rw-r--r--src/H5HGpkg.h2
-rw-r--r--src/H5HGprivate.h15
-rw-r--r--src/H5HL.c68
-rw-r--r--src/H5HLdbg.c4
-rw-r--r--src/H5HLdblk.c10
-rw-r--r--src/H5HLpkg.h2
-rw-r--r--src/H5HLprivate.h18
-rw-r--r--src/H5I.c47
-rw-r--r--src/H5Itest.c12
-rw-r--r--src/H5L.c1258
-rw-r--r--src/H5Lexternal.c79
-rw-r--r--src/H5Lpkg.h9
-rw-r--r--src/H5Lprivate.h33
-rw-r--r--src/H5Lpublic.h21
-rw-r--r--src/H5MF.c814
-rw-r--r--src/H5MFaggr.c74
-rw-r--r--src/H5MFdbg.c22
-rw-r--r--src/H5MFpkg.h13
-rw-r--r--src/H5MFprivate.h38
-rw-r--r--src/H5MFsection.c33
-rw-r--r--src/H5O.c200
-rw-r--r--src/H5Oainfo.c108
-rw-r--r--src/H5Oalloc.c258
-rw-r--r--src/H5Oattr.c145
-rw-r--r--src/H5Oattribute.c393
-rw-r--r--src/H5Obogus.c36
-rw-r--r--src/H5Obtreek.c18
-rw-r--r--src/H5Ocache.c68
-rw-r--r--src/H5Ocache_image.c27
-rw-r--r--src/H5Ochunk.c106
-rw-r--r--src/H5Ocont.c50
-rw-r--r--src/H5Ocopy.c315
-rw-r--r--src/H5Odbg.c20
-rw-r--r--src/H5Odrvinfo.c32
-rw-r--r--src/H5Odtype.c97
-rw-r--r--src/H5Oefl.c66
-rw-r--r--src/H5Ofill.c126
-rw-r--r--src/H5Oflush.c194
-rw-r--r--src/H5Ofsinfo.c34
-rw-r--r--src/H5Oginfo.c34
-rw-r--r--src/H5Oint.c776
-rw-r--r--src/H5Olayout.c45
-rw-r--r--src/H5Olinfo.c128
-rw-r--r--src/H5Olink.c95
-rw-r--r--src/H5Omessage.c239
-rw-r--r--src/H5Omtime.c89
-rw-r--r--src/H5Oname.c46
-rw-r--r--src/H5Opkg.h162
-rw-r--r--src/H5Opline.c76
-rw-r--r--src/H5Oprivate.h105
-rw-r--r--src/H5Orefcount.c44
-rw-r--r--src/H5Osdspace.c75
-rw-r--r--src/H5Oshared.c104
-rw-r--r--src/H5Oshared.h48
-rw-r--r--src/H5Oshmesg.c28
-rw-r--r--src/H5Ostab.c100
-rw-r--r--src/H5Otest.c152
-rw-r--r--src/H5Ounknown.c14
-rw-r--r--src/H5P.c10
-rw-r--r--src/H5PB.c127
-rw-r--r--src/H5PBprivate.h12
-rw-r--r--src/H5Pdcpl.c18
-rw-r--r--src/H5Pdxpl.c73
-rw-r--r--src/H5Pint.c107
-rw-r--r--src/H5Pprivate.h7
-rw-r--r--src/H5R.c56
-rw-r--r--src/H5Rdeprec.c27
-rw-r--r--src/H5Rint.c142
-rw-r--r--src/H5Rpkg.h9
-rw-r--r--src/H5Rprivate.h9
-rw-r--r--src/H5S.c82
-rw-r--r--src/H5SM.c502
-rw-r--r--src/H5SMmessage.c4
-rw-r--r--src/H5SMpkg.h5
-rw-r--r--src/H5SMprivate.h33
-rw-r--r--src/H5SMtest.c15
-rw-r--r--src/H5Sall.c396
-rw-r--r--src/H5Sdbg.c8
-rw-r--r--src/H5Shyper.c2948
-rw-r--r--src/H5Smpio.c2
-rw-r--r--src/H5Snone.c14
-rw-r--r--src/H5Spkg.h21
-rw-r--r--src/H5Spoint.c29
-rw-r--r--src/H5Sprivate.h24
-rw-r--r--src/H5Spublic.h4
-rw-r--r--src/H5Sselect.c116
-rw-r--r--src/H5T.c1182
-rw-r--r--src/H5TS.c19
-rw-r--r--src/H5TSprivate.h1
-rw-r--r--src/H5Tarray.c42
-rw-r--r--src/H5Tcommit.c482
-rw-r--r--src/H5Tcompound.c17
-rw-r--r--src/H5Tconv.c1381
-rw-r--r--src/H5Tdeprec.c61
-rw-r--r--src/H5Tenum.c15
-rw-r--r--src/H5Tnative.c182
-rw-r--r--src/H5Toh.c54
-rw-r--r--src/H5Tpkg.h546
-rw-r--r--src/H5Tprivate.h14
-rw-r--r--src/H5Tvlen.c152
-rw-r--r--src/H5Z.c98
-rw-r--r--src/H5Znbit.c14
-rw-r--r--src/H5Zpkg.h3
-rw-r--r--src/H5Zprivate.h1
-rw-r--r--src/H5Zscaleoffset.c48
-rw-r--r--src/H5Zszip.c2
-rw-r--r--src/H5err.txt1
-rw-r--r--src/H5private.h133
-rw-r--r--src/H5trace.c2
-rw-r--r--src/Makefile.am5
267 files changed, 20552 insertions, 17409 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 52d86d0..435fe9a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.10)
-PROJECT (HDF5_SRC C CXX)
+project (HDF5_SRC C)
#-----------------------------------------------------------------------------
# Apply Definitions to compiler in this directory and below
@@ -113,6 +113,14 @@ set (H5CS_HDRS
IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SOURCES}" )
+set (H5CX_SOURCES
+ ${HDF5_SRC_DIR}/H5CX.c
+)
+set (H5CX_HDRS
+)
+IDE_GENERATED_PROPERTIES ("H5CX" "${H5CX_HDRS}" "${H5CX_SOURCES}" )
+
+
set (H5D_SOURCES
${HDF5_SRC_DIR}/H5D.c
${HDF5_SRC_DIR}/H5Dbtree.c
@@ -694,6 +702,7 @@ set (common_SRCS
${H5B2_SOURCES}
${H5C_SOURCES}
${H5CS_SOURCES}
+ ${H5CX_SOURCES}
${H5D_SOURCES}
${H5E_SOURCES}
${H5EA_SOURCES}
@@ -773,6 +782,7 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5Bprivate.h
${HDF5_SRC_DIR}/H5Cprivate.h
${HDF5_SRC_DIR}/H5CSprivate.h
+ ${HDF5_SRC_DIR}/H5CXprivate.h
${HDF5_SRC_DIR}/H5Dprivate.h
${HDF5_SRC_DIR}/H5Eprivate.h
${HDF5_SRC_DIR}/H5EAprivate.h
@@ -844,10 +854,11 @@ if (HDF5_GENERATE_HEADERS)
endif ()
#-----------------------------------------------------------------------------
-# Setup the H5Detect utility which generates H5Tinit with platform
+# Setup the H5detect utility which generates H5Tinit with platform
# specific type checks inside
#-----------------------------------------------------------------------------
add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
+target_include_directories(H5detect PRIVATE ${HDF5_BINARY_DIR})
TARGET_C_PROPERTIES (H5detect STATIC " " " ")
if (MSVC OR MINGW)
target_link_libraries (H5detect "ws2_32.lib")
@@ -864,6 +875,7 @@ add_custom_command (
)
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
+target_include_directories(H5make_libsettings PRIVATE ${HDF5_BINARY_DIR})
TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ")
if (MSVC OR MINGW)
target_link_libraries (H5make_libsettings "ws2_32.lib")
@@ -881,11 +893,12 @@ add_custom_command (
)
#-----------------------------------------------------------------------------
-# Add H5Tinit source to build - generated by H5Detect/CMake at configure time
+# Add H5Tinit source to build - generated by H5detect/CMake at configure time
#-----------------------------------------------------------------------------
set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
+target_include_directories(${HDF5_LIB_TARGET} PUBLIC "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ")
target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
if (NOT WIN32)
@@ -895,14 +908,16 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0)
set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
FOLDER libraries
- INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>
)
+## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z"
+#all_packages="AC,B2,CX,D,F,HL,I,O,S,ST,T,Z"
option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
if (HDF5_ENABLE_DEBUG_APIS)
set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
COMPILE_DEFINITIONS
- "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG"
+ "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5CX_DEBUG;H5B2_DEBUG;H5AC_DEBUG"
)
endif ()
set (install_targets ${HDF5_LIB_TARGET})
@@ -925,6 +940,7 @@ if (BUILD_SHARED_LIBS)
)
set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
+ target_include_directories(${HDF5_LIBSH_TARGET} PUBLIC "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}")
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ")
target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS})
if (NOT WIN32)
@@ -963,6 +979,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT)
FILES
${H5_PUBLIC_HEADERS}
${H5_GENERATED_HEADERS}
+ ${HDF5_BINARY_DIR}/H5pubconf.h
DESTINATION
${HDF5_INSTALL_INCLUDE_DIR}
COMPONENT
diff --git a/src/H5.c b/src/H5.c
index b8fd885..552330d 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 */
@@ -30,7 +31,6 @@
#include "H5Pprivate.h" /* Property lists */
#include "H5SLprivate.h" /* Skip lists */
#include "H5Tprivate.h" /* Datatypes */
-#include "H5FSprivate.h" /* File free space */
/****************/
/* Local Macros */
@@ -224,7 +224,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 +267,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 +354,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 +415,8 @@ H5_term_library(void)
/* Mark library as closed */
H5_INIT_GLOBAL = FALSE;
+ /* Don't pop the API context (i.e. H5CX_pop), since it's been shut down already */
+
done:
#ifdef H5_HAVE_THREADSAFE
H5_API_UNLOCK
@@ -907,7 +915,7 @@ H5allocate_memory(size_t size, hbool_t clear)
else
ret_value = H5MM_malloc(size);
- FUNC_LEAVE_API(ret_value)
+ FUNC_LEAVE_API_NOINIT(ret_value)
} /* end H5allocate_memory() */
@@ -945,7 +953,7 @@ H5resize_memory(void *mem, size_t size)
ret_value = H5MM_realloc(mem, size);
- FUNC_LEAVE_API(ret_value)
+ FUNC_LEAVE_API_NOINIT(ret_value)
} /* end H5resize_memory() */
@@ -970,7 +978,7 @@ H5free_memory(void *mem)
/* At this time, it is impossible for this to fail. */
H5MM_xfree(mem);
- FUNC_LEAVE_API(SUCCEED)
+ FUNC_LEAVE_API_NOINIT(SUCCEED)
} /* end H5free_memory() */
@@ -987,20 +995,19 @@ H5free_memory(void *mem)
herr_t
H5is_library_threadsafe(hbool_t *is_ts)
{
- herr_t ret_value = SUCCEED;
-
FUNC_ENTER_API_NOINIT
H5TRACE1("e", "*b", is_ts);
HDassert(is_ts);
+ /* At this time, it is impossible for this to fail. */
#ifdef H5_HAVE_THREADSAFE
*is_ts = TRUE;
#else /* H5_HAVE_THREADSAFE */
*is_ts = FALSE;
#endif /* H5_HAVE_THREADSAFE */
- FUNC_LEAVE_API(ret_value)
+ FUNC_LEAVE_API_NOINIT(SUCCEED)
} /* end H5is_library_threadsafe() */
diff --git a/src/H5A.c b/src/H5A.c
index 07aca92..8e64eda 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,6 @@ 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 */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -268,14 +268,14 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id,
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type")
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
- /* 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")
+ /* 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,7 +284,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -328,13 +328,8 @@ 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 */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -355,35 +350,30 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type")
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
- /* Set up opened group location to fill in */
- obj_loc.oloc = &obj_oloc;
- obj_loc.path = &obj_path;
- H5G_loc_reset(&obj_loc);
+ /* 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")
FUNC_LEAVE_API(ret_value)
} /* H5Acreate_by_name() */
@@ -413,7 +403,6 @@ 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 */
hid_t ret_value;
FUNC_ENTER_API(FAIL)
@@ -427,17 +416,13 @@ 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")
+ /* 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,7 +431,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -480,7 +465,6 @@ 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 */
hid_t ret_value;
FUNC_ENTER_API(FAIL)
@@ -495,18 +479,19 @@ 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
+
+ /* 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,7 +501,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -553,7 +538,6 @@ 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 */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -571,18 +555,19 @@ 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
+
+ /* 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,7 +577,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -620,8 +605,6 @@ 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 */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -635,12 +618,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(attr_id) < 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:
@@ -669,8 +652,6 @@ 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 */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -684,12 +665,8 @@ 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")
-
/* 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:
@@ -752,8 +729,8 @@ 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 */
+ hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("i", "i", attr_id);
@@ -762,8 +739,9 @@ 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)
+ if((ret_value = H5A__get_type(attr)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute")
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5Aget_type() */
@@ -803,7 +781,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 +858,6 @@ 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 */
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -899,12 +876,12 @@ 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")
+ /* 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,7 +896,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -1018,7 +995,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1036,12 +1012,12 @@ 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")
+ /* 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,8 +1025,8 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -1077,7 +1053,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1098,12 +1073,12 @@ 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")
+ /* 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,7 +1087,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -1153,8 +1128,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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 */
@@ -1199,17 +1178,16 @@ 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")
+ /* 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 */
@@ -1263,9 +1241,6 @@ 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 */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1279,19 +1254,10 @@ 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;
-
/* 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:
FUNC_LEAVE_API(ret_value)
} /* H5Aiterate2() */
@@ -1346,15 +1312,6 @@ 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 */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1373,46 +1330,15 @@ 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")
+ /* 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")
- /* Build attribute operator info */
- attr_op.op_type = H5A_ATTR_OP_APP2;
- attr_op.u.app_op2 = op;
-
- /* 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")
-
FUNC_LEAVE_API(ret_value)
} /* H5Aiterate_by_name() */
@@ -1448,8 +1374,12 @@ H5Adelete(hid_t loc_id, const char *name)
if(!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
@@ -1478,11 +1408,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1498,29 +1423,15 @@ 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;
+ /* 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")
-
FUNC_LEAVE_API(ret_value)
} /* H5Adelete_by_name() */
@@ -1554,11 +1465,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1576,29 +1482,15 @@ 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;
+ /* 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")
-
FUNC_LEAVE_API(ret_value)
} /* H5Adelete_by_idx() */
@@ -1671,7 +1563,7 @@ H5Aexists(hid_t obj_id, const char *attr_name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
/* 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:
@@ -1697,7 +1589,6 @@ 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 */
htri_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1713,11 +1604,11 @@ 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")
+ /* 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:
diff --git a/src/H5AC.c b/src/H5AC.c
index 4223158..5eccf9e 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,13 @@ 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 +563,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 +581,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 +610,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 +648,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 +687,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 +722,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 +767,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 +778,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 +870,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 +915,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 +940,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 +1298,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 +1348,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 +1453,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 +1464,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 +1563,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 +1617,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 +1901,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 +1973,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 +2627,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 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")
+ /* Set the provided tag */
+ H5CX_set_tag(metadata_tag);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI_VOID
} /* H5AC_tag */
@@ -2843,7 +2691,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 +2704,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 +2726,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 +2739,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 +2760,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 +2773,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 +2867,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 +2937,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..7671abc 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -37,6 +37,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 "H5MMprivate.h" /* Memory management */
@@ -94,20 +95,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 +1226,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 +1275,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 +1393,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;
@@ -1415,10 +1415,9 @@ H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast clean slist.")
HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0);
} /* end if */
- else {
- if(H5AC__receive_and_apply_clean_list(f, dxpl_id) < 0)
+ else
+ 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 */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1427,7 +1426,7 @@ done:
/*-------------------------------------------------------------------------
*
- * Function: H5AC_receive_haddr_list()
+ * Function: H5AC__receive_haddr_list()
*
* Purpose: Receive the list of entry addresses from process 0,
* and return it in a buffer pointed to by *haddr_buf_ptr_ptr.
@@ -1494,7 +1493,7 @@ done:
haddr_buf_ptr = (haddr_t *)H5MM_xfree((void *)haddr_buf_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5AC_receive_haddr_list() */
+} /* H5AC__receive_haddr_list() */
/*-------------------------------------------------------------------------
@@ -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;
@@ -1694,15 +1693,20 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id)
if(H5AC__copy_candidate_list_to_buffer(cache_ptr, &num_entries, &haddr_buf_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.")
- /* initial sync point barrier */
- if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
+ /* Initial sync point barrier
+ *
+ * When flushing from within the close operation from a file,
+ * it's possible to skip this barrier (on the second flush of the cache).
+ */
+ if(!H5CX_get_mpi_file_flushing())
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
/* Enable writes during this operation */
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 +1805,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 +1834,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 +1880,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;
@@ -1894,12 +1898,16 @@ H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id)
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY);
- /* to prevent "messages from the future" we must
+ /* To prevent "messages from the future" we must
* synchronize all processes before we start the flush.
* Hence the following barrier.
+ *
+ * However, when flushing from within the close operation from a file,
+ * it's possible to skip this barrier (on the second flush of the cache).
*/
- if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
+ if(!H5CX_get_mpi_file_flushing())
+ if(MPI_SUCCESS != (mpi_result = MPI_Barrier(aux_ptr->mpi_comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_result)
/* Flush data to disk, from rank 0 process */
if(aux_ptr->mpi_rank == 0) {
@@ -1909,7 +1917,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;
@@ -1919,7 +1927,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")
/* this code exists primarily for the test bed -- it allows us to
- * enforce posix semantics on the server that pretends to be a
+ * enforce POSIX semantics on the server that pretends to be a
* file system in our parallel tests.
*/
if(aux_ptr->write_done)
@@ -1927,7 +1935,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 +1986,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 +2038,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 +2055,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 +2096,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 +2138,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 +2156,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 +2292,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 +2304,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 8b79aa5..07da8e2 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 obj_len, void *_udata)
FUNC_ENTER_STATIC
/* Decode attribute information */
- if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, obj_len, (const unsigned char *)obj)))
+ if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, NULL, H5O_ATTR_ID, obj_len, (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 ba0578e..3701022 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 obj_len, void *_udata)
* 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, obj_len, (const unsigned char *)obj)))
+ if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, NULL, H5O_ATTR_ID, obj_len, (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..9b592b0 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,16 @@
--------------------------------------------------------------------------*/
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 */
+ 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))
@@ -133,10 +134,14 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type")
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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 +149,10 @@ 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")
+
FUNC_LEAVE_API(ret_value)
} /* H5Acreate1() */
@@ -173,9 +182,9 @@ 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 */
+ hid_t ret_value;
FUNC_ENTER_API(FAIL)
H5TRACE2("i", "i*s", loc_id, name);
@@ -189,7 +198,7 @@ H5Aopen_name(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
/* 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,7 +208,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -245,8 +254,8 @@ H5Aopen_idx(hid_t loc_id, unsigned idx)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
/* 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,7 +264,7 @@ 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")
FUNC_LEAVE_API(ret_value)
@@ -283,9 +292,9 @@ 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;
+ int ret_value;
FUNC_ENTER_API(FAIL)
H5TRACE1("Is", "i", loc_id);
@@ -331,7 +340,7 @@ H5Aget_num_attrs(hid_t loc_id)
} /*lint !e788 All appropriate cases are covered */
/* 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:
@@ -379,10 +388,7 @@ 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 */
+ herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*Iux*x", loc_id, attr_num, op, op_data);
@@ -391,19 +397,10 @@ 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;
-
/* 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:
FUNC_LEAVE_API(ret_value)
} /* H5Aiterate1() */
diff --git a/src/H5Aint.c b/src/H5Aint.c
index 55c46f6..e666e8c 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 */
@@ -123,28 +127,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 */
@@ -152,9 +148,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);
@@ -165,7 +161,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")
@@ -237,20 +233,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"
@@ -274,19 +269,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() */
/*-------------------------------------------------------------------------
@@ -296,7 +395,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
*
@@ -307,12 +406,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);
@@ -347,7 +446,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
*
@@ -359,8 +507,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 */
@@ -369,7 +517,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);
@@ -381,12 +529,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 */
@@ -403,15 +551,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
*
@@ -423,8 +571,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 */
@@ -433,7 +580,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);
@@ -446,12 +593,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 */
@@ -468,11 +615,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() */
/*--------------------------------------------------------------------------
@@ -492,7 +639,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 */
@@ -505,7 +652,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);
@@ -527,7 +674,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 */
@@ -547,7 +694,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 */
@@ -574,7 +721,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() */
@@ -595,7 +742,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 */
@@ -609,7 +756,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);
@@ -628,7 +775,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 */
@@ -648,7 +795,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 */
@@ -673,7 +820,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 */
@@ -688,7 +835,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() */
@@ -714,7 +861,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);
@@ -776,7 +923,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5A_get_type
+ * Function: H5A__get_type
*
* Purpose: Returns an ID for the datatype of an attribute
*
@@ -787,12 +934,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);
@@ -820,16 +967,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
@@ -844,14 +991,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")
@@ -870,7 +1017,7 @@ H5A_get_create_plist(H5A_t* attr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5Aget_create_plist() */
+} /* end H5A__get_create_plist() */
/*-------------------------------------------------------------------------
@@ -915,7 +1062,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5A_copy
+ * Function: H5A__copy
*
* Purpose: Copies attribute OLD_ATTR.
*
@@ -933,13 +1080,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);
@@ -974,15 +1121,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).
@@ -997,11 +1144,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);
@@ -1011,7 +1158,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;
}
@@ -1025,11 +1172,43 @@ H5A_free(H5A_t *attr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5A_free() */
+} /* end H5A__free() */
+
+
+/*-------------------------------------------------------------------------
+ * 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
+ * Function: H5A__close
*
* Purpose: Frees an attribute and all associated memory.
*
@@ -1038,18 +1217,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);
@@ -1058,10 +1233,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 */
@@ -1082,7 +1257,7 @@ H5A_close(H5A_t *attr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5A_close() */
+} /* end H5A__close() */
/*-------------------------------------------------------------------------
@@ -1180,7 +1355,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
*
@@ -1193,8 +1401,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 */
@@ -1202,7 +1409,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;
@@ -1210,12 +1417,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:
@@ -1223,8 +1430,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() */
/*-------------------------------------------------------------------------
@@ -1273,7 +1480,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 */
@@ -1289,7 +1496,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
@@ -1306,14 +1513,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);
@@ -1326,7 +1533,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 ||
@@ -1335,7 +1541,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 */
@@ -1350,7 +1556,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() */
/*-------------------------------------------------------------------------
@@ -1386,7 +1592,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 */
@@ -1398,7 +1604,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
@@ -1416,14 +1622,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);
@@ -1433,7 +1639,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 */
@@ -1463,8 +1669,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 */
@@ -1476,11 +1682,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() */
/*-------------------------------------------------------------------------
@@ -1655,7 +1861,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
@@ -1669,14 +1875,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);
@@ -1734,11 +1940,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
*
@@ -1751,11 +1957,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);
@@ -1766,7 +1972,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
@@ -1776,11 +1982,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.
@@ -1795,12 +2001,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);
@@ -1812,7 +2018,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 */
@@ -1820,7 +2026,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 */
@@ -1836,15 +2042,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
@@ -1860,13 +2066,13 @@ 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 */
uint8_t version; /* Message version */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_PACKAGE
/* check arguments */
HDassert(f);
@@ -1903,11 +2109,11 @@ H5A_set_version(const H5F_t *f, H5A_t *attr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5A_set_version() */
+} /* end H5A__set_version() */
/*-------------------------------------------------------------------------
- * Function: H5A_attr_copy_file
+ * Function: H5A__attr_copy_file
*
* Purpose: Copies a message from _MESG to _DEST in file
*
@@ -1927,8 +2133,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 */
@@ -1943,7 +2149,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);
@@ -2008,9 +2214,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
@@ -2070,9 +2276,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 */
@@ -2121,7 +2327,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);
@@ -2131,12 +2337,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 {
@@ -2149,7 +2355,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 */
@@ -2182,15 +2388,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
@@ -2206,13 +2412,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);
@@ -2241,7 +2447,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 */
@@ -2251,9 +2457,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
@@ -2273,8 +2479,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
@@ -2284,7 +2489,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() */
/*-------------------------------------------------------------------------
@@ -2317,12 +2522,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 */
@@ -2330,17 +2533,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)
@@ -2348,7 +2551,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.
*
@@ -2362,15 +2565,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);
@@ -2380,24 +2583,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
*
@@ -2410,8 +2645,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 */
@@ -2419,29 +2654,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..31fbe8e 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,34 @@ 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")
+ /* Push API context */
+ 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,
&lt_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, &lt_key_changed,
- udata, rt_key, &rt_key_changed) == H5B_INS_ERROR)
+ if(H5B_INS_ERROR == H5B__remove_helper(f, addr, type, 0, lt_key, &lt_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), &lt_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),
+ &lt_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..c4f56e5 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 */
@@ -218,8 +218,8 @@ 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)))
+ H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned)
+ 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 */
@@ -330,8 +330,8 @@ 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)))
+ H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned)
+ 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..deaf1a1
--- /dev/null
+++ b/src/H5CX.c
@@ -0,0 +1,2813 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 <koziol@lbl.gov>
+ * 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 */
+
+/* Common macro for the duplicated code to retrieve properties from a property list */
+#define H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
+ /* Check for default property list */ \
+ if((*head)->ctx.H5_GLUE(PL,_id) == (DEF_PL)) \
+ HDmemcpy(&(*head)->ctx.PROP_FIELD, &H5_GLUE3(H5CX_def_,PL,_cache).PROP_FIELD, sizeof(H5_GLUE3(H5CX_def_,PL,_cache).PROP_FIELD)); \
+ else { \
+ /* Check if the property list is already available */ \
+ if(NULL == (*head)->ctx.PL) \
+ /* Get the dataset transfer property list pointer */ \
+ if(NULL == ((*head)->ctx.PL = (H5P_genplist_t *)H5I_object((*head)->ctx.H5_GLUE(PL,_id)))) \
+ HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") \
+ \
+ /* Get the property */ \
+ if(H5P_get((*head)->ctx.PL, (PROP_NAME), &(*head)->ctx.PROP_FIELD) < 0) \
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't retrieve value from API context") \
+ } /* end else */ \
+ \
+ /* Mark the field as valid */ \
+ (*head)->ctx.H5_GLUE(PROP_FIELD,_valid) = TRUE;
+
+/* Macro for the duplicated code to retrieve properties from a property list */
+#define H5CX_RETRIEVE_PROP_VALID(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
+ /* Check if the value has been retrieved already */ \
+ if(!(*head)->ctx.H5_GLUE(PROP_FIELD,_valid)) { \
+ H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
+ } /* end if */
+
+#ifdef H5_HAVE_PARALLEL
+/* Macro for the duplicated code to retrieve possibly set properties from a property list */
+#define H5CX_RETRIEVE_PROP_VALID_SET(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
+ /* Check if the value has been retrieved already */ \
+ if(!((*head)->ctx.H5_GLUE(PROP_FIELD,_valid) || (*head)->ctx.H5_GLUE(PROP_FIELD,_set))) { \
+ H5CX_RETRIEVE_PROP_COMMON(PL, DEF_PL, PROP_NAME, PROP_FIELD) \
+ } /* end if */
+#endif /* H5_HAVE_PARALLEL */
+
+#ifdef H5_HAVE_PARALLEL
+/* Macro for the duplicated code to test and set properties for a property list */
+#define H5CX_TEST_SET_PROP(PROP_NAME, PROP_FIELD) \
+{ \
+ htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ \
+ \
+ /* Check if property exists in DXPL */ \
+ if(!(*head)->ctx.H5_GLUE(PROP_FIELD,_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, PROP_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.H5_GLUE(PROP_FIELD,_set) || check_prop > 0) { \
+ /* Cache the value for later, marking it to set in DXPL when context popped */ \
+ (*head)->ctx.PROP_FIELD = PROP_FIELD; \
+ (*head)->ctx.H5_GLUE(PROP_FIELD,_set) = TRUE; \
+ } /* end if */ \
+}
+#endif /* H5_HAVE_PARALLEL */
+
+/* Macro for the duplicated code to test and set properties for a property list */
+#define H5CX_SET_PROP(PROP_NAME, PROP_FIELD) \
+ if((*head)->ctx.H5_GLUE(PROP_FIELD,_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, PROP_NAME, &(*head)->ctx.PROP_FIELD) < 0) \
+ HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting filter mask xfer property") \
+ } /* end if */
+
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/* Typedef for context about each API call, as it proceeds */
+/* Fields in this struct are of several types:
+ * - The DXPL & LAPL ID are either library default ones (from the API context
+ * initialization) or passed in from the application via an API call
+ * parameter. The corresponding H5P_genplist_t* is just the underlying
+ * property list struct for the ID, to optimize retrieving properties
+ * from the list multiple times.
+ *
+ * - Internal fields, used and set only within the library, for managing the
+ * operation under way. These do not correspond to properties in the
+ * DXPL or LAPL and can have any name.
+ *
+ * - Cached fields, which are not returned to the application, for managing
+ * the operation under way. These correspond to properties in the DXPL
+ * or LAPL, and are retrieved either from the (global) cache for a
+ * default property list, or from the corresponding property in the
+ * application's (non-default) property list. Getting / setting these
+ * properties within the library does _not_ affect the application's
+ * property list. Note that the naming of these fields, <foo> and
+ * <foo>_valid, is important for the H5CX_RETRIEVE_PROP_VALID ahd
+ * H5CX_RETRIEVE_PROP_VALID_SET macros to work properly.
+ *
+ * - "Return-only"" properties that are returned to the application, mainly
+ * for sending out "introspection" information ("Why did collective I/O
+ * get broken for this operation?", "Which filters are set on the chunk I
+ * just directly read in?", etc) Setting these fields will cause the
+ * corresponding property in the property list to be set when the API
+ * context is popped, when returning from the API routine. Note that the
+ * naming of these fields, <foo> and <foo>_set, is important for the
+* H5CX_TEST_SET_PROP and H5CX_SET_PROP macros to work properly.
+ */
+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 */
+
+ /* Internal: Object tagging info */
+ haddr_t tag; /* Current object's tag (ohdr chunk #0 address) */
+
+ /* Internal: Metadata cache info */
+ H5AC_ring_t ring; /* Current metadata cache ring for entries */
+
+#ifdef H5_HAVE_PARALLEL
+ /* Internal: 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 */
+ hbool_t mpi_file_flushing; /* Whether an MPI-opened file is being flushed */
+#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 */
+
+ /* Return-only 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 */
+#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+ 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_INSTRUMENTED_LIBRARY */
+#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 */
+/* Each entry into the library through an API routine invokes H5CX_push()
+ * in a FUNC_ENTER_API* macro, which pushes an H5CX_node_t on the API
+ * context [thread-local] stack, after initializing it with default values
+ * in H5CX__push_common().
+ */
+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 */
+/* This is initialized to the values in the default DXPL during package
+ * initialization and then remains constant for the rest of the library's
+ * operation. When a field in H5CX_t is retrieved from an API context that
+ * uses a default DXPL, this value is copied instead of spending time looking
+ * up the property in the DXPL.
+ */
+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 */
+/* (Same as the cached DXPL struct, above, except for the default LAPL) */
+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
+
+ /* 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) {
+ H5CX_node_t *cnode; /* Context node */
+
+ /* Pop the top context node from the stack */
+ /* (Can't check for errors, as rest of library is shut down) */
+ cnode = H5CX__pop_common();
+
+ /* Free the context node */
+ /* (Allocated with HDmalloc() in H5CX_push_special() ) */
+ HDfree(cnode);
+
+#ifndef H5_HAVE_THREADSAFE
+ 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: <none>
+ *
+ * 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: <none>
+ *
+ * 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: <none>
+ *
+ * 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 H5CX_DEBUG
+ /* 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 /* H5CX_DEBUG*/
+
+ /* 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.
+ *
+ * Note: Should be called for all API routines that modify file
+ * file metadata but don't pass in an access property list.
+ *
+ * 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)
+{
+ 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
+ /* 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 */
+#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 / <can't fail>
+ *
+ * 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() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_get_mpi_file_flushing
+ *
+ * Purpose: Retrieves the "flushing an MPI-opened file" flag for the current API call context.
+ *
+ * Return: TRUE / FALSE on success / <can't fail>
+ *
+ * Programmer: Quincey Koziol
+ * March 17, 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+hbool_t
+H5CX_get_mpi_file_flushing(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.mpi_file_flushing)
+} /* end H5CX_get_mpi_file_flushing() */
+#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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BTREE_SPLIT_RATIO_NAME, btree_split_ratio)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MAX_TEMP_BUF_NAME, max_temp_buf)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_TCONV_BUF_NAME, tconv_buf)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BKGR_BUF_NAME, bkgr_buf)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BKGR_BUF_TYPE_NAME, bkgr_buf_type)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_HYPER_VECTOR_SIZE_NAME, vec_size)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_IO_XFER_MODE_NAME, io_xfer_mode)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, mpio_coll_opt)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, mpio_chunk_opt_mode)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, mpio_chunk_opt_num)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, mpio_chunk_opt_ratio)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_EDC_NAME, err_detect)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_FILTER_CB_NAME, filter_cb)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, dcr_flag)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, dcr_offset)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, dcw_flag)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, dcw_filters)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, dcw_offset)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, dcw_datasize)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_CONV_CB_NAME, dt_conv_cb)
+
+ /* 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);
+
+ H5CX_RETRIEVE_PROP_VALID(lapl, H5P_LINK_ACCESS_DEFAULT, H5L_ACS_NLINKS_NAME, nlinks)
+
+ /* 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: <none>
+ *
+ * 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: <none>
+ *
+ * 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: <none>
+ *
+ * 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() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5CX_set_mpi_file_flushing
+ *
+ * Purpose: Sets the "flushing an MPI-opened file" flag for the current API call context.
+ *
+ * Return: <none>
+ *
+ * Programmer: Quincey Koziol
+ * March 170 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+H5CX_set_mpi_file_flushing(hbool_t flushing)
+{
+ 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.mpi_file_flushing = flushing;
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5CX_set_mpi_file_flushing() */
+#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: <none>
+ *
+ * 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: <none>
+ *
+ * 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: <none>
+ *
+ * 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: <none>
+ *
+ * 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);
+
+ /* If we're using the default DXPL, don't modify it */
+ if((*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;
+ } /* end if */
+
+ 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: <none>
+ *
+ * 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);
+
+ /* If we're using the default DXPL, don't modify it */
+ if((*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;
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5CX_set_mpio_global_no_coll_cause() */
+
+#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+
+/*-------------------------------------------------------------------------
+ * 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 */
+ 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));
+
+ H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard)
+
+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 */
+ 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));
+
+ H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard)
+
+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 */
+ 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));
+
+ H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true)
+
+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 */
+ 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));
+
+ H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false)
+
+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 */
+ 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));
+
+ H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll)
+
+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 */
+ 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));
+
+ H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind)
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5CX_test_set_mpio_coll_chunk_multi_ratio_ind() */
+#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
+#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 */
+ H5CX_SET_PROP(H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, dcr_filters)
+#ifdef H5_HAVE_PARALLEL
+ H5CX_SET_PROP(H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, mpio_actual_chunk_opt)
+ H5CX_SET_PROP(H5D_MPIO_ACTUAL_IO_MODE_NAME, mpio_actual_io_mode)
+ H5CX_SET_PROP(H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause)
+ H5CX_SET_PROP(H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause)
+#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+ H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard)
+ H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard)
+ H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true)
+ H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false)
+ H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll)
+ H5CX_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind)
+#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
+#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() */
+
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 <koziol@lbl.gov>
+ * 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..3566f11
--- /dev/null
+++ b/src/H5CXprivate.h
@@ -0,0 +1,147 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 */
+#ifndef _H5private_H
+H5_DLL herr_t H5CX_push(void);
+H5_DLL herr_t H5CX_pop(void);
+#endif /* _H5private_H */
+H5_DLL void H5CX_push_special(void);
+H5_DLL hbool_t H5CX_is_def_dxpl(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);
+
+/* "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);
+H5_DLL hbool_t H5CX_get_mpi_file_flushing(void);
+#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);
+H5_DLL void H5CX_set_mpi_file_flushing(hbool_t flushing);
+#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);
+#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+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_INSTRUMENTED_LIBRARY */
+#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 be2560f..51de5c4 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 */
@@ -1411,11 +1404,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
@@ -1473,7 +1466,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 */
@@ -1483,7 +1476,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")
@@ -1526,7 +1519,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:
@@ -1580,7 +1573,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;
@@ -3096,7 +3089,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 */
@@ -3278,7 +3271,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 */
@@ -3479,7 +3472,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 */
@@ -3517,7 +3510,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:
@@ -3539,7 +3532,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 */
@@ -3561,7 +3554,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..61ccb5a 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,6 @@ 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 */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -136,12 +136,12 @@ 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")
+ /* 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")
@@ -197,7 +197,6 @@ 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 */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -216,12 +215,12 @@ 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")
+ /* 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 +237,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 */
@@ -273,7 +272,6 @@ 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 */
hid_t ret_value;
FUNC_ENTER_API(FAIL)
@@ -285,12 +283,12 @@ 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")
+ /* 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 +299,7 @@ done:
if(ret_value < 0)
if(dset && H5D_close(dset) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset")
+
FUNC_LEAVE_API(ret_value)
} /* end H5Dopen2() */
@@ -365,15 +364,15 @@ H5Dget_space(hid_t dset_id)
H5D_t *dset = NULL;
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")
+ if((ret_value = H5D__get_space(dset)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to get dataspace")
done:
FUNC_LEAVE_API(ret_value)
@@ -408,7 +407,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
/* 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:
@@ -435,7 +434,6 @@ done:
hid_t
H5Dget_type(hid_t dset_id)
{
-
H5D_t *dset; /* Dataset */
hid_t ret_value; /* Return value */
@@ -446,7 +444,7 @@ 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)
+ if((ret_value = H5D__get_type(dset)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace")
done:
@@ -473,18 +471,18 @@ 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 */
+ 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")
+ if((ret_value = H5D__get_create_plist(dataset)) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "Can't get creation plist")
done:
FUNC_LEAVE_API(ret_value)
@@ -577,7 +575,7 @@ H5Dget_storage_size(hid_t dset_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset")
/* 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:
@@ -732,13 +730,13 @@ 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 */
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,14 +747,17 @@ 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 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:
FUNC_LEAVE_API(ret_value)
@@ -791,13 +792,12 @@ 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 */
herr_t ret_value; /* Return value */
@@ -837,17 +837,9 @@ 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 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 +864,6 @@ 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")
FUNC_LEAVE_API(ret_value)
} /* end H5Dvlen_get_buf_size() */
@@ -907,12 +897,16 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[])
if(!size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified")
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(dset_id) < 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)
+ FUNC_LEAVE_API(ret_value)
} /* end H5Dset_extent() */
@@ -931,7 +925,7 @@ done:
herr_t
H5Dflush(hid_t dset_id)
{
- H5D_t *dset; /* Dataset for this operation */
+ H5D_t *dset; /* Dataset for this operation */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
@@ -941,13 +935,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(dset_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -969,8 +963,8 @@ 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 */
+ herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", dset_id);
@@ -979,8 +973,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(dset_id) < 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:
@@ -1017,11 +1015,15 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(dset_id) < 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 +1031,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;
@@ -1121,9 +1123,10 @@ H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_n
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset")
/* 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:
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 391d79d..d45ced0 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;
@@ -1136,7 +1063,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
* additions involving the offset and the hyperslab selection -QAK)
*/
if((file_space_normalized = H5S_hyper_normalize_offset((H5S_t *)file_space, old_offset)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to normalize selection")
/* Decide the number of chunks in each dimension*/
for(u = 0; u < f_ndims; u++) {
@@ -1369,12 +1296,12 @@ 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) {
+ if(file_space_normalized == TRUE) {
/* (Casting away const OK -QAK) */
if(H5S_hyper_denormalize_offset((H5S_t *)file_space, old_offset) < 0)
- HDONE_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset")
+ HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't denormalize selection")
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -1574,8 +1501,7 @@ H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy file selection")
/* Move selection back to have correct offset in chunk */
- if(H5S_SELECT_ADJUST_U(fm->single_space, coords) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection")
+ H5S_SELECT_ADJUST_U(fm->single_space, coords);
#ifdef H5_HAVE_PARALLEL
/* store chunk selection information */
@@ -1687,10 +1613,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
} /* end if */
/* Move selection back to have correct offset in chunk */
- if(H5S_SELECT_ADJUST_U(tmp_fchunk, coords) < 0) {
- (void)H5S_close(tmp_fchunk);
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection")
- } /* end if */
+ H5S_SELECT_ADJUST_U(tmp_fchunk, coords);
/* Add temporary chunk to the list of chunks */
@@ -1889,8 +1812,8 @@ H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm)
} /* end for */
/* Adjust the selection */
- if(H5S_hyper_adjust_s(chunk_info->mspace,chunk_adjust) < 0) /*lint !e772 The chunk_adjust array will always be initialized */
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection")
+ if(H5S_hyper_adjust_s(chunk_info->mspace, chunk_adjust) < 0) /*lint !e772 The chunk_adjust array will always be initialized */
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to adjust selection")
/* Get the next chunk node in the skip list */
curr_node=H5SL_next(curr_node);
@@ -2272,7 +2195,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 +2328,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 +2371,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 +2439,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 +2451,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 +2530,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 +2563,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 +2573,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 +2739,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 +2764,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 +2838,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 +2909,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 +2959,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 +2993,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 +3026,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 +3066,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 +3084,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 +3130,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 +3148,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 +3229,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 +3301,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 +3368,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 +3556,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 +3616,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 +3644,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 +3797,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 +3874,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 +3889,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 +3947,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 +3966,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 +4001,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 +4051,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 +4065,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 +4077,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 +4096,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 +4165,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 +4206,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 +4281,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 +4345,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 +4365,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 +4386,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 +4401,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 +4412,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 +4435,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 +4493,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 +4558,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 +4571,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 +4590,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 +4648,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 +4672,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 +4729,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 +4743,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 +4780,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 +4793,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 +4917,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 +4928,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 +4954,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 +4994,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 +5156,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 +5308,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 +5336,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 +5359,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 +5370,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 +5379,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 +5415,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 +5432,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 +5501,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 +5547,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 +5638,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 +5664,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 +5674,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 +5691,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 +5732,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 +5768,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 +5835,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 +5867,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 +5875,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 +6028,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 +6049,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 +6075,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 +6084,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 +6175,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 +6197,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 +6313,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 +6372,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 +6494,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 +6537,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 +6611,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 +6625,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..ad12ba0 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:
@@ -402,7 +392,7 @@ H5D__contig_construct(H5F_t *f, H5D_t *dset)
/*
* The maximum size of the dataset cannot exceed the storage size.
- * Also, only the slowest varying dimension of a simple data space
+ * Also, only the slowest varying dimension of a simple dataspace
* can be extendible (currently only for external data storage).
*/
@@ -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..347e34c 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 */
@@ -88,7 +89,7 @@ H5Ddebug(hid_t dset_id)
/* 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);
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index 0807048..0f1bfee 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 */
@@ -93,7 +90,7 @@ static herr_t H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
* properties (DCPL_ID).
*
* All arguments are copied into the dataset, so the caller is
- * allowed to derive new types, data spaces, and creation
+ * allowed to derive new types, dataspaces, and creation
* parameters from the old ones and reuse them in calls to
* create other datasets.
*
@@ -118,6 +115,7 @@ 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 */
hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -138,8 +136,12 @@ 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")
+ /* 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 */
@@ -177,7 +179,7 @@ H5Dopen1(hid_t loc_id, const char *name)
{
H5D_t *dset = NULL;
H5G_loc_t loc; /* Object location of group */
- hid_t ret_value;
+ hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("i", "i*s", loc_id, name);
@@ -189,7 +191,7 @@ H5Dopen1(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
/* 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 */
@@ -224,8 +226,10 @@ 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 */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*h", dset_id, size);
@@ -236,146 +240,24 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(dset_id) < 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:
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..b2f9b29 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -143,7 +143,7 @@ H5D__efl_construct(H5F_t *f, H5D_t *dset)
/*
* The maximum size of the dataset cannot exceed the storage size.
- * Also, only the slowest varying dimension of a simple data space
+ * Also, only the slowest varying dimension of a simple dataspace
* can be extendible (currently only for external data storage).
*/
@@ -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..e42e551 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 */
@@ -135,7 +136,7 @@ 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")
/* 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:
@@ -173,7 +174,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 +231,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 +248,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 +267,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 +280,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 +315,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 +369,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 +405,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 +444,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 +564,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 +584,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 +606,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 +698,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 17b989e..d08adbe 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_file_prefix(const H5D_t *dset, hid_t dapl_id, const char * prefix_type,
- char **file_prefix);
-static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id);
+static herr_t H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id);
+static herr_t H5D__build_file_prefix(const H5D_t *dset, hid_t dapl_id,
+ const char *prefix_type, char **file_prefix);
+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,14 +330,55 @@ 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.
+ * Purpose: Returns the status of dataspace allocation.
*
* Return:
* Success: Non-negative
@@ -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() */
@@ -717,7 +611,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)
@@ -777,7 +671,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 */
@@ -829,14 +723,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")
@@ -863,24 +756,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 */
@@ -896,12 +789,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 */
@@ -930,7 +823,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id)
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 */
}
@@ -941,7 +834,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(!use_at_least_v18)
- 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:
@@ -954,7 +847,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)
@@ -963,7 +856,7 @@ done:
/*--------------------------------------------------------------------------
- * Function: H5D_build_file_prefix
+ * Function: H5D__build_file_prefix
*
* Purpose: Determine the file prefix to be used and store
* it in file_prefix. Stores an empty string if no prefix
@@ -973,7 +866,8 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type, char **file_prefix /*out*/)
+H5D__build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type,
+ char **file_prefix /*out*/)
{
char *prefix = NULL; /* prefix used to look for the file */
char *filepath = NULL; /* absolute path of directory the HDF5 file is in */
@@ -983,19 +877,18 @@ H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type,
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);
-
filepath = H5F_EXTPATH(dset->oloc.file);
HDassert(filepath);
/* XXX: Future thread-safety note - getenv is not required
* to be reentrant.
*/
- if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
+ if(HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
prefix = HDgetenv("HDF5_VDS_PREFIX");
else if (HDstrcmp(prefix_type, H5D_ACS_EFILE_PREFIX_NAME) == 0)
prefix = HDgetenv("HDF5_EXTFILE_PREFIX");
@@ -1039,7 +932,7 @@ H5D_build_file_prefix(const H5D_t *dset, hid_t dapl_id, const char *prefix_type,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5D_build_file_prefix() */
+} /* H5D__build_file_prefix() */
/*-------------------------------------------------------------------------
@@ -1059,7 +952,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;
@@ -1080,7 +973,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)))
@@ -1203,7 +1095,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 */
@@ -1211,15 +1103,15 @@ 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_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0)
+ if(H5D__build_file_prefix(new_dset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &new_dset->shared->extfile_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
- /* Set the vds file prefix */
- if(H5D_build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix")
+ /* Set the VDS file prefix */
+ if(H5D__build_file_prefix(new_dset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &new_dset->shared->vds_prefix) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize VDS prefix")
/* Add the dataset to the list of opened objects in the file */
if(H5FO_top_incr(new_dset->oloc.file, new_dset->oloc.addr) < 0)
@@ -1235,7 +1127,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)
@@ -1254,12 +1146,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 */
@@ -1287,8 +1179,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 */
@@ -1298,7 +1189,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);
@@ -1310,18 +1201,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 */
@@ -1332,7 +1223,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() */
@@ -1348,7 +1239,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;
@@ -1374,12 +1265,12 @@ 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_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0)
+ if(H5D__build_file_prefix(dataset, dapl_id, H5D_ACS_EFILE_PREFIX_NAME, &extfile_prefix) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix")
- /* Get the vds prefix */
- if(H5D_build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize vds prefix")
+ /* Get the VDS prefix */
+ if(H5D__build_file_prefix(dataset, dapl_id, H5D_ACS_VDS_PREFIX_NAME, &vds_prefix) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize VDS prefix")
/* Check if dataset was already open */
if(NULL == (shared_fo = (H5D_shared_t *)H5FO_opened(dataset->oloc.file, dataset->oloc.addr))) {
@@ -1387,7 +1278,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 */
@@ -1451,7 +1342,7 @@ done:
dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix);
dataset->shared->vds_prefix = (char *)H5MM_xfree(dataset->shared->vds_prefix);
dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared);
- }
+ } /* end if */
H5O_loc_free(&(dataset->oloc));
H5G_name_free(&(dataset->path));
@@ -1550,7 +1441,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 */
@@ -1559,7 +1450,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);
@@ -1573,13 +1464,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 */
@@ -1595,7 +1486,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 */
@@ -1609,18 +1500,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 {
@@ -1679,8 +1570,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")
@@ -1692,7 +1581,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")
@@ -1702,18 +1591,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
@@ -1746,7 +1665,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 */
@@ -1826,7 +1745,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 */
@@ -1859,21 +1778,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 */
/*
@@ -1884,7 +1803,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 */
@@ -1928,7 +1846,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 */
@@ -1987,7 +1905,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 */
@@ -2000,13 +1918,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 */
@@ -2022,7 +1940,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 */
@@ -2034,7 +1952,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 */
@@ -2144,7 +2062,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 */
@@ -2161,7 +2079,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 */
@@ -2262,7 +2180,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 */
@@ -2296,7 +2214,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;
@@ -2344,7 +2262,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.
@@ -2352,17 +2270,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
@@ -2394,7 +2312,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() */
@@ -2447,19 +2394,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)
@@ -2467,14 +2412,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. */
@@ -2482,7 +2426,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)
@@ -2541,7 +2485,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 */
@@ -2565,7 +2510,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:
@@ -2633,14 +2578,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);
@@ -2735,7 +2680,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 */
@@ -2749,13 +2694,13 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
for(u = 0; u < dset->shared->layout.storage.u.virt.list_nused; u++) {
/* Patch extent */
if(H5S_set_extent(dset->shared->layout.storage.u.virt.list[u].source_dset.virtual_select, size) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
dset->shared->layout.storage.u.virt.list[u].virtual_space_status = H5O_VIRTUAL_STATUS_CORRECT;
/* Patch sub-source datasets */
for(v = 0; v < dset->shared->layout.storage.u.virt.list[u].sub_dset_nalloc; v++)
if(H5S_set_extent(dset->shared->layout.storage.u.virt.list[u].sub_dset[v].virtual_select, size) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
} /* end for */
/* Mark virtual datasets as not fully initialized so internal
@@ -2768,12 +2713,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
@@ -2783,24 +2726,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() */
@@ -2814,7 +2757,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 */
@@ -2829,7 +2772,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 */
@@ -2851,30 +2794,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
@@ -2885,7 +2859,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 */
@@ -2895,7 +2869,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);
@@ -2909,7 +2883,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;
@@ -2926,7 +2899,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;
@@ -2951,13 +2923,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;
@@ -2975,7 +2947,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;
@@ -2994,12 +2966,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 */
@@ -3010,7 +2982,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 */
@@ -3023,7 +2995,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() */
@@ -3037,7 +3009,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 */
@@ -3053,12 +3025,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 */
@@ -3067,7 +3039,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 */
@@ -3089,7 +3061,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D__flush_cb
+ * Function: H5D__flush_all_cb
*
* Purpose: Flush any dataset information cached in memory
*
@@ -3098,31 +3070,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
*
@@ -3131,9 +3103,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)
@@ -3141,17 +3112,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() */
/*-------------------------------------------------------------------------
@@ -3166,7 +3171,7 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
-H5D_get_create_plist(H5D_t *dset)
+H5D_get_create_plist(const H5D_t *dset)
{
H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */
H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */
@@ -3189,7 +3194,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 */
@@ -3251,7 +3256,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 */
@@ -3279,7 +3284,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)
@@ -3342,7 +3347,7 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
-H5D_get_access_plist(H5D_t *dset)
+H5D_get_access_plist(const H5D_t *dset)
{
H5P_genplist_t *old_plist; /* Default DAPL */
H5P_genplist_t *new_plist; /* New DAPL */
@@ -3389,18 +3394,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.
*
@@ -3409,21 +3413,21 @@ 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 */
+ /* Read the dataspace message and return a dataspace object */
if(NULL == (space = H5S_copy(dset->shared->space, FALSE, TRUE)))
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace")
/* Create an atom */
if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
@@ -3435,26 +3439,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)
@@ -3476,13 +3481,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() */
/*-------------------------------------------------------------------------
@@ -3494,13 +3498,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);
@@ -3514,22 +3518,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..1566b5e 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,13 @@
/********************/
/* 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);
#endif /* H5_HAVE_PARALLEL */
static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info);
@@ -97,14 +90,14 @@ H5FL_DEFINE(H5D_chunk_map_t);
* passed to this function with the PLIST_ID argument.
*
* The FILE_SPACE_ID can be the constant H5S_ALL which indicates
- * that the entire file data space is to be referenced.
+ * that the entire file dataspace is to be referenced.
*
* The MEM_SPACE_ID can be the constant H5S_ALL in which case
- * the memory data space is the same as the file data space
+ * the memory dataspace is the same as the file dataspace
* defined when the dataset was created.
*
- * The number of elements in the memory data space must match
- * the number of elements in the file data space.
+ * The number of elements in the memory dataspace must match
+ * the number of elements in the file dataspace.
*
* The PLIST_ID can be the constant H5P_DEFAULT in which
* case the default data transfer properties are used.
@@ -118,20 +111,17 @@ 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;
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)))
@@ -140,11 +130,11 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
if(mem_space_id < 0 || file_space_id < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(H5S_ALL != mem_space_id) {
- if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ if(NULL == (mem_space = (const H5S_t *)H5I_object_verify(mem_space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Check for valid selection */
if(H5S_SELECT_VALID(mem_space) != TRUE)
@@ -152,8 +142,8 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
} /* end if */
if(H5S_ALL != file_space_id) {
- if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Check for valid selection */
if(H5S_SELECT_VALID(file_space) != TRUE)
@@ -161,30 +151,34 @@ 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 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,17 +198,16 @@ 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:
FUNC_LEAVE_API(ret_value)
@@ -233,14 +226,14 @@ done:
* PLIST_ID argument.
*
* The FILE_SPACE_ID can be the constant H5S_ALL which indicates
- * that the entire file data space is to be referenced.
+ * that the entire file dataspace is to be referenced.
*
* The MEM_SPACE_ID can be the constant H5S_ALL in which case
- * the memory data space is the same as the file data space
+ * the memory dataspace is the same as the file dataspace
* defined when the dataset was created.
*
- * The number of elements in the memory data space must match
- * the number of elements in the file data space.
+ * The number of elements in the memory dataspace must match
+ * the number of elements in the file dataspace.
*
* The PLIST_ID can be the constant H5P_DEFAULT in which
* case the default data transfer properties are used.
@@ -254,10 +247,9 @@ 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;
@@ -275,18 +267,17 @@ 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 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) {
@@ -305,13 +296,13 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
if(NULL == (file_space = (const H5S_t *)H5I_object_verify(file_space_id, H5I_DATASPACE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
- /* Check for valid selection */
- if(H5S_SELECT_VALID(file_space) != TRUE)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent")
- } /* end if */
- }
+ /* Check for valid selection */
+ 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:
@@ -330,36 +321,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 +364,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 +392,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 */
@@ -416,7 +400,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
hbool_t type_info_init = FALSE; /* Whether the datatype info has been initialized */
H5S_t * projected_mem_space = NULL; /* If not NULL, ptr to dataspace containing a */
/* projection of the supplied mem_space to a new */
- /* data space with rank equal to that of */
+ /* dataspace with rank equal to that of */
/* file_space. */
/* */
/* This field is only used if */
@@ -430,14 +414,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,25 +431,29 @@ 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 */
if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected")
/* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
if(NULL == buf) {
@@ -547,8 +532,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 +541,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 +561,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) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O")
#endif /*H5_HAVE_PARALLEL*/
@@ -593,19 +576,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 +585,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 +604,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 */
@@ -642,7 +612,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
hbool_t type_info_init = FALSE; /* Whether the datatype info has been initialized */
H5S_t * projected_mem_space = NULL; /* If not NULL, ptr to dataspace containing a */
/* projection of the supplied mem_space to a new */
- /* data space with rank equal to that of */
+ /* dataspace with rank equal to that of */
/* file_space. */
/* */
/* This field is only used if */
@@ -656,14 +626,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 +647,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 +672,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*/
@@ -727,7 +696,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Make certain that the number of elements in each selection is the same */
if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest data spaces have different sizes")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected")
/* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
if(NULL == buf) {
@@ -784,11 +753,10 @@ 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. */
+ /* Allocate dataspace and initialize it if it hasn't been. */
if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused == 0 &&
!(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage)) {
hssize_t file_nelmts; /* Number of elements in file dataset's dataspace */
@@ -820,7 +788,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) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O")
#endif /*H5_HAVE_PARALLEL*/
@@ -842,7 +810,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 +821,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 +830,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 +848,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 +860,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 +893,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 +911,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
@@ -1016,29 +951,47 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache,
} /* end else */
/*
- * Locate the type conversion function and data space conversion
+ * Locate the type conversion function and dataspace conversion
* functions, and set up the element numbering information. If a data
* type conversion is necessary then register datatype atoms. Data type
* conversion is necessary if the user has set the `need_bkg' to a high
* 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 +1003,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 +1013,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 +1046,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 +1088,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)
+ const H5D_type_info_t *type_info)
{
- 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 +1105,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 +1160,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 +1204,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 +1217,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 +1250,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 980b810..c8afb8e 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 */
/****************/
@@ -459,8 +460,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 */
@@ -468,7 +468,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);
@@ -484,12 +484,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 */
@@ -503,12 +503,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 */
@@ -521,15 +520,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 */
@@ -538,7 +537,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")
@@ -554,11 +553,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
@@ -566,7 +564,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:
@@ -574,10 +579,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() */
@@ -595,7 +600,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 */
@@ -608,11 +613,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 */
@@ -626,16 +631,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 */
@@ -650,7 +655,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 */
@@ -662,16 +667,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() */
@@ -690,7 +694,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(const 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 */
@@ -706,7 +710,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 94d763d..e621e04 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -32,16 +32,18 @@
/* 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 */
#include "H5FDprivate.h" /* File drivers */
+#include "H5FDmpi.h" /* MPI-based file drivers */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Oprivate.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
#include "H5Sprivate.h" /* Dataspaces */
-#include "H5VMprivate.h" /* Vector */
+#include "H5VMprivate.h" /* Vector */
#ifdef H5_HAVE_PARALLEL
@@ -76,13 +78,11 @@
*/
/* Macros to represent different IO modes(NONE, Independent or collective)for multiple chunk IO case */
-#define H5D_CHUNK_IO_MODE_IND 0
#define H5D_CHUNK_IO_MODE_COL 1
/* Macros to represent the regularity of the selection for multiple chunk IO case. */
#define H5D_CHUNK_SELECT_REG 1
-#define H5D_CHUNK_SELECT_IRREG 2
-#define H5D_CHUNK_SELECT_NONE 0
+
/******************/
/* Local Typedefs */
@@ -207,33 +207,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);
-static herr_t H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info,
- const H5D_chunk_map_t *fm, int *min_chunkf);
+ uint8_t assign_io_mode[], haddr_t chunk_addr[]);
static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info,
const H5D_chunk_map_t *fm, int *sum_chunkf);
static herr_t H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info,
@@ -284,11 +274,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 */
+ unsigned local_cause = 0; /* Local reason(s) for breaking collective mode */
+ unsigned global_cause = 0; /* Global reason(s) for breaking collective mode */
+ htri_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -300,7 +291,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 */
@@ -346,17 +339,13 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space,
/* Form consensus opinion among all processes about whether to perform
* collective I/O
*/
- if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_cause, &global_cause, 1, MPI_INT, MPI_BOR, io_info->comm)))
+ if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&local_cause, &global_cause, 1, MPI_UNSIGNED, MPI_BOR, io_info->comm)))
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 +376,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 +406,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,116 +522,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
- * hyperslab selection selected by all processors.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Muqun Yang
- * Monday, Feb. 13th, 2006
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm,
- int *min_chunkf)
-{
- int num_chunkf; /* Number of chunks to iterate over */
- int mpi_code; /* MPI return code */
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_STATIC
-
- /* Get the number of chunks to perform I/O on */
- H5_CHECKED_ASSIGN(num_chunkf, int, H5SL_count(fm->sel_chunks), size_t)
-
- /* Determine the minimum # of chunks for all processes */
- if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, min_chunkf, 1, MPI_INT, MPI_MIN, io_info->comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code)
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5D__mpio_get_min_chunk() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5D__mpio_get_sum_chunk
*
* Purpose: Routine for obtaining total number of chunks to cover
@@ -699,28 +578,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 +618,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 +679,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 +695,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 +715,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 +725,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 */
- } /* 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 */
+ /*** 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_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 */
+ 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_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 +761,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 +871,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 +894,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 +946,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 +1136,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 +1226,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 +1247,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 +1255,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 +1273,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 +1356,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 +1412,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 +1426,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 +1457,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 +1515,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 +1529,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 +1555,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 +1564,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 +1582,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 +1653,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 +1676,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 +1684,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 +1720,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 +1836,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 +1986,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 +2019,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 +2241,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 */
@@ -2497,7 +2294,7 @@ done:
* 2) Gather all the information to the root process
*
* 3) Root process will do the following:
- * a) Obtain chunk addresses for all chunks in this data space
+ * a) Obtain chunk addresses for all chunks in this dataspace
* b) With the consideration of the user option, calculate IO mode for each chunk
* c) Build MPI derived datatype to combine "chunk address" and "assign_io" information
* in order to do MPI Bcast only once
@@ -2520,7 +2317,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 +2332,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 +2348,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 +2439,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 +2504,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 +2516,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;
@@ -3004,8 +2775,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 */
@@ -3216,6 +2986,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;
@@ -3236,6 +3008,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")
@@ -3257,20 +3035,35 @@ 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) {
+ H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request */
+
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)
- 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)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying")
+
+ /* 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")
+
+ /* Change the xfer_mode to independent for handling the I/O */
+ 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")
+
+ 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_DATASET, H5E_READERROR, FAIL, "unable to read raw data chunk")
+
+ /* Return to the original I/O transfer mode setting */
+ if(H5CX_set_io_xfer_mode(xfer_mode) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode")
+
+ 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_DATASET, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying")
} /* end if */
else {
chunk_entry->chunk_states.new_chunk.length = true_chunk_size;
@@ -3295,8 +3088,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;
@@ -3305,8 +3097,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)
@@ -3324,8 +3115,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)
@@ -3355,8 +3145,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)
@@ -3371,18 +3160,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 78705c7..126a3c0 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);
@@ -533,7 +515,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;
@@ -541,7 +522,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];
@@ -571,45 +551,44 @@ H5_DLLVAR const unsigned H5O_layout_ver_bounds[H5F_LIBVER_NBOUNDS];
/******************************/
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,
@@ -620,12 +599,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,20 +614,17 @@ H5_DLL herr_t H5D__scatgath_write(const H5D_io_info_t *io_info,
H5_DLL herr_t H5D__layout_set_io_ops(const H5D_t *dataset);
H5_DLL size_t H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout,
hbool_t include_compact_data);
-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_version(H5F_t *f, H5O_layout_t *layout);
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(const 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,
@@ -661,43 +635,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);
@@ -707,39 +677,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
@@ -779,7 +748,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 ed13467..cbee0de 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -120,23 +120,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) */
@@ -170,22 +153,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 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);
+H5_DLL herr_t H5D_flush_all(const H5F_t *f);
+H5_DLL hid_t H5D_get_create_plist(const H5D_t *dset);
+H5_DLL hid_t H5D_get_access_plist(const 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);
@@ -203,7 +183,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..5856ede 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,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -941,10 +970,6 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id,
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")
-
/* Get datatype element size */
if(0 == (type_size = H5T_GET_SIZE(type)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size")
@@ -982,7 +1007,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;
@@ -1027,8 +1052,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1047,10 +1070,6 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id,
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")
-
/* Get datatype element size */
if(0 == (type_size = H5T_GET_SIZE(type)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get datatype size")
@@ -1081,7 +1100,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));
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 9e1ebe8..dd3508f 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -46,6 +46,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 */
@@ -83,14 +84,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);
@@ -99,7 +99,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);
@@ -391,6 +391,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,f)) < 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,f)) < 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,f) < 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,f) < 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.
@@ -651,35 +785,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() */
@@ -697,7 +828,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 */
@@ -715,12 +846,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 */
@@ -748,14 +879,11 @@ 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 */
- H5G_loc_t src_root_loc; /* Object location of source file root group */
herr_t ret_value = SUCCEED; /* Return value */
- hid_t plist_id = -1; /* Property list pointer */
- unsigned intent; /* File access permissions */
FUNC_ENTER_STATIC
@@ -768,31 +896,42 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
/* Check if we need to open the source file */
if(HDstrcmp(source_dset->file_name, ".")) {
- if((plist_id = H5D_get_access_plist((H5D_t *)vdset)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get access plist")
+ unsigned intent; /* File access permissions */
+
+ /* Get the virtual dataset's file open flags ("intent") */
intent = H5F_INTENT(vdset->oloc.file);
- if(NULL == (src_file = H5F_prefix_open_file(plist_id, vdset->oloc.file, H5D_ACS_VDS_PREFIX_NAME, source_dset->file_name, intent,
- vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id)))
- H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */
- else
+
+ /* Try opening the file */
+ src_file = H5F_prefix_open_file(vdset->oloc.file, H5F_PREFIX_VDS, vdset->shared->vds_prefix, source_dset->file_name, intent, vdset->shared->layout.storage.u.virt.source_fapl);
+
+ /* If we opened the source file here, we should close it when leaving */
+ if(src_file)
src_file_open = TRUE;
+ else
+ /* Reset the error stack */
+ H5E_clear_stack(NULL);
} /* end if */
else
/* Source file is ".", use the virtual dataset's file */
src_file = vdset->oloc.file;
if(src_file) {
+ H5G_loc_t src_root_loc; /* Object location of source file root group */
+
/* Set up the root group in the destination file */
if(NULL == (src_root_loc.oloc = H5G_oloc(H5G_rootof(src_file))))
HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to get object location for root group")
if(NULL == (src_root_loc.path = H5G_nameof(H5G_rootof(src_file))))
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))) {
- H5E_clear_stack(NULL); /* Quick hack until proper support for H5Dopen with missing file is implemented */
+ /* Try opening the source dataset */
+ source_dset->dset = H5D__open_name(&src_root_loc, source_dset->dset_name, vdset->shared->layout.storage.u.virt.source_dapl);
+
+ /* Dataset does not exist */
+ if(NULL == source_dset->dset) {
+ /* Reset the error stack */
+ H5E_clear_stack(NULL);
- /* Dataset does not exist */
source_dset->dset_exists = FALSE;
} /* end if */
else {
@@ -809,9 +948,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset,
} /* end if */
done:
- if(plist_id >= 0)
- H5Pclose(plist_id);
- /* Close source file */
+ /* Release resources */
if(src_file_open)
if(H5F_efc_close(vdset->oloc.file, src_file) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file")
@@ -1307,7 +1444,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];
@@ -1343,7 +1480,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 */
@@ -1481,7 +1618,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) {
@@ -1564,11 +1701,11 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id)
if(changed) {
/* Update VDS extent */
if(H5S_set_extent(dset->shared->space, new_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
/* 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 */
@@ -1687,24 +1824,24 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id)
/* Update top level virtual_select and clipped_virtual_select
* extents */
if(H5S_set_extent(storage->list[i].source_dset.virtual_select, new_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
if((storage->list[i].source_dset.clipped_virtual_select
!= storage->list[i].source_dset.virtual_select)
&& storage->list[i].source_dset.clipped_virtual_select)
if(H5S_set_extent(storage->list[i].source_dset.clipped_virtual_select, new_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
/* Update sub dataset virtual_select and clipped_virtual_select
* extents */
for(j = 0; j < storage->list[i].sub_dset_nalloc; j++)
if(storage->list[i].sub_dset[j].virtual_select) {
if(H5S_set_extent(storage->list[i].sub_dset[j].virtual_select, new_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
if((storage->list[i].sub_dset[j].clipped_virtual_select
!= storage->list[i].sub_dset[j].virtual_select)
&& storage->list[i].sub_dset[j].clipped_virtual_select)
if(H5S_set_extent(storage->list[i].sub_dset[j].clipped_virtual_select, new_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
} /* end if */
else
HDassert(!storage->list[i].sub_dset[j].clipped_virtual_select);
@@ -1735,7 +1872,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];
@@ -1765,7 +1902,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 */
@@ -1957,8 +2094,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 */
@@ -2108,7 +2244,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 */
@@ -2166,7 +2302,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 */
@@ -2191,7 +2327,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info,
/* Temporarily set extent of virtual selection to bounds */
if(H5S_set_extent(storage->list[i].sub_dset[j].virtual_select, vbounds_end) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
/* Get current VDS dimensions */
if(H5S_get_simple_extent_dims(io_info->dset->shared->space, tmp_dims, NULL) < 0)
@@ -2215,9 +2351,9 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info,
/* Set extents of virtual_select and
* clipped_virtual_select to virtual extent */
if(H5S_set_extent(storage->list[i].sub_dset[j].virtual_select, tmp_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
if(H5S_set_extent(storage->list[i].sub_dset[j].clipped_virtual_select, tmp_dims) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace")
} /* end if */
} /* end if */
@@ -2238,7 +2374,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
@@ -2275,7 +2411,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
@@ -2397,7 +2533,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 */
@@ -2514,8 +2650,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
@@ -2589,7 +2724,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 */
@@ -2700,7 +2835,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 */
@@ -2721,13 +2856,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:
@@ -2802,12 +2937,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() */
@@ -2826,7 +2959,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 */
@@ -2841,7 +2974,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 */
@@ -2866,7 +2999,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 */
@@ -2891,14 +3024,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/H5E.c b/src/H5E.c
index 741f0dd..eecf6e7 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -1342,7 +1342,7 @@ done:
* Programmer: Quincey Koziol
* Monday, October 18, 1999
*
- * Notes: Basically a new public API wrapper around the H5E_push_stack
+ * Notes: Basically a new public API wrapper around the H5E__push_stack
* function.
*
*-------------------------------------------------------------------------
@@ -1413,7 +1413,7 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line,
#endif /* H5_HAVE_VASPRINTF */
/* Push the error on the stack */
- if(H5E_push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0)
+ if(H5E__push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack")
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/H5Edeprec.c b/src/H5Edeprec.c
index f579773..9ff9f1f 100644
--- a/src/H5Edeprec.c
+++ b/src/H5Edeprec.c
@@ -216,7 +216,7 @@ H5Epush1(const char *file, const char *func, unsigned line,
H5TRACE6("e", "*s*sIuii*s", file, func, line, maj, min, str);
/* Push the error on the default error stack */
- if(H5E_push_stack(NULL, file, func, line, H5E_ERR_CLS_g, maj, min, str) < 0)
+ if(H5E__push_stack(NULL, file, func, line, H5E_ERR_CLS_g, maj, min, str) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack")
done:
diff --git a/src/H5Eint.c b/src/H5Eint.c
index 110c6bb..15953af 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -33,6 +33,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Epkg.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
@@ -662,7 +663,7 @@ H5E_set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data)
/*-------------------------------------------------------------------------
* Function: H5E_printf_stack
*
- * Purpose: Printf-like wrapper around H5E_push_stack.
+ * Purpose: Printf-like wrapper around H5E__push_stack.
*
* Return: Non-negative on success/Negative on failure
*
@@ -735,7 +736,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin
#endif /* H5_HAVE_VASPRINTF */
/* Push the error on the stack */
- if(H5E_push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0)
+ if(H5E__push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0)
HGOTO_DONE(FAIL)
done:
@@ -757,7 +758,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5E_push_stack
+ * Function: H5E__push_stack
*
* Purpose: Pushes a new error record onto error stack for the current
* thread. The error has major and minor IDs MAJ_ID and
@@ -777,7 +778,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line,
+H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line,
hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -789,7 +790,7 @@ H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line,
* HERROR(). HERROR() is called by HRETURN_ERROR() which could
* be called by FUNC_ENTER().
*/
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(cls_id > 0);
@@ -840,7 +841,7 @@ H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5E_push_stack() */
+} /* end H5E__push_stack() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Epkg.h b/src/H5Epkg.h
index 90f4f80..fcde1ca 100644
--- a/src/H5Epkg.h
+++ b/src/H5Epkg.h
@@ -134,6 +134,8 @@ H5_DLL herr_t H5E__term_deprec_interface(void);
#ifdef H5_HAVE_THREADSAFE
H5_DLL H5E_t *H5E_get_stack(void);
#endif /* H5_HAVE_THREADSAFE */
+H5_DLL herr_t H5E__push_stack(H5E_t *estack, const char *file, const char *func,
+ unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc);
H5_DLL ssize_t H5E_get_msg(const H5E_msg_t *msg_ptr, H5E_type_t *type,
char *msg, size_t size);
H5_DLL herr_t H5E_print(const H5E_t *estack, FILE *stream, hbool_t bk_compat);
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index 57e7485..19ab729 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) \
}
@@ -181,8 +179,6 @@ extern int H5E_mpi_error_str_len;
/* Library-private functions defined in H5E package */
H5_DLL herr_t H5E_init(void);
-H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func,
- unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc);
H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func,
unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...)H5_ATTR_FORMAT(printf, 8, 9);
H5_DLL herr_t H5E_clear_stack(H5E_t *estack);
diff --git a/src/H5F.c b/src/H5F.c
index 2cd65cb..6c2d594 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 */
}};
@@ -365,11 +365,11 @@ H5Fis_hdf5(const char *name)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified")
/* 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:
-
FUNC_LEAVE_API(ret_value)
} /* end H5Fis_hdf5() */
@@ -401,36 +401,35 @@ 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 */
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")
+ /* 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 +440,19 @@ 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")
FUNC_LEAVE_API(ret_value)
} /* end H5Fcreate() */
@@ -482,44 +481,43 @@ 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 */
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")
+ /* 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")
FUNC_LEAVE_API(ret_value)
} /* end H5Fopen() */
@@ -623,17 +621,15 @@ 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 */
+
+ /* 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:
@@ -658,37 +654,18 @@ done:
herr_t
H5Fclose(hid_t file_id)
{
- H5F_t *f = NULL;
- int nref;
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")
+ /* Close the file */
+ if(H5F__close(file_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed")
done:
FUNC_LEAVE_API(ret_value)
@@ -739,7 +716,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)
@@ -819,8 +796,8 @@ 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)
+ /* 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;
@@ -921,7 +898,8 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
/* 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:
@@ -1222,26 +1200,9 @@ 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 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:
FUNC_LEAVE_API(ret_value)
@@ -1260,82 +1221,23 @@ done:
herr_t
H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info)
{
- H5F_t *file; /* File object for file ID */
- unsigned i, j; /* Local index variable */
- size_t tot_size; /* Size of each retries[i] */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *file; /* File object for file ID */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*x", file_id, info);
/* Check args */
- if(!info)
+ if (!info)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
/* Get the file pointer */
if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
- /* Copy the # of bins for "retries" array */
- info->nbins = file->shared->retries_nbins;
-
- /* Initialize the array of "retries" */
- HDmemset(info->retries, 0, sizeof(info->retries));
-
- /* Return if there are no bins -- no retries */
- if(!info->nbins)
- HGOTO_DONE(SUCCEED);
-
- /* Calculate size for each retries[i] */
- tot_size = info->nbins * sizeof(uint32_t);
-
- /* Map and copy information to info's retries for metadata items with tracking for read retries */
- j = 0;
- for(i = 0; i < H5AC_NTYPES; i++) {
- switch(i) {
- case H5AC_OHDR_ID:
- case H5AC_OHDR_CHK_ID:
- case H5AC_BT2_HDR_ID:
- case H5AC_BT2_INT_ID:
- case H5AC_BT2_LEAF_ID:
- case H5AC_FHEAP_HDR_ID:
- case H5AC_FHEAP_DBLOCK_ID:
- case H5AC_FHEAP_IBLOCK_ID:
- case H5AC_FSPACE_HDR_ID:
- case H5AC_FSPACE_SINFO_ID:
- case H5AC_SOHM_TABLE_ID:
- case H5AC_SOHM_LIST_ID:
- case H5AC_EARRAY_HDR_ID:
- case H5AC_EARRAY_IBLOCK_ID:
- case H5AC_EARRAY_SBLOCK_ID:
- case H5AC_EARRAY_DBLOCK_ID:
- case H5AC_EARRAY_DBLK_PAGE_ID:
- case H5AC_FARRAY_HDR_ID:
- case H5AC_FARRAY_DBLOCK_ID:
- case H5AC_FARRAY_DBLK_PAGE_ID:
- case H5AC_SUPERBLOCK_ID:
- HDassert(j < H5F_NUM_METADATA_READ_RETRY_TYPES);
- if(file->shared->retries[i] != NULL) {
- /* Allocate memory for retries[i]
- *
- * This memory should be released by the user with
- * the H5free_memory() call.
- */
- if(NULL == (info->retries[j] = (uint32_t *)H5MM_malloc(tot_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-
- /* Copy the information */
- HDmemcpy(info->retries[j], file->shared->retries[i], tot_size);
- } /* end if */
-
- /* Increment location in info->retries[] array */
- j++;
- break;
-
- default:
- break;
- } /* end switch */
- } /* end for */
+ /* Get the retry info */
+ if(H5F__get_metadata_read_retry_info(file, info) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't get metadata read retry info")
done:
FUNC_LEAVE_API(ret_value)
@@ -1370,8 +1272,8 @@ 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)
+ /* 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:
@@ -1393,8 +1295,8 @@ 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 */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -1403,9 +1305,10 @@ 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 */
+ /* See if there's an EFC */
if(file->shared->efc)
- if(H5F_efc_release(file->shared->efc) < 0)
+ /* Release the EFC */
+ if(H5F__efc_release(file->shared->efc) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache")
done:
@@ -1417,48 +1320,16 @@ done:
* Function: H5Fstart_swmr_write
*
* Purpose: To enable SWMR writing mode for the file
- * 1) Refresh opened objects: part 1
- * 2) Flush & reset accumulator
- * 3) Mark the file in SWMR writing mode
- * 4) Set metadata read attempts and retries info
- * 5) Disable accumulator
- * 6) Evict all cache entries except the superblock
- * 7) Refresh opened objects (part 2)
- * 8) Unlock the file
- *
- * Pre-conditions:
- * 1) The file being opened has v3 superblock
- * 2) The file is opened with H5F_ACC_RDWR
- * 3) The file is not already marked for SWMR writing
- * 4) Current implementaion for opened objects:
- * --only allow datasets and groups without attributes
- * --disallow named datatype with/without attributes
- * --disallow opened attributes attached to objects
- * NOTE: Currently, only opened groups and datasets are allowed
- * when enabling SWMR via H5Fstart_swmr_write().
- * Will later implement a different approach--
- * set up flush dependency/proxy even for file opened without
- * SWMR to resolve issues with opened objects.
*
* Return: Non-negative on success/negative on failure
+ *
*-------------------------------------------------------------------------
*/
herr_t
H5Fstart_swmr_write(hid_t file_id)
{
- 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 */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *file = NULL; /* File info */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", file_id);
@@ -1467,175 +1338,15 @@ H5Fstart_swmr_write(hid_t file_id)
if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
- /* Should have write permission */
- if((H5F_INTENT(file) & H5F_ACC_RDWR) == 0)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "no write intent on file")
-
- if(file->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file superblock version should be at least 3")
-
- HDassert((file->shared->low_bound == H5F_LIBVER_V110) && (file->shared->high_bound == H5F_LIBVER_V110));
-
- /* Should not be marked for SWMR writing mode already */
- if(file->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file already in SWMR writing mode")
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(file_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
- HDassert(file->shared->sblock->status_flags & H5F_SUPER_WRITE_ACCESS);
-
- /* Check to see if cache image is enabled. Fail if so */
- if(H5C_cache_image_status(file, &ci_load, &ci_write) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status")
- 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")
-
- /* 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);
-
FUNC_LEAVE_API(ret_value)
} /* end H5Fstart_swmr_write() */
@@ -1760,7 +1471,11 @@ H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high)
if(NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "not a file ID")
- /* Call private set_libver_bounds function */
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(file_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info")
+
+ /* Call internal set_libver_bounds function */
if(H5F_set_libver_bounds(f, low, high) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "cannot set low/high bounds")
@@ -1770,7 +1485,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Fformat_convert_super (Internal)
+ * Function: H5Fformat_convert
*
* Purpose: Downgrade the superblock version to v2 and
* downgrade persistent file space to non-persistent
@@ -1782,57 +1497,26 @@ done:
herr_t
H5Fformat_convert(hid_t fid)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_t *f; /* File to flush */
+ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(fid) < 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:
FUNC_LEAVE_API(ret_value)
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..d74ea31 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 */
@@ -1041,8 +1042,11 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
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 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) */
@@ -1088,9 +1092,12 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz
if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
+ /* 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:
@@ -1359,7 +1366,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1378,24 +1384,12 @@ 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 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:
@@ -1421,7 +1415,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1439,24 +1432,12 @@ 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 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:
@@ -1496,13 +1477,16 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing)
if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
+ /* 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:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5FDflush() */
/*-------------------------------------------------------------------------
@@ -1516,15 +1500,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:
@@ -1559,13 +1544,16 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing)
if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
+ /* 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:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5FDtruncate() */
/*-------------------------------------------------------------------------
@@ -1579,15 +1567,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..3c1c7bb 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -36,6 +36,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 */
@@ -1265,7 +1266,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 +1275,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 +1301,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 +1310,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 08b1a3f..ee3277d 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 */
@@ -67,12 +68,6 @@ typedef struct H5FD_mpio_t {
haddr_t eoa; /*end-of-address marker */
haddr_t last_eoa; /* Last known end-of-address marker */
haddr_t local_eof; /* Local end-of-file address for each process */
- herr_t do_pre_trunc_barrier; /* hack to allow us to skip */
- /* unnecessary barriers in */
- /* H5FD_mpio_trucate() without a VFD */
- /* API change. This should be removed */
- /* as soon as be make the necessary */
- /* VFD API change. */
} H5FD_mpio_t;
/* Private Prototypes */
@@ -1045,9 +1040,6 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
file->eof = H5FD_mpi_MPIOff_to_haddr(size);
file->local_eof = file->eof;
- /* Mark initial barriers in H5FD_mpio_truncate() as necessary */
- file->do_pre_trunc_barrier = TRUE;
-
/* Set return value */
ret_value=(H5FD_t*)file;
@@ -1068,7 +1060,7 @@ done:
fprintf(stdout, "Leaving H5FD_mpio_open\n" );
#endif
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_mpio_open() */
/*-------------------------------------------------------------------------
@@ -1419,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;
@@ -1439,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;
@@ -1451,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 */
@@ -1476,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
@@ -1496,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
@@ -1517,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
@@ -1719,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;
@@ -1738,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;
@@ -1750,11 +1728,11 @@ 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);
+ /* Verify that no data is written when between MPI_Barrier()s during file flush */
+ HDassert(!H5CX_get_mpi_file_flushing());
+
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat, 0, sizeof(MPI_Status));
@@ -1770,13 +1748,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
@@ -1790,11 +1764,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
@@ -1818,10 +1790,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
@@ -1925,10 +1895,9 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
HDassert(H5FD_MPIO == file->pub.driver_id);
/* Only sync the file if we are not going to immediately close it */
- if(!closing) {
+ if(!closing)
if(MPI_SUCCESS != (mpi_code = MPI_File_sync(file->f)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mpi_code)
- } /* end if */
done:
#ifdef H5FDmpio_DEBUG
@@ -1941,44 +1910,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_mark_pre_trunc_barrier_unecessary
- *
- * Purpose: Hack to allow us to avoid most unnecessary barriers
- * prior in H5FD_mpio_truncate().
- *
- * This function should be deleted when next we modify the
- * VFD interface. This change should allow us to tell the
- * truncate function to omit the initial barrier if no
- * file I/O has occurred since the last barrier.
- *
- * Return: void
- *
- *
- * Programmer: John Mainzer
- * 12/14/17
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void
-H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file)
-{
- H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- HDassert(file);
- HDassert(H5FD_MPIO == file->pub.driver_id);
-
- file->do_pre_trunc_barrier = FALSE;
-
- FUNC_LEAVE_NOAPI_VOID
-
-} /* end H5FD_mpio_mark_pre_trunc_barrier_unecessary() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5FD_mpio_truncate
*
* Purpose: Make certain the file's size matches it's allocated size
@@ -2027,8 +1958,7 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
HDassert(file);
HDassert(H5FD_MPIO == file->pub.driver_id);
- if ( !H5F_addr_eq(file->eoa, file->last_eoa) ) {
-
+ if(!H5F_addr_eq(file->eoa, file->last_eoa)) {
int mpi_code; /* mpi return code */
MPI_Offset size;
MPI_Offset needed_eof;
@@ -2042,40 +1972,32 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
* and with no interviening writes to the file (with the possible
* exception of sueprblock / superblock extension message updates).
*
- * Unfortunately, the current VFD API doesn't let us pass in a
- * flag indicating whether this particular call is unnecessary.
- * To work around this, I have added the new function
- * H5FD_mpio_mark_pre_trunc_barrier_unecessary() allow us to
- * set a flag in H5FD_mpio_t indicating that we can skip the
- * barrier.
- *
- * This is a pretty ugly hack, but until we revise the VFD API,
- * it is about the best we can do.
+ * Check the "MPI file closing" flag in the API context to determine
+ * if we can skip the barrier.
*/
- if (file->do_pre_trunc_barrier) {
- if (MPI_SUCCESS!= (mpi_code=MPI_Barrier(file->comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed(1)", mpi_code)
- }
+ if(!H5CX_get_mpi_file_flushing())
+ if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
/* Only processor p0 will get the filesize and broadcast it. */
- if (file->mpi_rank == 0) {
- if (MPI_SUCCESS != (mpi_code=MPI_File_get_size(file->f, &size)))
+ /* (Note that throwing an error here will cause non-rank 0 processes
+ * to hang in following Bcast. -QAK, 3/17/2018)
+ */
+ if(0 == file->mpi_rank)
+ if(MPI_SUCCESS != (mpi_code = MPI_File_get_size(file->f, &size)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_get_size failed", mpi_code)
- } /* end if */
/* Broadcast file size */
- if(MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset),
- MPI_BYTE, 0, file->comm)))
+ if(MPI_SUCCESS != (mpi_code = MPI_Bcast(&size, (int)sizeof(MPI_Offset), MPI_BYTE, 0, file->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code)
if(H5FD_mpi_haddr_to_MPIOff(file->eoa, &needed_eof) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, \
- "cannot convert from haddr_t to MPI_Offset")
-
- if (size != needed_eof) /* eoa != eof. Set eof to eoa */ {
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset")
+ /* eoa != eof. Set eof to eoa */
+ if(size != needed_eof) {
/* Extend the file's size */
- if(MPI_SUCCESS != (mpi_code=MPI_File_set_size(file->f, needed_eof)))
+ if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, needed_eof)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code)
/* In general, we must wait until all processes have finished
@@ -2089,15 +2011,13 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
*/
if(MPI_SUCCESS != (mpi_code = MPI_Barrier(file->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
- }
+ } /* end if */
/* Update the 'last' eoa value */
file->last_eoa = file->eoa;
} /* end if */
done:
- file->do_pre_trunc_barrier = TRUE;
-
#ifdef H5FDmpio_DEBUG
if(H5FD_mpio_Debug[(int)'t'])
HDfprintf(stdout, "Leaving %s\n", FUNC);
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 f7cd931..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);
@@ -203,7 +177,6 @@ H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file);
H5_DLL int H5FD_mpi_get_size(const H5FD_t *file);
H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file);
H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info);
-H5_DLL void H5FD_mpio_mark_pre_trunc_barrier_unecessary(H5FD_t *_file);
#endif /* H5_HAVE_PARALLEL */
#endif /* !_H5FDprivate_H */
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)(&sect, &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 a9ffa43..f220e77 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,7 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -127,17 +129,14 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo)
} /* end else */
HDassert(f->shared);
- /* Reset file info struct */
- HDmemset(finfo, 0, sizeof(*finfo));
+ /* Get the current file info */
+ if(H5F__get_info(f, &finfo2) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info")
- /* 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")
-
- /* 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:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Fefc.c b/src/H5Fefc.c
index 5652d15..487ed2f 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
@@ -119,7 +120,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5F_efc_open
+ * Function: H5F__efc_open
*
* Purpose: Opens a file using the external file cache. The target
* file is added to the external file cache of the parent
@@ -138,15 +139,15 @@ 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)
+H5F__efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_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 */
hbool_t open_file = FALSE; /* Whether ent->file needs to be closed in case of error */
H5F_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/* Sanity checks */
HDassert(parent);
@@ -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;
@@ -307,7 +308,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_efc_open() */
+} /* end H5F__efc_open() */
/*-------------------------------------------------------------------------
@@ -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 24844a4..e6188e6 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.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 */
@@ -73,10 +74,13 @@ 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_name(const char *prefix, const char *file_name,
+ char **full_name/*out*/);
+static char *H5F__getenv_prefix_name(char **env_prefix/*in,out*/);
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);
/*********************/
@@ -100,6 +104,7 @@ H5FL_DEFINE(H5F_t);
H5FL_DEFINE(H5F_file_t);
+
/*-------------------------------------------------------------------------
* Function: H5F_get_access_plist
*
@@ -213,7 +218,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_access_plist() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_get_obj_count
*
@@ -241,7 +246,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_obj_count() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_get_obj_ids
*
@@ -268,7 +273,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_obj_ids() */
-
+
/*---------------------------------------------------------------------------
* Function: H5F_get_objects
*
@@ -370,7 +375,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_objects() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_get_objects_cb
*
@@ -479,6 +484,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_objects_cb() */
+
/*--------------------------------------------------------------------------
* Function: H5F__build_name
*
@@ -487,7 +493,7 @@ done:
* Return: Non-negative on success/Negative on failure
*--------------------------------------------------------------------------*/
static herr_t
-H5F__build_name(char *prefix, char *file_name, char **full_name/*out*/)
+H5F__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 */
@@ -500,7 +506,7 @@ H5F__build_name(char *prefix, char *file_name, char **full_name/*out*/)
/* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */
if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate filename buffer")
/* Compose the full file name */
HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix,
@@ -510,9 +516,9 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F__build_name() */
-
+
/*--------------------------------------------------------------------------
- * Function: H5F__getenv_prefix_name --
+ * Function: H5F__getenv_prefix_name
*
* Purpose: Get the first pathname in the list of pathnames stored in env_prefix,
* which is separated by the environment delimiter.
@@ -524,43 +530,49 @@ done:
static char *
H5F__getenv_prefix_name(char **env_prefix/*in,out*/)
{
- char *retptr=NULL;
- char *strret=NULL;
+ char *strret; /* Pointer to next separator */
+ char *ret_value = NULL; /* Return value */
- FUNC_ENTER_STATIC
+ FUNC_ENTER_STATIC_NOERR
+
+ /* Set return value now */
+ ret_value = *env_prefix;
+ /* Advance to next component, if possible */
strret = HDstrchr(*env_prefix, H5_COLON_SEPC);
- if (strret == NULL) {
- retptr = *env_prefix;
- *env_prefix = strret;
- } else {
- retptr = *env_prefix;
+ if(strret == NULL)
+ *env_prefix = NULL;
+ else {
+ /* Advance to next component */
*env_prefix = strret + 1;
+
+ /* Terminate current component (pointed to by ret_value) */
*strret = '\0';
- }
+ } /* end else */
- FUNC_LEAVE_NOAPI(retptr)
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__getenv_prefix_name() */
+
/*-------------------------------------------------------------------------
* Function: H5F_prefix_open_file
*
* Purpose: Attempts to open a dataset file.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Pointer to an opened file on success / NULL on failure
*-------------------------------------------------------------------------
*/
H5F_t *
-H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type,
- const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id)
+H5F_prefix_open_file(H5F_t *primary_file, H5F_prefix_open_t prefix_type,
+ const char *prop_prefix, const char *file_name, unsigned file_intent,
+ hid_t fapl_id)
{
H5F_t *src_file = NULL; /* Source file */
- H5F_t *ret_value = NULL; /* Actual return value */
char *full_name = NULL; /* File name with prefix */
- char *my_prefix = NULL; /* Library's copy of the prefix */
char *actual_file_name = NULL; /* File's actual name */
char *temp_file_name = NULL; /* Temporary pointer to file name */
size_t temp_file_name_len; /* Length of temporary file name */
+ H5F_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -572,15 +584,19 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
temp_file_name_len = HDstrlen(temp_file_name);
- /* target file_name is an absolute pathname: see RM for detailed description */
+ /* 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 == (src_file = H5F_efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) {
+ src_file = H5F__efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id);
+
+ /* Adjust temporary file name if file not opened */
+ if(NULL == src_file) {
char *ptr;
+ /* Reset the error stack */
H5E_clear_stack(NULL);
- /* get last component of file_name */
+ /* Get last component of file_name */
H5_GET_LAST_DELIMITER(file_name, ptr)
HDassert(ptr);
@@ -594,32 +610,40 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ
} /* end if */
else if(H5_CHECK_ABS_DRIVE(file_name)) {
/* Try opening file */
- if(NULL == (src_file = H5F_efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) {
+ src_file = H5F__efc_open(primary_file, file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id);
+ /* Adjust temporary file name if file not opened */
+ if(NULL == src_file) {
+ /* Reset the error stack */
H5E_clear_stack(NULL);
- /* strip "<drive-letter>:" */
+ /* Strip "<drive-letter>:" */
HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len);
temp_file_name[temp_file_name_len - 1] = '\0';
} /* end if */
} /* end if */
- /* try searching from paths set in the environment variable */
+ /* Try searching from paths set in the environment variable */
if(src_file == NULL) {
char *env_prefix;
- if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
+ /* Get the appropriate environment variable */
+ if(H5F_PREFIX_VDS == prefix_type)
env_prefix = HDgetenv("HDF5_VDS_PREFIX");
- else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0)
+ else if(H5F_PREFIX_ELINK == prefix_type)
env_prefix = HDgetenv("HDF5_EXT_PREFIX");
else
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "prefix name is not sensible")
+ HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, NULL, "prefix type is not sensible")
+
+ /* If environment variable is defined, iterate through prefixes it defines */
if(NULL != env_prefix) {
char *tmp_env_prefix, *saved_env;
+ /* Make a copy of the environment variable string */
if(NULL == (saved_env = tmp_env_prefix = H5MM_strdup(env_prefix)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ /* Loop over prefixes in environment variable */
while((tmp_env_prefix) && (*tmp_env_prefix)) {
char *out_prefix_name;
@@ -630,65 +654,74 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename")
} /* end if */
- src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id);
+ /* Try opening file */
+ src_file = H5F__efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id);
+
+ /* Release copy of file name */
full_name = (char *)H5MM_xfree(full_name);
- if(src_file != NULL)
+
+ /* Check for file not opened */
+ if(NULL == src_file)
+ /* Reset the error stack */
+ H5E_clear_stack(NULL);
+ /* Leave if file was opened */
+ else
break;
- H5E_clear_stack(NULL);
} /* end if */
} /* end while */
+
saved_env = (char *)H5MM_xfree(saved_env);
} /* end if */
} /* end if */
- /* try searching from property list */
- if(src_file == NULL) {
- ssize_t size = 0;
- H5E_BEGIN_TRY {
- if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
- size = H5Pget_virtual_prefix(plist_id, NULL, 0);
- else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0)
- size = H5Pget_elink_prefix(plist_id, NULL, 0);
- } H5E_END_TRY;
- if(size <= 0)
- my_prefix = NULL;
- else {
- /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */
- if(NULL == (my_prefix = (char *)H5MM_malloc((size_t)size + 1)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate prefix buffer")
- if (HDstrcmp(prefix_type, H5D_ACS_VDS_PREFIX_NAME) == 0)
- size = H5Pget_virtual_prefix(plist_id, my_prefix, (size_t)size+1);
- else if (HDstrcmp(prefix_type, H5L_ACS_ELINK_PREFIX_NAME) == 0)
- size = H5Pget_elink_prefix(plist_id, my_prefix, (size_t)size+1);
- if(size < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file prefix")
- if(my_prefix) {
- if(H5F__build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename")
- my_prefix = (char *)H5MM_xfree(my_prefix);
- if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
- H5E_clear_stack(NULL);
- full_name = (char *)H5MM_xfree(full_name);
- }
- }
- }
+ /* Try searching from property list */
+ if(src_file == NULL && prop_prefix) {
+ /* Construct name to open */
+ if(H5F__build_name(prop_prefix, temp_file_name, &full_name/*out*/) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename")
+
+ /* Try opening file */
+ src_file = H5F__efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id);
- /* try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */
+ /* Release name */
+ full_name = (char *)H5MM_xfree(full_name);
+
+ /* Check for file not opened */
+ if(NULL == src_file)
+ /* Reset the error stack */
+ H5E_clear_stack(NULL);
+ } /* end if */
+
+ /* Try searching from main file's "extpath": see description in H5F_open() & H5_build_extpath() */
if(src_file == NULL) {
char *dspath;
if(NULL != (dspath = H5F_EXTPATH(primary_file))) {
+ /* Construct name to open */
if(H5F__build_name(dspath, temp_file_name, &full_name/*out*/) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't prepend prefix to filename")
- if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
- H5E_clear_stack(NULL);
+
+ /* Try opening file */
+ src_file = H5F__efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id);
+
+ /* Release name */
full_name = (char *)H5MM_xfree(full_name);
+
+ /* Check for file not opened */
+ if(NULL == src_file)
+ /* Reset the error stack */
+ H5E_clear_stack(NULL);
} /* end if */
} /* end if */
- /* try the relative file_name stored in temp_file_name */
+ /* Try the relative file_name stored in temp_file_name */
if(src_file == NULL) {
- if(NULL == (src_file = H5F_efc_open(primary_file, temp_file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
+ /* Try opening file */
+ src_file = H5F__efc_open(primary_file, temp_file_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id);
+
+ /* Check for file not opened */
+ if(NULL == src_file)
+ /* Reset the error stack */
H5E_clear_stack(NULL);
} /* end if */
@@ -714,19 +747,24 @@ H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_typ
actual_file_name = (char *)H5MM_xfree(actual_file_name);
/* Try opening with the resolved name */
- if(NULL == (src_file = H5F_efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file, file name = '%s', temp_file_name = '%s'", file_name, temp_file_name)
+ src_file = H5F__efc_open(primary_file, full_name, file_intent, H5P_FILE_CREATE_DEFAULT, fapl_id);
+
+ /* Release name */
full_name = (char *)H5MM_xfree(full_name);
+
+ /* Check for file not opened */
+ if(NULL == src_file)
+ /* Reset the error stack */
+ H5E_clear_stack(NULL);
} /* end if */
/* Success */
ret_value = src_file;
+
done:
if((NULL == ret_value) && src_file)
if(H5F_efc_close(primary_file, src_file) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "can't close source file")
- if(my_prefix)
- my_prefix = (char *)H5MM_xfree(my_prefix);
if(full_name)
full_name = (char *)H5MM_xfree(full_name);
if(temp_file_name)
@@ -737,7 +775,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_prefix_open_file() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F__is_hdf5
*
@@ -752,28 +790,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);
@@ -783,10 +813,10 @@ 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() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_new
*
@@ -1032,7 +1062,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)
@@ -1046,7 +1076,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_new() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F__dest
*
@@ -1059,7 +1089,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 */
@@ -1071,14 +1101,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)")
@@ -1086,7 +1115,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")
@@ -1095,7 +1124,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)")
@@ -1109,7 +1138,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;
@@ -1142,7 +1171,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")
@@ -1160,7 +1189,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")
@@ -1171,12 +1200,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")
@@ -1215,19 +1244,15 @@ 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))
+ /* (Flushes any remaining dirty entries, which should only be the
+ * superblock and / or driver info at this point)
+ */
+ 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")
@@ -1248,7 +1273,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)
@@ -1303,9 +1328,81 @@ 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() */
+
+
/*-------------------------------------------------------------------------
* Function: H5F_open
*
@@ -1380,8 +1477,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' */
@@ -1390,18 +1486,17 @@ 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;
hbool_t set_flag = FALSE; /*set the status_flags in the superblock */
hbool_t clear = FALSE; /*clear the status_flags */
hbool_t evict_on_close; /* evict on close value from plist */
- H5F_t *ret_value = NULL; /*actual return value */
char *lock_env_var = NULL;/*env var pointer */
hbool_t use_file_locking; /*read from env var */
- hbool_t ci_load = FALSE; /* whether MDC ci load requested */
- hbool_t ci_write = FALSE; /* whether MDC CI write requested */
+ hbool_t ci_load = FALSE; /* whether MDC ci load requested */
+ hbool_t ci_write = FALSE; /* whether MDC CI write requested */
+ H5F_t *ret_value = NULL; /*actual return value */
FUNC_ENTER_NOAPI(NULL)
@@ -1588,19 +1683,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, fapl_id, TRUE) < 0)
+ if(H5F__super_read(file, a_plist, TRUE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
/* Create the page buffer before initializing the superblock */
@@ -1609,7 +1704,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 */
@@ -1683,9 +1778,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 */
@@ -1717,13 +1812,13 @@ 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)
} /* end H5F_open() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_flush_phase1
*
@@ -1733,7 +1828,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 */
@@ -1743,7 +1838,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")
@@ -1753,14 +1848,14 @@ 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")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__flush_phase1() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F__flush_phase2
*
@@ -1770,9 +1865,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
@@ -1781,59 +1875,57 @@ 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 */
#ifdef H5_HAVE_PARALLEL
- if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
+ if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI))
/* Since we just returned from a call to H5AC_flush(), we just
* passed through a barrier. Hence we can skip the barrier on
- * entry to the mpio file driver call below.
+ * entry to the mpio file driver truncate call below, and the first
+ * barrier in the following call to flush the cache again.
*/
- H5FD_mpio_mark_pre_trunc_barrier_unecessary(f->shared->lf);
- }
+ H5CX_set_mpi_file_flushing(TRUE);
#endif /* H5_HAVE_PARALLEL */
- if(H5FD_truncate(f->shared->lf, meta_dxpl_id, closing) < 0)
+
+ /* Truncate the file to the current allocated size */
+ 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")
+#ifdef H5_HAVE_PARALLEL
+ if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI))
+ /* Reset the "flushing the file" flag */
+ H5CX_set_mpi_file_flushing(FALSE);
+#endif /* H5_HAVE_PARALLEL */
/* 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")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__flush_phase2() */
-
+
/*-------------------------------------------------------------------------
- * Function: H5F__flush
+ * Function: H5F__flush_real
*
* Purpose: Flushes cached data.
*
@@ -1841,7 +1933,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)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -1851,45 +1943,136 @@ 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, FALSE) < 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) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information")
+
+done:
+ FUNC_LEAVE_NOAPI_VOL(ret_value)
} /* end H5F__flush() */
+
+/*-------------------------------------------------------------------------
+ * 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) < 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
+ * 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);
@@ -1921,10 +2104,10 @@ 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() */
+
/*-------------------------------------------------------------------------
* Function: H5F_try_close
*
@@ -1934,6 +2117,7 @@ done:
* - The file was unmounted
*
* Return: Non-negative on success/Negative on failure
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2068,14 +2252,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
@@ -2087,7 +2271,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 */
@@ -2097,7 +2281,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_try_close() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_get_id
*
@@ -2133,7 +2317,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_get_id() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_incr_nopen_objs
*
@@ -2154,7 +2338,7 @@ H5F_incr_nopen_objs(H5F_t *f)
FUNC_LEAVE_NOAPI(++f->nopen_objs)
} /* end H5F_incr_nopen_objs() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_decr_nopen_objs
*
@@ -2175,7 +2359,7 @@ H5F_decr_nopen_objs(H5F_t *f)
FUNC_LEAVE_NOAPI(--f->nopen_objs)
} /* end H5F_decr_nopen_objs() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_build_actual_name
*
@@ -2297,7 +2481,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_build_actual_name() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_addr_encode_len
*
@@ -2334,7 +2518,7 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp/*in,out*/, haddr_t addr)
FUNC_LEAVE_NOAPI_VOID
} /* end H5F_addr_encode_len() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_addr_encode
*
@@ -2358,7 +2542,7 @@ H5F_addr_encode(const H5F_t *f, uint8_t **pp/*in,out*/, haddr_t addr)
FUNC_LEAVE_NOAPI_VOID
} /* end H5F_addr_encode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_addr_decode_len
*
@@ -2422,7 +2606,7 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr
FUNC_LEAVE_NOAPI_VOID
} /* end H5F_addr_decode_len() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_addr_decode
*
@@ -2449,7 +2633,7 @@ H5F_addr_decode(const H5F_t *f, const uint8_t **pp/*in,out*/, haddr_t *addr_p/*o
FUNC_LEAVE_NOAPI_VOID
} /* end H5F_addr_decode() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_set_grp_btree_shared
*
@@ -2475,7 +2659,7 @@ H5F_set_grp_btree_shared(H5F_t *f, H5UC_t *rc)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_grp_btree_shared() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_set_sohm_addr
*
@@ -2500,7 +2684,7 @@ H5F_set_sohm_addr(H5F_t *f, haddr_t addr)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_sohm_addr() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_set_sohm_vers
*
@@ -2525,7 +2709,7 @@ H5F_set_sohm_vers(H5F_t *f, unsigned vers)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_sohm_vers() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_set_sohm_nindexes
*
@@ -2550,7 +2734,7 @@ H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_sohm_nindexes() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_set_store_msg_crt_idx
*
@@ -2575,6 +2759,7 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_store_msg_crt_idx() */
+
/*-------------------------------------------------------------------------
* Function: H5F_set_libver_bounds()
*
@@ -2590,9 +2775,11 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag)
*-------------------------------------------------------------------------
*/
herr_t
-H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high)
+H5F_set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE_VOL
/* Sanity checks */
HDassert(f);
@@ -2600,32 +2787,91 @@ H5F_set_libver_bounds(H5F_t * f, H5F_libver_t low, H5F_libver_t high)
/* Set the bounds only if the existing setting is different from the inputs */
if(f->shared->low_bound != low || f->shared->high_bound != high) {
+ /* Call the flush routine, for this file */
+ /* Note: This is done in case the binary format for representing a
+ * metadata entry class changes when the file format low / high
+ * bounds are changed and an unwritten entry of that class is
+ * sitting in the metadata cache.
+ *
+ * If that happens, it's possible that the entry's size could
+ * become larger, potentially corrupting the file (if the larger
+ * entry is fully written, overwriting data outside its allocated
+ * space), or corrupting the entry (if the entry is truncated to
+ * fit into the allocated space).
+ *
+ * Although I'm not aware of any metadata with this behavior
+ * currently, it would be very difficult to guard against and / or
+ * detect, but if we flush everything here, the format version
+ * for metadata entries in the cache will be finalized and these
+ * sorts of problems can be avoided.
+ *
+ * QAK - April, 2018
+ */
+ if(H5F__flush_real(f) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information")
+
+ /* Set the new bounds */
f->shared->low_bound = low;
f->shared->high_bound = high;
- }
+ } /* end if */
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_set_libver_bounds() */
/*-------------------------------------------------------------------------
- * 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)
@@ -2686,7 +2932,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;
@@ -2697,16 +2942,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 */
@@ -2720,10 +2958,60 @@ 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() */
+
/*-------------------------------------------------------------------------
* Function: H5F_track_metadata_read_retries
*
@@ -2771,7 +3059,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_track_metadata_read_retries() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F_set_retries
*
@@ -2807,7 +3095,40 @@ H5F_set_retries(H5F_t *f)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_set_retries() */
+
+/*-------------------------------------------------------------------------
+ * 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
*
@@ -2837,7 +3158,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_object_flush_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F__set_base_addr
*
@@ -2864,7 +3185,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__set_base_addr() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F__set_eoa
*
@@ -2891,7 +3212,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__set_eoa() */
-
+
/*-------------------------------------------------------------------------
* Function: H5F__set_paged_aggr
*
@@ -2919,6 +3240,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__set_paged_aggr() */
+
/*-------------------------------------------------------------------------
* Function: H5F__get_max_eof_eoa
*
@@ -2957,7 +3279,7 @@ done:
} /* end H5F__get_max_eof_eoa() */
#ifdef H5_HAVE_PARALLEL
-
+
/*-------------------------------------------------------------------------
* Function: H5F_set_coll_md_read
*
@@ -2981,3 +3303,384 @@ H5F_set_coll_md_read(H5F_t *f, H5P_coll_md_read_flag_t cmr)
FUNC_LEAVE_NOAPI_VOID
} /* H5F_set_coll_md_read() */
#endif /* H5_HAVE_PARALLEL */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F__get_metadata_read_retry_info
+ *
+ * Purpose: Private function to retrieve the collection of read retries
+ * for metadata items with checksum.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F__get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *info)
+{
+ unsigned i, j; /* Local index variable */
+ size_t tot_size; /* Size of each retries[i] */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Check args */
+ HDassert(file);
+ HDassert(info);
+
+ /* Copy the # of bins for "retries" array */
+ info->nbins = file->shared->retries_nbins;
+
+ /* Initialize the array of "retries" */
+ HDmemset(info->retries, 0, sizeof(info->retries));
+
+ /* Return if there are no bins -- no retries */
+ if (!info->nbins)
+ HGOTO_DONE(SUCCEED);
+
+ /* Calculate size for each retries[i] */
+ tot_size = info->nbins * sizeof(uint32_t);
+
+ /* Map and copy information to info's retries for metadata items with tracking for read retries */
+ j = 0;
+ for (i = 0; i < H5AC_NTYPES; i++) {
+ switch (i) {
+ case H5AC_OHDR_ID:
+ case H5AC_OHDR_CHK_ID:
+ case H5AC_BT2_HDR_ID:
+ case H5AC_BT2_INT_ID:
+ case H5AC_BT2_LEAF_ID:
+ case H5AC_FHEAP_HDR_ID:
+ case H5AC_FHEAP_DBLOCK_ID:
+ case H5AC_FHEAP_IBLOCK_ID:
+ case H5AC_FSPACE_HDR_ID:
+ case H5AC_FSPACE_SINFO_ID:
+ case H5AC_SOHM_TABLE_ID:
+ case H5AC_SOHM_LIST_ID:
+ case H5AC_EARRAY_HDR_ID:
+ case H5AC_EARRAY_IBLOCK_ID:
+ case H5AC_EARRAY_SBLOCK_ID:
+ case H5AC_EARRAY_DBLOCK_ID:
+ case H5AC_EARRAY_DBLK_PAGE_ID:
+ case H5AC_FARRAY_HDR_ID:
+ case H5AC_FARRAY_DBLOCK_ID:
+ case H5AC_FARRAY_DBLK_PAGE_ID:
+ case H5AC_SUPERBLOCK_ID:
+ HDassert(j < H5F_NUM_METADATA_READ_RETRY_TYPES);
+ if (file->shared->retries[i] != NULL) {
+ /* Allocate memory for retries[i]
+ *
+ * This memory should be released by the user with
+ * the H5free_memory() call.
+ */
+ if (NULL == (info->retries[j] = (uint32_t *)H5MM_malloc(tot_size)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+
+ /* Copy the information */
+ HDmemcpy(info->retries[j], file->shared->retries[i], tot_size);
+ }
+
+ /* Increment location in info->retries[] array */
+ j++;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F__get_metadata_read_retry_info() */
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F__start_swmr_write
+ *
+ * Purpose: Private version of H5Fstart_swmr_write
+ *
+ * 1) Refresh opened objects: part 1
+ * 2) Flush & reset accumulator
+ * 3) Mark the file in SWMR writing mode
+ * 4) Set metadata read attempts and retries info
+ * 5) Disable accumulator
+ * 6) Evict all cache entries except the superblock
+ * 7) Refresh opened objects (part 2)
+ * 8) Unlock the file
+ *
+ * Pre-conditions:
+ *
+ * 1) The file being opened has v3 superblock
+ * 2) The file is opened with H5F_ACC_RDWR
+ * 3) The file is not already marked for SWMR writing
+ * 4) Current implementaion for opened objects:
+ * --only allow datasets and groups without attributes
+ * --disallow named datatype with/without attributes
+ * --disallow opened attributes attached to objects
+ *
+ * Note: Currently, only opened groups and datasets are allowed
+ * when enabling SWMR via H5Fstart_swmr_write().
+ * Will later implement a different approach--
+ * set up flush dependency/proxy even for file opened without
+ * SWMR to resolve issues with opened objects.
+ *
+ * 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)
+{
+ hbool_t ci_load = FALSE; /* whether MDC ci load requested */
+ hbool_t ci_write = FALSE; /* whether MDC CI write requested */
+ 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);
+
+ /* Should have write permission */
+ if((H5F_INTENT(f) & H5F_ACC_RDWR) == 0)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "no write intent on file")
+
+ /* Check superblock version */
+ if(f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file superblock version - should be at least 3")
+
+ /* Check for correct file format version */
+ if((f->shared->low_bound != H5F_LIBVER_V110) || (f->shared->high_bound != H5F_LIBVER_V110))
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file format version does not support SWMR - needs to be 1.10 or greater")
+
+ /* Should not be marked for SWMR writing mode already */
+ if(f->shared->sblock->status_flags & H5F_SUPER_SWMR_WRITE_ACCESS)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file already in SWMR writing mode")
+
+ /* Check to see if cache image is enabled. Fail if so */
+ if(H5C_cache_image_status(f, &ci_load, &ci_write) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MDC cache image status")
+ 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(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) < 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 17d7850..e3a92fd 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,11 +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);
+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
*
@@ -41,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 */
@@ -61,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)
@@ -79,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
@@ -96,9 +100,8 @@ done:
*
*-------------------------------------------------------------------------
*/
-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)
+static herr_t
+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 */
@@ -111,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);
@@ -131,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
@@ -141,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 */
@@ -224,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:
@@ -240,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
@@ -262,8 +264,8 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
-H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id)
+static herr_t
+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 */
@@ -277,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);
@@ -292,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;
@@ -363,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 */
@@ -389,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() */
/*-------------------------------------------------------------------------
@@ -460,8 +461,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
@@ -503,8 +508,12 @@ H5Funmount(hid_t loc_id, const char *name)
if(!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
@@ -609,7 +618,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 */
@@ -622,11 +631,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) < 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 */
@@ -651,7 +660,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 */
@@ -665,7 +674,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 a4c1a24..f18826f 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -396,44 +396,53 @@ 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);
+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__get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *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_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id, hid_t dxpl_id);
-H5_DLL herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id);
-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, hid_t fapl_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, H5P_genplist_t *fa_plist, 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);
@@ -442,16 +451,18 @@ 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 H5F_t *H5F__efc_open(H5F_t *parent, const char *name, unsigned flags,
+ hid_t fcpl_id, hid_t fapl_id);
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);
@@ -460,7 +471,7 @@ H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, hbool_t paged);
H5_DLL herr_t H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa);
/* 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 1886c5c..ba4f4d8 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -660,20 +660,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 */
@@ -706,9 +692,17 @@ typedef enum H5F_mem_page_t {
H5F_MEM_PAGE_NTYPES = 13 /* Sentinel value - must be last */
} H5F_mem_page_t;
+/* Aliases for H5F_mem_page_t enum values */
#define H5F_MEM_PAGE_META H5F_MEM_PAGE_SUPER /* Small-sized meta data */
#define H5F_MEM_PAGE_GENERIC H5F_MEM_PAGE_LARGE_SUPER /* Large-sized generic: meta and raw */
+/* Type of prefix for opening prefixed files */
+typedef enum H5F_prefix_open_t {
+ H5F_PREFIX_VDS, /* Virtual dataset prefix */
+ H5F_PREFIX_ELINK /* External link prefix */
+} H5F_prefix_open_t;
+
+
/*****************************/
/* Library-private Variables */
/*****************************/
@@ -718,11 +712,11 @@ typedef enum H5F_mem_page_t {
/* Library-private Function Prototypes */
/***************************************/
-
/* 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*/);
+H5_DLL herr_t H5F_start_swmr_write(H5F_t *file);
/* Functions that retrieve values from the file struct */
H5_DLL H5F_libver_t H5F_get_low_bound(const H5F_t *f);
@@ -747,7 +741,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);
@@ -799,17 +793,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);
@@ -836,7 +830,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
@@ -849,17 +843,15 @@ H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info);
#endif /* H5_HAVE_PARALLEL */
/* 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);
H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file);
/* File prefix routines */
-H5_DLL H5F_t *H5F_prefix_open_file(hid_t plist_id, H5F_t *primary_file, const char *prefix_type,
- const char *file_name, unsigned file_intent, hid_t fapl_id, hid_t dxpl_id);
+H5_DLL H5F_t *H5F_prefix_open_file(H5F_t *primary_file, H5F_prefix_open_t prefix_type,
+ const char *prop_prefix, const char *file_name, unsigned file_intent, hid_t fapl_id);
/* 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 f7e222e..be24072 100644
--- a/src/H5Fquery.c
+++ b/src/H5Fquery.c
@@ -1203,7 +1203,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 3db9b2f..97a6d6f 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.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 "H5Fpkg.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
@@ -51,8 +52,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);
/*********************/
@@ -80,7 +81,7 @@ static const unsigned HDF5_superblock_ver_bounds[] = {
/*-------------------------------------------------------------------------
- * Function: H5F_super_ext_create
+ * Function: H5F__super_ext_create
*
* Purpose: Create the superblock extension
*
@@ -92,11 +93,11 @@ static const unsigned HDF5_superblock_ver_bounds[] = {
*-------------------------------------------------------------------------
*/
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);
@@ -120,7 +121,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 */
@@ -129,7 +130,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() */
/*-------------------------------------------------------------------------
@@ -171,7 +172,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5F_super_ext_close
+ * Function: H5F__super_ext_close
*
* Purpose: Close superblock extension
*
@@ -183,14 +184,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);
@@ -198,16 +197,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 */
@@ -218,12 +216,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() */
/*-------------------------------------------------------------------------
@@ -245,7 +243,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 */
@@ -294,7 +292,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) */
@@ -324,55 +322,38 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id, hbool_t initial_read)
+H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, 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 */
unsigned rw_flags; /* Read/write permissions for file */
hbool_t skip_eof_check = FALSE; /* Whether to skip checking the EOF value */
- H5P_genplist_t *a_plist; /* File access property list */
- herr_t ret_value = SUCCEED; /* Return value */
#ifdef H5_HAVE_PARALLEL
- int mpi_rank = 0, mpi_size = 1;
- int mpi_result;
+ int mpi_size = 1;
#endif /* H5_HAVE_PARALLEL */
+ herr_t ret_value = SUCCEED; /* Return value */
- 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
- if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
-
- if((mpi_rank = H5F_mpi_get_rank(f)) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Can't get MPI rank")
-
+ if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI))
if((mpi_size = H5F_mpi_get_size(f)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size")
- }
/* If we are an MPI application with at least two processes, the
* following superblock signature location optimization is applicable.
@@ -383,33 +364,50 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
* fact that we have skipped actually calling MPI functions to determine
* our MPI rank and size.
*/
- if ( mpi_size > 1 ) {
- MPI_Comm this_comm = MPI_COMM_NULL;
+ if(mpi_size > 1) {
+ MPI_Comm this_comm;
+ int mpi_rank;
+ int mpi_result;
- if ( mpi_rank == 0 ) {
- if (H5FD_locate_signature(&fdio_info, &super_addr) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature")
- }
+ /* Sanity check */
HDassert(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI));
- if ( MPI_COMM_NULL == (this_comm = H5F_mpi_get_comm(f)) )
+ /* Set up MPI info */
+ if((mpi_rank = H5F_mpi_get_rank(f)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Can't get MPI rank")
+ 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)))
+
+ /* Search for the file's signature only with rank 0 process */
+ if(0 == mpi_rank) {
+ herr_t status;
+
+ /* Try detecting file's siganture */
+ /* (Don't leave before Bcast, to avoid hang on error) */
+ H5E_BEGIN_TRY {
+ status = H5FD_locate_signature(file, &super_addr);
+ } H5E_END_TRY;
+
+ /* Set superblock address to undefined on error */
+ if(status < 0)
+ super_addr = HADDR_UNDEF;
+ } /* end if */
+
+ /* Broadcast superblock address to other processes */
+ 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)
+ if(!H5F_addr_defined(super_addr))
HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found")
/* Check for userblock present */
@@ -449,13 +447,11 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
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")
/*
@@ -603,12 +599,9 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
*/
/* Check if this private property exists in fapl */
- if(NULL == (a_plist = (H5P_genplist_t *)H5I_object(fapl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file access property list")
- if(H5P_exist_plist(a_plist, H5F_ACS_SKIP_EOF_CHECK_NAME) > 0) {
- if(H5P_get(a_plist, H5F_ACS_SKIP_EOF_CHECK_NAME, &skip_eof_check) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get clearance for persisting fsm addr")
- }
+ if(H5P_exist_plist(fa_plist, H5F_ACS_SKIP_EOF_CHECK_NAME) > 0)
+ if(H5P_get(fa_plist, H5F_ACS_SKIP_EOF_CHECK_NAME, &skip_eof_check) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get skip EOF check value")
if(H5F_INTENT(f) & H5F_ACC_SWMR_READ) {
/*
@@ -635,10 +628,8 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
* 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)) {
@@ -662,7 +653,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
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 */
@@ -677,7 +668,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
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 */
@@ -718,14 +709,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
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 */
@@ -743,15 +734,15 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
} /* 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 */
@@ -767,29 +758,29 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
} /* 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 */
- hbool_t null_fsm_addr = FALSE; /* Whether to drop free-space to the floor */
/* 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)) {
+ H5O_fsinfo_t fsinfo; /* File space info message from superblock extension */
+ hbool_t null_fsm_addr = FALSE; /* Whether to drop free-space to the floor */
- /* The tool h5clear uses this property to tell the library
- to drop free-space to the floor */
- if(H5P_exist_plist(a_plist, H5F_ACS_NULL_FSM_ADDR_NAME) > 0) {
- if(H5P_get(a_plist, H5F_ACS_NULL_FSM_ADDR_NAME, &null_fsm_addr) < 0)
+ /* The h5clear tool uses this property to tell the library
+ * to drop free-space to the floor
+ */
+ if(H5P_exist_plist(fa_plist, H5F_ACS_NULL_FSM_ADDR_NAME) > 0)
+ if(H5P_get(fa_plist, H5F_ACS_NULL_FSM_ADDR_NAME, &null_fsm_addr) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get clearance for persisting fsm addr")
- }
/* 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 */
@@ -845,7 +836,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
if(!skip_eof_check && !null_fsm_addr) {
HDassert((!f->shared->fs_persist) || (f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF));
HDassert(!f->shared->first_alloc_dealloc);
- }
+ } /* end if */
/* As "eoa_pre_fsm_fsalloc" may be undefined for a crashed file
* with persistant free space managers, therefore, set
@@ -855,7 +846,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
* close via H5MF_settle_meta_data_fsm() and H5MF_settle_raw_data_fsm().
*/
if((f->shared->eoa_pre_fsm_fsalloc != HADDR_UNDEF || null_fsm_addr) &&
- (H5F_INTENT(f) & H5F_ACC_RDWR))
+ (H5F_INTENT(f) & H5F_ACC_RDWR))
f->shared->first_alloc_dealloc = TRUE;
f->shared->fs_addr[0] = HADDR_UNDEF;
@@ -867,10 +858,9 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
* (2) dropping free-space to the floor (null_fsm_addr)
* nullify the addresses of the FSMs
*/
- if(f->shared->fs_persist && null_fsm_addr) {
+ if(f->shared->fs_persist && null_fsm_addr)
for(u = 0; u < NELMTS(fsinfo.fs_addr); u++)
f->shared->fs_addr[u] = fsinfo.fs_addr[u] = HADDR_UNDEF;
- }
/* For fsinfo.mapped: remove the FSINFO message from the superblock extension
and write a new message to the extension */
@@ -881,7 +871,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
#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.
*/
@@ -890,25 +880,26 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
#endif /* JRM */
if(null_fsm_addr) {
- if(H5F_super_ext_write_msg(f, meta_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_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension")
- } else {
- if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_FSINFO_ID) < 0)
+ } /* end if */
+ else {
+ 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")
- }
+ } /* end else */
#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */
f->shared->sblock = NULL;
#endif /* JRM */
- }
+ } /* end if */
} /* end if not marked "unknown" */
} /* 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);
@@ -927,7 +918,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
*/
/* 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 */
@@ -936,7 +927,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
} /* 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 */
@@ -973,14 +964,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
#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 */
@@ -992,7 +983,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
/* 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 */
@@ -1009,12 +1000,12 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hid_t fapl_id,
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
@@ -1027,7 +1018,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 */
@@ -1038,12 +1029,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() */
@@ -1064,15 +1055,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) */
@@ -1083,7 +1073,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)))
@@ -1259,12 +1249,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;
@@ -1272,7 +1261,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 */
@@ -1311,10 +1300,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) {
@@ -1326,18 +1313,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 ||
@@ -1349,7 +1335,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 */
@@ -1369,7 +1355,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);
@@ -1393,7 +1379,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 */
@@ -1416,7 +1402,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;
@@ -1426,12 +1412,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 */
@@ -1445,7 +1431,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
@@ -1462,7 +1448,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
@@ -1475,7 +1461,7 @@ done:
} /* end if */
} /* end if */
- FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
+ FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5F__super_init() */
@@ -1493,7 +1479,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 */
@@ -1517,10 +1503,9 @@ H5F_eoa_dirty(H5F_t *f, hid_t dxpl_id)
HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark drvinfo as dirty")
} /* 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)
+ else if(f->shared->drvinfo_sb_msg_exists)
+ 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 */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1606,9 +1591,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 */
@@ -1634,12 +1618,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 */
@@ -1651,16 +1634,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
*
@@ -1671,10 +1654,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 */
@@ -1682,16 +1664,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)) {
@@ -1700,42 +1681,42 @@ 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)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension")
+ 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 */
HDassert(H5F_addr_defined(ext_loc.addr));
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)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message or message exists")
+ if((status = H5O_msg_exists(&ext_loc, id)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check object header for message or message exists")
/* Check for creating vs. writing */
if(may_create) {
if(status)
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)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header")
+ /* 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) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to create the message in object header")
} /* end if */
else {
if(!status)
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)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header")
+ /* 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) < 0)
+ HGOTO_ERROR(H5E_FILE, 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 */
@@ -1743,11 +1724,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
*
@@ -1758,9 +1739,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 */
@@ -1768,14 +1748,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)
@@ -1783,26 +1762,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 */
@@ -1810,14 +1789,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..bdecad2 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
@@ -106,11 +108,19 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id,
if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+ /* Push API context */
+ 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 +145,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
@@ -143,11 +154,19 @@ H5F_check_cached_stab_test(hid_t file_id)
if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file")
+ /* Push API context */
+ 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..fa065fa 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,46 +289,45 @@ 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 */
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")
+ /* 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")
FUNC_LEAVE_API(ret_value)
} /* end H5Gcreate2() */
@@ -361,7 +361,7 @@ done:
* writing. Call H5Gclose() when finished with
* the group.
*
- * Failure: FAIL
+ * Failure: H5I_INVALID_HID
*
* Programmer: Peter Cao
* May 08, 2005
@@ -374,26 +374,25 @@ 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 */
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")
+ /* 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 +400,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,17 +412,17 @@ 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")
FUNC_LEAVE_API(ret_value)
} /* end H5Gcreate_anon() */
@@ -439,7 +438,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,35 +450,33 @@ 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 */
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")
+ /* 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")
FUNC_LEAVE_API(ret_value)
} /* end H5Gopen2() */
@@ -494,7 +491,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,18 +501,18 @@ done:
hid_t
H5Gget_create_plist(hid_t group_id)
{
- H5G_t *group = NULL;
- hid_t ret_value = FAIL;
+ H5G_t *group = NULL;
+ 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")
- 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:
FUNC_LEAVE_API(ret_value)
@@ -557,7 +554,7 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
/* 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:
@@ -583,11 +580,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -601,28 +593,15 @@ 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;
+ /* 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")
-
FUNC_LEAVE_API(ret_value)
} /* end H5Gget_info_by_name() */
@@ -646,11 +625,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -669,30 +643,15 @@ 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;
+ /* 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")
-
FUNC_LEAVE_API(ret_value)
} /* end H5Gget_info_by_idx() */
@@ -749,8 +708,8 @@ 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 */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", group_id);
@@ -759,9 +718,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(group_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -771,7 +734,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 +746,8 @@ 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 */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", group_id);
@@ -793,8 +756,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(group_id) < 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:
diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c
index 4702c46..721d591 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 obj_len, void *_udata)
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, obj_len, (const unsigned char *)obj)))
+ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (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, &ltable) < 0)
+ if(H5G__compact_build_table(oloc, linfo, idx_type, order, &ltable) < 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, &ltable) < 0)
+ if(H5G__compact_build_table(oloc, linfo, idx_type, order, &ltable) < 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, &ltable) < 0)
+ if(H5G__compact_build_table(oloc, linfo, idx_type, order, &ltable) < 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, &ltable) < 0)
+ if(H5G__compact_build_table(oloc, linfo, idx_type, order, &ltable) < 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, &ltable) < 0)
+ if(H5G__compact_build_table(oloc, linfo, H5_INDEX_NAME, H5_ITER_INC, &ltable) < 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 de11541..326561a 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 obj_len, void *_udata)
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, obj_len, (const unsigned char *)obj)))
+ if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (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, &ltable) < 0)
+ if(H5G__dense_build_table(f, linfo, idx_type, order, &ltable) < 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(&ltable) < 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 obj_len, void *_udata)
* 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, obj_len, (const unsigned char *)obj)))
+ if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (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, &ltable) < 0)
+ if(H5G__dense_build_table(f, linfo, idx_type, order, &ltable) < 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(&ltable) < 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 obj_len, void *_udata)
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, obj_len, (const unsigned char *)obj)))
+ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (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, &ltable) < 0)
+ if(H5G__dense_build_table(f, linfo, idx_type, order, &ltable) < 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(&ltable) < 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 obj_len, void *_udata)
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, obj_len, (const unsigned char *)obj)))
+ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (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 obj_len, void *_udata)
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 obj_len, void *_udata)
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 obj_len, void *_udata)
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, obj_len, (const unsigned char *)obj)))
+ if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (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, &ltable) < 0)
+ if(H5G__dense_build_table(f, linfo, idx_type, order, &ltable) < 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(&ltable) < 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, &ltable) < 0)
+ if(H5G__dense_build_table(f, linfo, H5_INDEX_NAME, H5_ITER_INC, &ltable) < 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..fc346f8 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 */
@@ -218,12 +230,15 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
else
tmp_gcpl = H5P_GROUP_CREATE_DEFAULT;
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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)
@@ -272,7 +287,7 @@ H5Gopen1(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
/* 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 +295,9 @@ 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 */
FUNC_LEAVE_API(ret_value)
} /* end H5Gopen1() */
@@ -311,23 +325,13 @@ 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 */
-
- /* Finish checking arguments */
- if(H5G_loc(cur_loc_id, &cur_loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(cur_loc_id) < 0)
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info")
- /* 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:
FUNC_LEAVE_API(ret_value)
@@ -357,28 +361,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(cur_loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -386,57 +375,74 @@ done:
/*-------------------------------------------------------------------------
- * 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,14 +455,18 @@ done:
herr_t
H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "i*s*s", src_loc_id, src_name, dst_name);
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(src_loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -474,14 +484,22 @@ 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 */
+ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(dst_loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -489,7 +507,7 @@ done:
/*-------------------------------------------------------------------------
- * 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 +524,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 +552,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() */
/*-------------------------------------------------------------------------
@@ -563,13 +578,17 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -577,6 +596,37 @@ done:
/*-------------------------------------------------------------------------
+ * 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
@@ -599,9 +649,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -609,6 +663,38 @@ done:
/*-------------------------------------------------------------------------
+ * 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 +714,7 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -639,8 +725,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -648,6 +739,37 @@ done:
/*-------------------------------------------------------------------------
+ * 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 +795,8 @@ 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 */
+ int ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf);
@@ -686,8 +808,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -695,6 +822,38 @@ done:
/*-------------------------------------------------------------------------
+ * 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 +883,19 @@ 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 */
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;
@@ -747,11 +906,11 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op,
lnk_op.op_func.op_old = op;
/* 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:
@@ -760,6 +919,39 @@ done:
/*-------------------------------------------------------------------------
+ * 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,26 +970,21 @@ 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 */
+ 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)
+ /* 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 */
@@ -809,6 +996,44 @@ done:
/*-------------------------------------------------------------------------
+ * 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 +1054,7 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -837,13 +1062,13 @@ 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")
/* 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:
FUNC_LEAVE_API(ret_value)
@@ -851,7 +1076,7 @@ done:
/*-------------------------------------------------------------------------
- * 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 +1089,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 +1118,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 +1151,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 +1171,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 +1191,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 +1205,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 +1220,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,23 +1250,18 @@ 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 */
+ 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")
/* 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:
@@ -1050,6 +1270,45 @@ done:
/*-------------------------------------------------------------------------
+ * 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 +1326,8 @@ 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 */
+ H5G_obj_t ret_value;
FUNC_ENTER_API(H5G_UNKNOWN)
H5TRACE2("Go", "ih", loc_id, idx);
@@ -1077,13 +1335,9 @@ 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")
/* 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:
@@ -1092,7 +1346,7 @@ done:
/*-------------------------------------------------------------------------
- * 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 +1361,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 6e076ae..baee35c 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -390,9 +390,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 */
@@ -411,7 +410,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;
@@ -439,8 +438,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);
@@ -461,23 +459,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 */
@@ -491,8 +486,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
@@ -506,7 +500,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; i<sn->nsyms; 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 5f9bdc8..af0e72c 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*/)
{
@@ -260,32 +256,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)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header")
+ 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_at_least_v18) {
/* 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 */
@@ -315,23 +311,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 */
@@ -339,7 +335,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 */
@@ -349,7 +345,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 */
@@ -357,10 +353,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() */
@@ -385,18 +381,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() */
@@ -428,8 +424,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:
@@ -456,7 +451,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 */
@@ -466,7 +461,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);
@@ -475,7 +470,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 */
@@ -499,7 +494,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 */
@@ -516,32 +511,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;
@@ -557,31 +551,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 */
@@ -594,19 +586,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 */
@@ -614,7 +605,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 */
@@ -628,7 +619,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 */
@@ -637,7 +628,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() */
@@ -657,22 +648,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 */
@@ -688,12 +679,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 */
@@ -703,12 +694,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() */
@@ -726,7 +717,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 */
@@ -748,18 +739,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 */
@@ -774,7 +765,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 */
@@ -806,19 +797,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 */
@@ -831,12 +822,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 */
@@ -846,17 +837,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
*
@@ -869,11 +860,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);
@@ -891,7 +882,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 */
@@ -899,7 +890,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 */
@@ -910,11 +901,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, &ltable) < 0)
+ if(H5G__dense_build_table(oloc->file, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, &ltable) < 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
@@ -931,7 +922,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")
@@ -940,7 +931,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 */
@@ -956,12 +947,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() */
/*-------------------------------------------------------------------------
@@ -978,21 +969,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 */
@@ -1001,31 +992,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() */
@@ -1044,20 +1034,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 */
@@ -1073,12 +1063,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 */
@@ -1091,18 +1081,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() */
@@ -1120,43 +1109,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() */
@@ -1176,19 +1163,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 */
@@ -1201,12 +1188,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 */
@@ -1216,11 +1203,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 20e595f..f0a9aea 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,
const uint8_t *p_end, 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 = &ltable;
/* 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(&ltable) < 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..f2f3e3a 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 c940161..84d5c5f 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, len, image)))
+ if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, NULL, H5O_PLINE_ID, len, 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 89b3b47..b1b8574 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 */
@@ -493,11 +493,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 */
@@ -513,7 +513,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_protect
+ * Function: H5HF__hdr_protect
*
* Purpose: Convenience wrapper around H5AC_protect on an indirect block
*
@@ -526,13 +526,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);
@@ -543,10 +543,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 */
@@ -560,7 +559,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() */
/*-------------------------------------------------------------------------
@@ -919,7 +918,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_skip_blocks
+ * Function: H5HF__hdr_skip_blocks
*
* Purpose: Add skipped direct blocks to free space for heap
*
@@ -932,14 +931,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.
@@ -959,16 +958,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.
@@ -984,11 +983,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.
@@ -998,7 +997,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 {
@@ -1014,7 +1013,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 */
@@ -1035,7 +1034,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 */
@@ -1052,7 +1051,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 {
@@ -1097,7 +1096,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 {
@@ -1106,11 +1105,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) */
@@ -1125,12 +1124,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 */
@@ -1146,7 +1145,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() */
/*-------------------------------------------------------------------------
@@ -1189,7 +1188,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
@@ -1203,7 +1202,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 */
@@ -1211,7 +1210,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.
@@ -1221,7 +1220,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 */
@@ -1304,7 +1303,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 */
@@ -1320,7 +1319,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 */
@@ -1331,11 +1330,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
*
@@ -1348,11 +1347,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);
@@ -1367,6 +1366,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;
@@ -1379,7 +1382,7 @@ H5HF_hdr_empty(H5HF_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5HF_hdr_empty() */
+} /* end H5HF__hdr_empty() */
/*-------------------------------------------------------------------------
@@ -1425,7 +1428,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5HF_hdr_delete
+ * Function: H5HF__hdr_delete
*
* Purpose: Delete a fractal heap, starting with the header
*
@@ -1438,12 +1441,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.
@@ -1469,35 +1472,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 */
@@ -1505,7 +1508,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 */
@@ -1514,9 +1517,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..5117394 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 */
@@ -2022,11 +2024,11 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size)
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)
+ /* 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:
@@ -2035,6 +2037,41 @@ done:
/*-------------------------------------------------------------------------
+ * 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..426c026 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..b26a8c4 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,7 @@ 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 */
+ 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 +324,10 @@ 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")
+ /* 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,8 +338,7 @@ 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:
@@ -349,8 +366,7 @@ 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 */
+ 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 +386,10 @@ 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")
+ /* 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,8 +400,7 @@ 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:
@@ -413,11 +427,10 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -433,13 +446,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -468,8 +481,7 @@ 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 */
+ 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 +501,9 @@ 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")
+ /* 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,9 +516,8 @@ 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:
FUNC_LEAVE_API(ret_value)
@@ -542,8 +553,7 @@ 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 */
+ 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,12 +567,12 @@ 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")
+ /* 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:
@@ -591,7 +601,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -603,12 +612,12 @@ 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")
+ /* 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:
@@ -636,12 +645,10 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -657,20 +664,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -701,7 +701,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -713,13 +712,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -750,8 +749,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -768,23 +765,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -808,8 +795,7 @@ 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;
+ htri_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("t", "i*si", loc_id, name, lapl_id);
@@ -820,13 +806,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -852,8 +838,7 @@ 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;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id);
@@ -864,13 +849,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -897,8 +882,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -915,21 +898,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -969,8 +944,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 +1065,7 @@ 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 */
+ 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,26 +1081,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -1152,11 +1116,8 @@ 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 */
+ 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,21 +1133,9 @@ 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;
-
/* 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:
FUNC_LEAVE_API(ret_value)
@@ -1220,11 +1169,7 @@ 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 */
+ 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,27 +1185,14 @@ 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;
+ /* 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:
FUNC_LEAVE_API(ret_value)
} /* end H5Literate_by_name() */
@@ -1315,9 +1247,9 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -1356,7 +1288,6 @@ 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 */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1373,12 +1304,12 @@ 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")
+ /* 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:
@@ -1572,7 +1503,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 +1525,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 +1547,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 +1568,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 +1577,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_link_cb
+ * Function: H5L__link_cb
*
* Purpose: Callback for creating a link to an object.
*
@@ -1658,7 +1589,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 +1600,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 +1615,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 +1630,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 +1642,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 +1654,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 +1679,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 +1708,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 +1729,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 +1752,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 +1762,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 +1772,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 +1794,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 +1804,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 +1818,7 @@ done:
H5MM_xfree(norm_link_name);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_create_real() */
+} /* end H5L__create_real() */
/*-------------------------------------------------------------------------
@@ -1907,8 +1835,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 +1856,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 +1865,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 +1877,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 +1895,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 +1947,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 +1962,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 +1982,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 +2033,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 +2066,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 +2090,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 +2130,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 +2146,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 +2168,7 @@ done:
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_get_val_cb() */
+} /* end H5L__get_val_cb() */
/*-------------------------------------------------------------------------
@@ -2188,8 +2191,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 +2207,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 +2216,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 +2265,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 +2274,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 +2299,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 +2362,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 +2394,7 @@ done:
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_delete_cb() */
+} /* end H5L__delete_cb() */
/*-------------------------------------------------------------------------
@@ -2327,9 +2410,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 +2423,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 +2439,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 +2487,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 +2572,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 +2583,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 +2601,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 +2621,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 +2648,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 +2666,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 +2684,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 +2716,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 +2741,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 +2749,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 +2769,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 +2780,7 @@ done:
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_move_cb() */
+} /* end H5L__move_cb() */
/*-------------------------------------------------------------------------
@@ -2642,19 +2804,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 +2841,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 +2864,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 +2977,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 +3011,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 +3035,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 +3048,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 +3063,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5L_exists
+ * Function: H5L__exists
*
* Purpose: Returns whether a link exists in a group
*
@@ -2891,12 +3078,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 +3091,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 +3115,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 +3138,7 @@ done:
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5L_get_info_cb() */
+} /* end H5L__get_info_cb() */
/*-------------------------------------------------------------------------
@@ -2967,8 +3154,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 +3162,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 +3173,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 +3222,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 +3231,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 +3256,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 +3319,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 +3342,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 +3500,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 +3512,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 +3534,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 +3569,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 +3591,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 +3610,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 bf0a044..7c32309 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 "H5Fprivate.h" /* Files */
#include "H5Gpkg.h" /* Groups */
@@ -56,10 +57,9 @@
/********************/
/* 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 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);
@@ -85,13 +85,13 @@ 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_extern_traverse
+ * Function: H5L__extern_traverse
*
* Purpose: Default traversal function for external links. This can
* be overridden using H5Lregister().
@@ -106,27 +106,13 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{
*
* 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 */
H5G_loc_t root_loc; /* Location of root group in external file */
@@ -143,11 +129,11 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group,
char *parent_group_name = NULL;/* Temporary pointer to group name */
char local_group_name[H5L_EXT_TRAVERSE_BUF_SIZE]; /* Local buffer to hold group 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 */
+ H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */
+ char *elink_prefix; /* Pointer to elink prefix */
hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(p);
@@ -168,10 +154,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")
@@ -209,7 +191,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 */
@@ -224,7 +206,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 */
@@ -240,17 +222,21 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group,
if(H5P_set(fa_plist, H5F_ACS_CLOSE_DEGREE_NAME, &fc_degree) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree")
+ /* Get the current elink prefix */
+ if(H5P_peek(plist, H5L_ACS_ELINK_PREFIX_NAME, &elink_prefix) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix")
+
/* Search for the target file */
- if(NULL == (ext_file = H5F_prefix_open_file(lapl_id, loc.oloc->file, H5L_ACS_ELINK_PREFIX_NAME, file_name, intent, fapl_id, dxpl_id)))
+ if(NULL == (ext_file = H5F_prefix_open_file(loc.oloc->file, H5F_PREFIX_ELINK, elink_prefix, file_name, intent, fapl_id)))
HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s'", file_name)
/* 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;
@@ -270,11 +256,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().
@@ -291,7 +277,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 */
@@ -320,7 +306,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() */
/*-------------------------------------------------------------------------
@@ -354,7 +340,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -373,7 +358,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;
@@ -389,12 +374,12 @@ 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")
+ /* 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:
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..59ee1fc 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,20 +1559,18 @@ 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)
+ else
+ 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 */
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 +1589,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 +1612,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 +1621,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 +1647,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 +1678,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 +1706,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 +1722,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 +1762,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 +1781,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 +1831,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 +1873,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 +1888,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 +1926,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 +1948,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 +1993,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 +2027,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 +2060,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 +2099,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 +2119,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 +2139,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 +2162,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 +2177,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 +2185,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 +2207,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 +2221,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 +2270,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 +2310,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 +2328,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 +2349,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 +2381,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 +2407,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 +2424,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 +2438,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], &sect_udata, &nums) < 0)
+ if(H5MF__get_free_sects(f, f->shared->fs_man[ty], &sect_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 +2446,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 +2456,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 +2508,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 +2529,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 +2639,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 +2647,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 +2697,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 +2705,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 +2769,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 +2781,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 +2796,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 +2822,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 +2852,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 +2901,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 +2942,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 +2974,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 +2991,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 +3102,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 +3116,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 +3170,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 +3236,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 +3330,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 +3368,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 +3551,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 +3563,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 +3573,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 +3624,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 +3641,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 +3669,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 +3683,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 +3698,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 +3710,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 +3723,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 +3735,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 +3763,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 +3774,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..fe140a7 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 */
+ NULL, /* Can section shrink container?*/
+ NULL, /* 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 {
@@ -695,6 +694,12 @@ done:
*
* Note: A small section is allowed to shrink only at closing.
*
+ * Note: This is unused currently, to maintain the invariant that the
+ * file size is always a multiple of the page size.
+ *
+ * (This function should probably be deleted, or the invariant
+ * relaxed)
+ *
* Return: Success: non-negative (TRUE/FALSE)
* Failure: negative
*
@@ -747,6 +752,12 @@ done:
*
* Purpose: Shrink container with section
*
+ * Note: This is unused currently, to maintain the invariant that the
+ * file size is always a multiple of the page size.
+ *
+ * (This function should probably be deleted, or the invariant
+ * relaxed)
+ *
* Return: Success: non-negative
* Failure: negative
*
@@ -772,7 +783,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 +883,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 +1084,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 109bf99..f700ac9 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 */
@@ -98,8 +99,7 @@
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 */
hid_t ret_value = FAIL;
FUNC_ENTER_API(FAIL)
@@ -111,12 +111,12 @@ 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")
+ /* 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:
@@ -151,12 +151,7 @@ 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 */
hid_t ret_value = FAIL;
FUNC_ENTER_API(FAIL)
@@ -172,30 +167,15 @@ 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;
+ /* 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")
-
FUNC_LEAVE_API(ret_value)
} /* end H5Oopen_by_idx() */
@@ -238,36 +218,23 @@ 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 */
+ 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")
-
- /* 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 */
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no address supplied")
/* 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:
-
FUNC_LEAVE_API(ret_value)
} /* end H5Oopen_by_addr() */
@@ -297,9 +264,8 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -322,12 +288,12 @@ 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")
+ /* 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:
@@ -358,8 +324,8 @@ done:
herr_t
H5Oincr_refcount(hid_t object_id)
{
- H5O_loc_t *oloc;
- herr_t ret_value = SUCCEED;
+ H5O_loc_t *oloc; /* Object location */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", object_id);
@@ -368,7 +334,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(object_id) < 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:
@@ -399,8 +370,8 @@ done:
herr_t
H5Odecr_refcount(hid_t object_id)
{
- H5O_loc_t *oloc;
- herr_t ret_value = SUCCEED;
+ H5O_loc_t *oloc; /* Object location */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", object_id);
@@ -409,7 +380,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(object_id) < 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:
@@ -434,7 +410,6 @@ 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 */
htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -446,12 +421,12 @@ 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")
+ /* 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:
@@ -488,8 +463,8 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
/* 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:
FUNC_LEAVE_API(ret_value)
@@ -513,7 +488,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -527,13 +501,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -559,11 +533,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -582,29 +551,15 @@ 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;
+ /* 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")
-
FUNC_LEAVE_API(ret_value)
} /* end H5Oget_info_by_idx() */
@@ -639,9 +594,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(obj_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -670,7 +629,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -682,13 +640,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -725,8 +683,8 @@ H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
/* 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:
FUNC_LEAVE_API(ret_value)
@@ -754,7 +712,6 @@ 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 */
ssize_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -766,13 +723,13 @@ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -829,7 +786,7 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified")
/* 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:
@@ -873,7 +830,6 @@ 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 */
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -890,12 +846,12 @@ 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")
+ /* 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:
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index b85337a..7f4f17f 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, size_t p_size, const uint8_t *p);
+static void *H5O__ainfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,7 +103,7 @@ 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -112,7 +111,7 @@ H5O_ainfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *o
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);
@@ -162,7 +161,7 @@ done:
ainfo = H5FL_FREE(H5O_ainfo_t, ainfo);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_ainfo_decode() */
+} /* end H5O__ainfo_decode() */
/*-------------------------------------------------------------------------
@@ -296,9 +295,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
*
@@ -308,20 +307,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
@@ -335,12 +334,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);
@@ -348,15 +347,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() */
/*-------------------------------------------------------------------------
@@ -394,7 +392,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
*
@@ -407,15 +405,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);
@@ -435,13 +433,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 */
@@ -453,11 +451,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
@@ -473,30 +471,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.
*
@@ -509,12 +505,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);
@@ -540,5 +536,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..570e16d 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,37 +1750,42 @@ 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(curr_chk_proxy);
- HDassert((void *)curr_chk_proxy == cont_targ_chk_proxy->parent);
+ /* Check for flush dependency on previous continuation chunk */
+ /* (As opposed to chunk 0) */
+ if(cont_targ_chk_proxy->fd_parent) {
+ /* Remove flush dependency on old continuation
+ * message chunk */
+ HDassert(cont_targ_chk_proxy);
+ HDassert(curr_chk_proxy);
+ 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")
+ 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;
+ } /* end if */
- /* Create flush dependency on new continuation
- * message chunk */
- if(H5AC_create_flush_dependency(null_chk_mdc_obj, cont_targ_chk_proxy) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
+ /* Avoid (another) flush dependency on chunk 0 */
+ if(0 != null_msg->chunkno) {
+ /* Sanity checks */
+ HDassert(null_chk_mdc_obj);
+ HDassert(((H5C_cache_entry_t *)null_chk_mdc_obj)->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(((H5C_cache_entry_t *)null_chk_mdc_obj)->type);
+ HDassert(((H5C_cache_entry_t *)null_chk_mdc_obj)->type->id == H5AC_OHDR_CHK_ID);
- HDassert(null_chk_mdc_obj);
- HDassert(((H5C_cache_entry_t *)null_chk_mdc_obj)->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDassert(((H5C_cache_entry_t *)null_chk_mdc_obj)->type);
- 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));
+ /* Create flush dependency on new continuation
+ * message chunk */
+ if(H5AC_create_flush_dependency(null_chk_mdc_obj, cont_targ_chk_proxy) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDEPEND, FAIL, "unable to create flush dependency")
- cont_targ_chk_proxy->parent = null_chk_mdc_obj;
+ cont_targ_chk_proxy->fd_parent = null_chk_mdc_obj;
+ } /* end if */
- /* Unprotect continuation message target chunk
- */
- if(H5O_chunk_unprotect(f, dxpl_id, cont_targ_chk_proxy, FALSE) < 0)
+ /* Unprotect continuation message target chunk */
+ 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 +1810,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 +1825,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 +1874,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 +1900,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 +1934,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 +1963,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 +2025,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 +2039,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 +2051,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 +2059,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 +2106,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 +2142,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 +2173,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 +2197,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 +2212,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 +2234,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 +2288,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 +2308,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 +2339,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 +2352,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 +2370,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 +2411,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 +2504,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 +2515,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 +2527,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 79a0a52..f2c31d7 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, size_t p_size, 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, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5A_t *attr = NULL;
@@ -184,7 +183,7 @@ 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,
+ 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, attr->shared->dt_size, p)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype")
if(attr->shared->version < H5O_ATTR_VERSION_2)
@@ -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, attr->shared->ds_size, 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() */
/*-------------------------------------------------------------------------
@@ -652,7 +644,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_attr_copy_file
+ * Function: H5O__attr_copy_file
*
* Purpose: Copies a message from _MESG to _DEST in file
*
@@ -666,13 +658,13 @@ done:
*-------------------------------------------------------------------------
*/
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);
@@ -686,16 +678,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
@@ -711,21 +703,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() */
/*-------------------------------------------------------------------------
@@ -789,11 +779,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
@@ -806,15 +796,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);
@@ -878,17 +867,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 02e0e6a..92fd218 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, size_t p_size, const uint8_t *p);
+static void *H5O__bogus_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,14 +110,14 @@ 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,
size_t H5_ATTR_UNUSED p_size, 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);
@@ -142,7 +142,7 @@ done:
H5MM_xfree(mesg);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_bogus_decode() */
+} /* end H5O__bogus_decode() */
/*-------------------------------------------------------------------------
@@ -203,7 +203,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.
*
@@ -218,12 +218,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);
@@ -236,6 +236,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 1d2b607..5a98e59 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,
+static void *H5O_btreek_decode(H5F_t *f, H5O_t *open_oh,
unsigned mesg_flags, unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -220,7 +220,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.
*
@@ -232,12 +232,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);
@@ -254,5 +254,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 2260e12..3607839 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -810,7 +810,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;
@@ -923,7 +923,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
@@ -938,37 +937,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 */
{
@@ -1007,17 +995,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)
@@ -1034,10 +1026,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() */
@@ -1540,7 +1528,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_size, mesg->raw);
+ cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, NULL, 0, &ioflags, mesg->raw_size, 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 */
@@ -1556,7 +1544,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_size, mesg->raw);
+ refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, NULL, 0, &ioflags, mesg->raw_size, 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 d2b65bb..ad64297 100644
--- a/src/H5Ocache_image.c
+++ b/src/H5Ocache_image.c
@@ -37,18 +37,17 @@
#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,
- unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
+static void *H5O__mdci_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, const uint8_t *p);
static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared,
uint8_t *p, const void *_mesg);
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, size_t H5_ATTR_UNUSED p_size, 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,
+ size_t H5_ATTR_UNUSED p_size, 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 f9a9768..2eb27d6 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, size_t p_size, const uint8_t *p);
+static void *H5O_cont_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -187,9 +187,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
*
@@ -199,20 +199,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
*
@@ -224,12 +224,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);
@@ -237,16 +237,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.
*
@@ -261,12 +261,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);
@@ -286,4 +286,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 74c02f4..e6865f1 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,10 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -231,8 +224,57 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(src_loc_id) < 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:
+ 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 +285,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 +296,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 +304,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 +322,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 +344,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 +371,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 +380,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 +412,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) {
@@ -493,7 +529,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)
/* Save destination file pointer in cpy_info so that it can be used
in the pre_copy_file callback to obtain the destination file's
@@ -571,7 +607,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.
@@ -581,9 +617,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
@@ -664,7 +700,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;
@@ -767,7 +803,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 */
@@ -832,7 +868,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 */
@@ -854,16 +890,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) {
@@ -878,7 +914,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 */
@@ -896,8 +932,8 @@ done:
} /* 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() */
/*-------------------------------------------------------------------------
@@ -915,8 +951,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 */
@@ -950,8 +986,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 */
@@ -990,7 +1025,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:
@@ -1000,11 +1035,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)
@@ -1018,11 +1053,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);
@@ -1037,11 +1072,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.
*
@@ -1053,8 +1088,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 */
@@ -1063,7 +1098,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);
@@ -1118,26 +1153,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
*
@@ -1149,8 +1187,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 */
@@ -1159,7 +1197,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);
@@ -1174,12 +1212,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
@@ -1187,7 +1225,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;
@@ -1197,11 +1235,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.
*
@@ -1213,19 +1251,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 */
@@ -1251,7 +1288,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);
@@ -1259,7 +1296,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() */
/*-------------------------------------------------------------------------
@@ -1275,9 +1312,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 */
@@ -1323,7 +1359,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
@@ -1352,7 +1388,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 */
@@ -1361,7 +1397,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 */
@@ -1371,7 +1407,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 */
@@ -1398,7 +1434,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.
*
@@ -1410,12 +1446,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);
@@ -1426,11 +1462,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.
@@ -1445,13 +1481,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. */
@@ -1466,7 +1502,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 */
/*-------------------------------------------------------------------------
@@ -1564,10 +1600,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
@@ -1590,7 +1622,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
@@ -1601,7 +1633,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 */
@@ -1626,7 +1658,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
@@ -1654,8 +1686,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:
@@ -1677,7 +1708,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
@@ -1691,7 +1722,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 */
@@ -1701,7 +1732,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);
@@ -1718,7 +1749,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;
@@ -1733,11 +1764,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
@@ -1754,8 +1785,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 */
@@ -1763,7 +1794,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);
@@ -1777,7 +1808,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 */
@@ -1786,7 +1817,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 */
@@ -1812,12 +1843,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);
@@ -1877,11 +1907,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 */
@@ -1908,11 +1937,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.
@@ -1925,14 +1954,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);
@@ -1948,7 +1977,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 */
@@ -1975,5 +2004,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<No info for this message>\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 5921be3..159c950 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, size_t p_size, const uint8_t *p);
+static void *H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -246,7 +246,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.
@@ -260,11 +260,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);
@@ -273,11 +273,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.
*
@@ -289,12 +289,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);
@@ -309,6 +309,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 c557b5c..8060398 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, size_t p_size, const uint8_t *p);
+static void *H5O_dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,7 +1091,7 @@ 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,
+H5O_dtype_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags,
unsigned *ioflags/*in,out*/, size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
H5T_t *dt = NULL;
@@ -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:
@@ -1559,7 +1555,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_dtype_copy_file
+ * Function: H5O__dtype_copy_file
*
* Purpose: Copy a native datatype message from one file to another.
*
@@ -1572,14 +1568,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)))
@@ -1594,12 +1590,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
@@ -1612,14 +1609,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));
@@ -1633,16 +1630,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
@@ -1656,8 +1653,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;
@@ -1665,7 +1662,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);
@@ -1749,13 +1746,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);
@@ -1985,7 +1982,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) {
@@ -2169,5 +2166,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 f066964..6a81a46 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, size_t p_size, const uint8_t *p);
+static void *H5O_efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -127,7 +127,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);
@@ -144,7 +144,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 */
@@ -348,7 +348,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.
@@ -361,12 +361,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);
@@ -383,7 +383,7 @@ H5O_efl_reset(void *_mesg)
mesg->nused = mesg->nalloc = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_efl_reset() */
+} /* end H5O__efl_reset() */
/*-------------------------------------------------------------------------
@@ -426,7 +426,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_efl_copy_file
+ * Function: H5O__efl_copy_file
*
* Purpose: Copies an efl message from _MESG to _DEST in file
*
@@ -440,9 +440,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;
@@ -450,7 +450,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);
@@ -469,15 +469,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);
@@ -494,7 +494,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 */
@@ -510,12 +510,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.
*
@@ -527,13 +527,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);
@@ -573,5 +573,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 849435c..932241f 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -32,21 +32,21 @@
#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, size_t p_size, const uint8_t *p);
+static void *H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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, size_t p_size, const uint8_t *p);
+static void *H5O_fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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_pre_copy_file(H5F_t *file_src, const void *mesg_src,
+static herr_t H5O__fill_reset(void *_mesg);
+static herr_t H5O__fill_free(void *_mesg);
+static herr_t H5O__fill_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_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
- int indent, int fwidth);
+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
@@ -56,17 +56,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 */
@@ -86,13 +86,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
@@ -101,7 +101,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 */
@@ -115,14 +115,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 */
- H5O_fill_pre_copy_file, /* pre copy native value to file */
- H5O_fill_shared_copy_file, /* copy native value to file */
+ H5O__fill_pre_copy_file, /* pre 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 */
@@ -139,14 +139,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 */
- H5O_fill_pre_copy_file, /* pre copy native value to file */
- H5O_fill_new_shared_copy_file, /* copy native value to file */
+ H5O__fill_pre_copy_file, /* pre 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 */
@@ -192,7 +192,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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -307,7 +307,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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -347,7 +347,7 @@ done:
if(!ret_value && fill) {
if(fill->buf)
H5MM_xfree(fill->buf);
- fill = H5FL_FREE(H5O_fill_t, fill);
+ fill = H5FL_FREE(H5O_fill_t, fill);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -536,7 +536,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.) */
@@ -564,7 +564,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)
@@ -591,7 +591,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 */
@@ -709,7 +709,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 */
@@ -718,7 +718,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 */
@@ -732,8 +732,8 @@ H5O_fill_reset_dyn(H5O_fill_t *fill)
} /* end if */
fill->size = 0;
if(fill->type) {
- H5T_close(fill->type);
- fill->type = NULL;
+ (void)H5T_close_real(fill->type);
+ fill->type = NULL;
} /* end if */
done:
@@ -745,7 +745,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_fill_reset
+ * Function: H5O__fill_reset
*
* Purpose: Resets a message to an initial state.
*
@@ -757,11 +757,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);
@@ -774,11 +774,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
*
@@ -790,20 +790,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_pre_copy_file
+ * Function: H5O__fill_pre_copy_file
*
* Purpose: Perform any necessary actions before copying message between
* files.
@@ -816,13 +816,13 @@ H5O_fill_free(void *fill)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
+H5O__fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
hbool_t H5_ATTR_UNUSED *deleted, const H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
{
const H5O_fill_t *fill_src = (const H5O_fill_t *)mesg_src; /* Source fill value */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(cpy_info);
@@ -835,11 +835,11 @@ H5O_fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_fill_pre_copy_file() */
+} /* end H5O__fill_pre_copy_file() */
/*-------------------------------------------------------------------------
- * Function: H5O_fill_debug
+ * Function: H5O__fill_debug
*
* Purpose: Prints debugging info for the message.
*
@@ -851,13 +851,13 @@ done:
*-------------------------------------------------------------------------
*/
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);
@@ -937,7 +937,7 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void
HDfprintf(stream, "<dataset type>\n");
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5O_fill_debug() */
+} /* end H5O__fill_debug() */
/*-------------------------------------------------------------------------
@@ -956,7 +956,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 */
@@ -973,7 +973,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 */
@@ -985,8 +985,8 @@ 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)))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes")
+ 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 */
if(!H5T_path_noop(tpath)) {
@@ -1012,16 +1012,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..e8e077e 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,24 @@ 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 */
+ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(obj_id) < 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:
FUNC_LEAVE_API(ret_value)
} /* end H5Oflush() */
+
/*-------------------------------------------------------------------------
* Function: H5O_flush_common
*
@@ -111,7 +104,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 +112,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 +129,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 +193,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 +213,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,18 +235,17 @@ done:
herr_t
H5Orefresh(hid_t oid)
{
- H5O_loc_t *oloc; /* object location */
- herr_t ret_value = SUCCEED; /* return value */
+ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(oid) < 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:
@@ -231,7 +274,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 +299,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 +316,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 +334,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 +353,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 +369,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 +383,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 +401,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 +415,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 +460,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 8369ae1..bb15f62 100644
--- a/src/H5Ofsinfo.c
+++ b/src/H5Ofsinfo.c
@@ -32,14 +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,
+static void *H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
unsigned *ioflags, size_t p_size, 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] = {{
@@ -52,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 */
@@ -62,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 */
@@ -86,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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -309,9 +309,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
*
@@ -320,20 +320,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.
*
@@ -344,13 +344,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);
@@ -404,5 +404,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 e551f28..b75a9c5 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, size_t p_size, const uint8_t *p);
+static void *H5O_ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -286,9 +286,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
*
@@ -298,7 +298,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
@@ -307,11 +307,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.
*
@@ -324,12 +324,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);
@@ -348,5 +348,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 2351779..c9e82c0 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);
/*********************/
@@ -277,8 +279,8 @@ done:
*-------------------------------------------------------------------------
*/
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 */
@@ -391,7 +393,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 */
@@ -435,18 +437,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;
@@ -524,15 +526,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);
@@ -544,25 +546,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.
*
@@ -575,27 +714,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() */
/*-------------------------------------------------------------------------
@@ -663,7 +840,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.
@@ -679,12 +856,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);
@@ -744,7 +921,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 */
@@ -752,7 +929,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 */
@@ -761,7 +938,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 */
@@ -774,7 +951,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() */
/*-------------------------------------------------------------------------
@@ -794,13 +971,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);
@@ -808,24 +985,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->
@@ -843,8 +1055,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 */
@@ -852,7 +1063,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);
@@ -877,7 +1088,6 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags,
udata.oh = NULL;
udata.free_oh = FALSE;
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));
@@ -885,7 +1095,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 */
@@ -904,7 +1114,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;
@@ -924,7 +1133,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 */
@@ -933,7 +1142,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 */
@@ -983,7 +1192,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*/
@@ -991,7 +1200,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 */
@@ -1007,10 +1216,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() */
@@ -1032,7 +1241,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 */
@@ -1043,12 +1252,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 */
@@ -1056,7 +1265,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)
@@ -1090,7 +1299,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:
@@ -1115,7 +1324,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 */
@@ -1147,7 +1356,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:
@@ -1170,7 +1379,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 */
@@ -1205,7 +1414,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 */
@@ -1213,7 +1422,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 */
@@ -1242,7 +1451,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)
@@ -1265,7 +1474,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 */
@@ -1277,18 +1486,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)
@@ -1310,7 +1519,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 */
@@ -1345,7 +1554,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) */
@@ -1382,7 +1591,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 */
@@ -1390,7 +1599,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);
@@ -1402,11 +1611,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 */
@@ -1420,15 +1629,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
@@ -1445,13 +1654,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);
@@ -1462,13 +1671,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() */
/*-------------------------------------------------------------------------
@@ -1485,31 +1694,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'.
*
@@ -1522,35 +1731,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'.
*
@@ -1563,31 +1772,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'.
*
@@ -1600,12 +1809,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);
@@ -1619,14 +1828,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() */
/*-------------------------------------------------------------------------
@@ -1841,6 +2050,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
@@ -1854,7 +2099,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 */
@@ -1869,15 +2114,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)
@@ -1885,7 +2130,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
*
@@ -1898,13 +2143,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);
@@ -1962,7 +2207,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() */
/*-------------------------------------------------------------------------
@@ -1979,21 +2224,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 */
@@ -2006,7 +2250,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 */
@@ -2039,7 +2283,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 {
@@ -2048,7 +2292,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
@@ -2057,38 +2301,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
@@ -2102,7 +2512,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 */
@@ -2114,7 +2524,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 */
@@ -2136,7 +2546,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)
@@ -2157,7 +2567,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 */
@@ -2169,14 +2579,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)
@@ -2197,8 +2607,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 */
@@ -2217,7 +2626,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 */
@@ -2275,7 +2684,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 */
@@ -2286,7 +2695,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 */
@@ -2295,11 +2704,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)
@@ -2307,7 +2716,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5O_free_visit_visited
+ * Function: H5O__free_visit_visited
*
* Purpose: Free the key for an object visited during a group traversal
*
@@ -2319,18 +2728,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
*
@@ -2343,7 +2752,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 */
@@ -2353,7 +2762,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);
@@ -2371,7 +2780,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;
@@ -2384,7 +2793,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 */
@@ -2418,11 +2827,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
@@ -2454,9 +2863,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 */
@@ -2468,7 +2876,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));
@@ -2483,17 +2891,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 */
@@ -2515,8 +2923,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;
@@ -2543,7 +2949,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 */
@@ -2555,14 +2961,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
*
@@ -2575,11 +2981,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);
@@ -2594,11 +3000,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
*
@@ -2611,11 +3017,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);
@@ -2630,7 +3036,7 @@ H5O_dec_rc(H5O_t *oh)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_dec_rc() */
+} /* end H5O__dec_rc() */
/*-------------------------------------------------------------------------
@@ -2648,7 +3054,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 */
@@ -2659,17 +3065,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)
@@ -2745,7 +3151,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 2c4c4ce..5e9507b 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -33,27 +33,23 @@
/* 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, size_t p_size, const uint8_t *p);
+static void *H5O__layout_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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 herr_t H5O__layout_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__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] = {{
@@ -100,7 +96,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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -398,7 +394,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;
@@ -779,14 +775,13 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p,
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 */
+ if(H5HG_insert(f, 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 */
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:
@@ -1011,7 +1006,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 */
@@ -1031,19 +1026,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;
@@ -1111,7 +1106,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;
@@ -1135,7 +1130,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 */
@@ -1152,7 +1147,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 */
@@ -1161,7 +1156,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 */
@@ -1170,7 +1165,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;
@@ -1209,8 +1204,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 9917927..4903d9f 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, size_t p_size, const uint8_t *p);
+static void *H5O__linfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,7 +111,7 @@ 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -121,7 +119,7 @@ H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *o
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);
@@ -133,7 +131,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++;
@@ -172,7 +170,7 @@ done:
linfo = H5FL_FREE(H5O_linfo_t, linfo);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_linfo_decode() */
+} /* end H5O__linfo_decode() */
/*-------------------------------------------------------------------------
@@ -256,7 +254,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;
@@ -306,9 +304,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
*
@@ -318,20 +316,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
*
@@ -343,12 +341,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);
@@ -356,16 +354,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
*
@@ -379,16 +377,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);
@@ -416,7 +414,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 */
@@ -429,12 +427,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
@@ -449,35 +447,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 */
@@ -485,11 +482,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
*
@@ -501,15 +498,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);
@@ -531,21 +528,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.
*
@@ -558,12 +554,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);
@@ -589,5 +585,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 7e7885c..6447936 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, size_t p_size, const uint8_t *p);
+static void *H5O__link_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -126,7 +126,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);
@@ -263,7 +263,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_link_decode() */
+} /* end H5O__link_decode() */
/*-------------------------------------------------------------------------
@@ -535,7 +535,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.
@@ -548,11 +548,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) */
@@ -566,13 +566,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
*
@@ -582,20 +582,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() */
/*-------------------------------------------------------------------------
@@ -611,7 +609,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 */
@@ -634,7 +632,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 */
@@ -708,7 +706,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
*
@@ -722,14 +720,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);
@@ -747,11 +745,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
*
@@ -763,15 +761,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);
@@ -783,17 +781,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.
*
@@ -806,8 +803,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 */
@@ -874,5 +871,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 809c6e9..930be9b 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() */
/*-------------------------------------------------------------------------
@@ -1751,7 +1744,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5O_msg_encode
*
- * Purpose: Encode an object(data type and simple data space only)
+ * Purpose: Encode an object(data type and simple dataspace only)
* description into a buffer.
*
* Return: Success: Non-negative
@@ -1810,8 +1803,8 @@ done:
*-------------------------------------------------------------------------
*/
void *
-H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id,
- size_t buf_size, const unsigned char *buf)
+H5O_msg_decode(H5F_t *f, H5O_t *open_oh, unsigned type_id, size_t buf_size,
+ 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 +1819,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_size, buf)) == NULL)
+ if(NULL == (ret_value = (type->decode)(f, open_oh, 0, &ioflags, buf_size, buf)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message")
done:
@@ -1835,7 +1828,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 +1846,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 +1866,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 +1888,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 +1911,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 +1937,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 +1954,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 +1972,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 +1990,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 +2013,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 +2031,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 +2045,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 +2054,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 +2069,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 +2084,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 +2255,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 +2274,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 +2289,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 47bc0b1..db1d8d7 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, size_t p_size, const uint8_t *p);
+static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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, size_t p_size, const uint8_t *p);
+static void *H5O__mtime_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,7 +117,7 @@ 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -126,7 +125,7 @@ H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_
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);
@@ -152,11 +151,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.
@@ -175,7 +174,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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -184,7 +183,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);
@@ -217,7 +216,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() */
/*-------------------------------------------------------------------------
@@ -408,58 +407,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.
*
@@ -474,7 +447,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;
@@ -498,5 +471,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 627a0f5..a710944 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,
- unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
+static void *H5O__name_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,14 +83,14 @@ 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,
size_t H5_ATTR_UNUSED p_size, 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);
@@ -106,13 +106,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() */
/*-------------------------------------------------------------------------
@@ -238,7 +237,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.
@@ -249,16 +248,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);
@@ -267,11 +264,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.
*
@@ -286,8 +283,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;
@@ -305,4 +302,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 9392fa8..f535e50 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_size, (MSG)->raw))) \
+ if(NULL == ((MSG)->native = (msg_type->decode)((F), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, (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 *, size_t, const uint8_t *);
+ void *(*decode)(H5F_t *, H5O_t *, unsigned, unsigned *, size_t, 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 */
@@ -391,21 +390,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_DATASET[1];
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);
/* Arrays of versions for:
Object header, Attribute/Fill value/Filter pipeline messages */
@@ -657,8 +664,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);
@@ -668,7 +675,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 e59e192..1fae1b8 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,
- unsigned mesg_flags, unsigned *ioflags, size_t p_size, const uint8_t *p);
+static void *H5O__pline_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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 */
@@ -101,7 +101,7 @@ H5FL_DEFINE(H5O_pline_t);
/*-------------------------------------------------------------------------
- * Function: H5O_pline_decode
+ * Function: H5O__pline_decode
*
* Purpose: Decodes a filter pipeline message.
*
@@ -114,7 +114,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,
size_t p_size, const uint8_t *p)
{
@@ -125,7 +125,7 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
const uint8_t *p_end = p + p_size - 1; /* End of the p buffer */
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(p);
@@ -235,12 +235,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() */
/*-------------------------------------------------------------------------
@@ -425,9 +425,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)
@@ -496,7 +496,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.
@@ -509,12 +509,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
/* NOTE: This function can be called during error processing from
* other API calls so DO NOT ASSUME THAT ANY VALUES ARE SANE.
@@ -548,13 +548,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
*
@@ -564,16 +564,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() */
/*-------------------------------------------------------------------------
@@ -625,7 +625,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
@@ -639,13 +639,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);
@@ -694,7 +694,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 9f01a9a..696fd38 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -185,6 +185,7 @@ typedef struct H5O_copy_t {
void *shared_fo; /* The shared pointer for the src 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 */
@@ -392,6 +393,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
@@ -859,65 +863,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,
@@ -934,29 +931,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, size_t buf_size, 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,
+ size_t buf_size, 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 */
@@ -971,12 +967,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_version(H5F_t * f, 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_version(H5F_t *f, H5O_pline_t *pline);
diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c
index 6f052ce..66b79bb 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, size_t p_size, const uint8_t *p);
+static void *H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,14 +89,14 @@ 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,
size_t H5_ATTR_UNUSED p_size, 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);
@@ -121,7 +121,7 @@ done:
refcount = H5FL_FREE(H5O_refcount_t, refcount);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_refcount_decode() */
+} /* end H5O__refcount_decode() */
/*-------------------------------------------------------------------------
@@ -232,9 +232,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
*
@@ -244,16 +244,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() */
/*-------------------------------------------------------------------------
@@ -290,7 +290,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.
*
@@ -303,12 +303,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);
@@ -321,5 +321,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 f5d3c61..74fa72e 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, size_t p_size, const uint8_t *p);
+static void *H5O__sdspace_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -118,7 +117,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);
@@ -195,7 +194,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_sdspace_decode() */
+} /* end H5O__sdspace_decode() */
/*--------------------------------------------------------------------------
@@ -373,7 +372,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.
@@ -383,27 +382,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
*
@@ -413,16 +410,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() */
/*-------------------------------------------------------------------------
@@ -484,11 +481,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
@@ -501,12 +498,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);
@@ -543,5 +540,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 9217d3d..047f90e 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_size, mesg_ptr)))
+ if(NULL == (ret_value = (type->decode)(f, open_oh, 0, ioflags, mesg_size, 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 93cc11f..2960fef 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, size_t p_size, 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_size, p)))
+ if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, open_oh, mesg_flags, ioflags, p_size, 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 f3fe9d1..136268a 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, size_t p_size, const uint8_t *p);
+static void *H5O__shmesg_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,14 +75,14 @@ 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,
size_t H5_ATTR_UNUSED p_size, 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);
@@ -101,7 +101,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() */
/*-------------------------------------------------------------------------
@@ -210,7 +210,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.
*
@@ -222,12 +222,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);
@@ -244,5 +244,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 6f02d72..87fb771 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, size_t p_size, const uint8_t *p);
+static void *H5O__stab_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags,
+ unsigned *ioflags, size_t p_size, 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,
size_t H5_ATTR_UNUSED p_size, const uint8_t *p)
{
@@ -125,7 +125,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O_stab_decode() */
+} /* end H5O__stab_decode() */
/*-------------------------------------------------------------------------
@@ -230,38 +230,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
*
@@ -273,27 +271,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
*
@@ -307,9 +305,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;
@@ -317,7 +315,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);
@@ -328,18 +326,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;
@@ -355,11 +353,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
*
@@ -371,16 +369,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);
@@ -401,16 +399,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.
*
@@ -425,12 +423,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);
@@ -446,5 +444,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..32b31f2 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 fe9a70a..62d518e 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -26,11 +26,11 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* IDs */
-#include "H5Ppkg.h" /* Property lists */
-#include "H5Fprivate.h" /* Files */
+#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Ppkg.h" /* Property lists */
/****************/
/* Local Macros */
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 76a2658..b451ed3 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 */
@@ -2392,7 +2393,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t index)
/* Register ID */
if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
done:
/* Free space on failure */
@@ -2483,7 +2484,7 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t index)
/* Register ID */
if((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data space")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace")
done:
/* Free space on failure */
@@ -3238,7 +3239,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.) */
@@ -3250,7 +3251,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")
@@ -3290,8 +3291,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 */
@@ -3323,7 +3323,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")
@@ -3349,7 +3349,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));
@@ -3405,7 +3405,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/)
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* 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:
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index c815542..a527510 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 <koziol@lbl.gov>
+ * 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 33847e6..a18df06 100644
--- a/src/H5Pprivate.h
+++ b/src/H5Pprivate.h
@@ -142,12 +142,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 */
@@ -198,8 +200,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);
@@ -213,7 +214,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..ab73b59 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 */
@@ -113,9 +114,13 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
FUNC_LEAVE_API(ret_value)
@@ -154,32 +159,31 @@ 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;
+ 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")
+ /* 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:
FUNC_LEAVE_API(ret_value)
@@ -214,26 +218,26 @@ 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;
+ 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")
/* 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:
FUNC_LEAVE_API(ret_value)
@@ -282,8 +286,8 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer")
/* 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:
FUNC_LEAVE_API(ret_value)
@@ -346,8 +350,8 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name,
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:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index 699f8df..2f41f7d 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 */
@@ -117,7 +118,7 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer")
/* 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 */
@@ -149,25 +150,25 @@ 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;
+ 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")
/* 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:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Rint.c b/src/H5Rint.c
index d9669c5..df9037728 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 1375695..b490b36 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1074,7 +1074,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 */
@@ -1086,7 +1086,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:
@@ -1115,7 +1115,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 */
@@ -1127,7 +1127,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:
@@ -1150,7 +1150,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 */
@@ -1163,7 +1163,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 */
@@ -1393,8 +1393,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims,
/* Selection related cleanup */
/* Set offset to zeros */
- for(u = 0; u < space->extent.rank; u++)
- space->select.offset[u] = 0;
+ HDmemset(space->select.offset, 0, sizeof(hsize_t) * space->extent.rank);
space->select.offset_changed = FALSE;
/* If the selection is 'all', update the number of elements selected */
@@ -1730,7 +1729,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, extent_size, pp)) == NULL)
+ if(NULL == (extent = (H5S_extent_t *)H5O_msg_decode(f, NULL, H5O_SDSPACE_ID, extent_size, pp)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object")
pp += extent_size;
@@ -2211,68 +2210,3 @@ done:
} /* end H5S_set_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 8e28529..1bf6301 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,28 @@ 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, size_t * /*out*/ mesg_size, 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, size_t * /*out*/ mesg_size,
+ 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 +118,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 +131,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 +208,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 +225,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 +263,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 +289,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 +318,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 +349,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 +369,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 +385,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 +406,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 +423,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 +435,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 +455,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 +474,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 +492,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 +514,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 +533,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 +562,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 +583,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 +591,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 +601,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 +612,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 +631,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 +639,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 +660,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 +678,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 +707,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 +720,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 +734,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 +745,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 +756,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 +780,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 +790,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 +814,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 +832,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 +840,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 +921,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 +930,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 +948,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 +972,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 +1040,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 +1053,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 +1080,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 +1093,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 +1101,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 +1129,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 +1154,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 +1173,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 +1194,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 +1208,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 +1230,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 +1245,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 +1261,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 +1284,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 +1305,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 +1329,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 +1340,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 +1349,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 +1432,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 +1447,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 +1473,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 +1496,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 +1531,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;
@@ -1555,7 +1543,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)));
@@ -1568,7 +1556,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 */
@@ -1579,11 +1567,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_size, &mesg_buf) < 0)
+ if(H5SM__delete_from_index(f, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_size, &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;
@@ -1592,16 +1580,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, mesg_size, (const unsigned char *)mesg_buf)))
+ if(NULL == (native_mesg = H5O_msg_decode(f, open_oh, type_id, mesg_size, (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 */
@@ -1612,7 +1600,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() */
@@ -1714,7 +1702,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
@@ -1733,11 +1721,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);
@@ -1756,11 +1744,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
@@ -1777,9 +1765,9 @@ 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, size_t * /*out*/ mesg_size, 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, size_t * /*out*/ mesg_size,
+ void ** /*out*/ encoded_mesg)
{
H5SM_list_t *list = NULL;
H5SM_mesg_key_t key;
@@ -1792,7 +1780,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);
@@ -1805,7 +1793,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,
@@ -1824,12 +1812,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;
@@ -1845,7 +1832,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 */
@@ -1865,13 +1852,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 */
@@ -1895,17 +1882,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")
@@ -1917,37 +1904,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
@@ -1958,8 +1945,8 @@ done:
*mesg_size = 0;
}
- FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
-} /* end H5SM_delete_from_index() */
+ FUNC_LEAVE_NOAPI_TAG(ret_value)
+} /* end H5SM__delete_from_index() */
/*-------------------------------------------------------------------------
@@ -1975,18 +1962,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);
@@ -1994,7 +1980,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 */
@@ -2005,7 +1991,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 */
@@ -2023,11 +2009,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 */
@@ -2077,15 +2062,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() */
@@ -2167,8 +2152,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 */
@@ -2183,7 +2168,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);
@@ -2194,7 +2179,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 */
@@ -2203,7 +2188,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 */
@@ -2212,12 +2197,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;
@@ -2233,7 +2217,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 */
@@ -2252,11 +2236,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")
@@ -2268,23 +2252,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.
@@ -2302,13 +2286,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.
@@ -2342,13 +2326,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.
*
@@ -2360,12 +2344,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)))
@@ -2377,11 +2361,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.
@@ -2394,16 +2378,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);
@@ -2438,7 +2421,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
@@ -2446,15 +2429,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);
@@ -2467,7 +2450,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")
@@ -2477,8 +2460,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 */
/*-------------------------------------------------------------------------
@@ -2554,16 +2537,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);
@@ -2593,7 +2575,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, "");
@@ -2621,10 +2603,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() */
@@ -2643,8 +2625,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) */
@@ -2655,7 +2637,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);
@@ -2667,7 +2649,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 */
@@ -2686,12 +2668,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, "");
@@ -2725,14 +2707,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() */
@@ -2753,7 +2735,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 */
@@ -2762,7 +2744,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);
@@ -2774,7 +2756,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 */
@@ -2786,14 +2768,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 */
@@ -2806,15 +2788,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 */
@@ -2822,13 +2804,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/H5Sall.c b/src/H5Sall.c
index 98d7319..d933f3c 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -15,7 +15,7 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Tuesday, June 16, 1998
*
- * Purpose: "All" selection data space I/O functions.
+ * Purpose: "All" selection dataspace I/O functions.
*/
#include "H5Smodule.h" /* This source code file is part of the H5S module */
@@ -30,59 +30,59 @@
/* Static function prototypes */
/* Selection callbacks */
-static herr_t H5S_all_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection);
-static herr_t H5S_all_get_seq_list(const H5S_t *space, unsigned flags,
+static herr_t H5S__all_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection);
+static herr_t H5S__all_get_seq_list(const H5S_t *space, unsigned flags,
H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
-static herr_t H5S_all_release(H5S_t *space);
-static htri_t H5S_all_is_valid(const H5S_t *space);
-static hssize_t H5S_all_serial_size(const H5S_t *space, H5F_t *f);
-static herr_t H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
-static herr_t H5S_all_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
+static herr_t H5S__all_release(H5S_t *space);
+static htri_t H5S__all_is_valid(const H5S_t *space);
+static hssize_t H5S__all_serial_size(const H5S_t *space, H5F_t *f);
+static herr_t H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
+static herr_t H5S__all_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
const uint8_t **p);
-static herr_t H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
-static herr_t H5S_all_offset(const H5S_t *space, hsize_t *off);
+static herr_t H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
+static herr_t H5S__all_offset(const H5S_t *space, hsize_t *off);
static int H5S__all_unlim_dim(const H5S_t *space);
-static htri_t H5S_all_is_contiguous(const H5S_t *space);
-static htri_t H5S_all_is_single(const H5S_t *space);
-static htri_t H5S_all_is_regular(const H5S_t *space);
-static herr_t H5S_all_adjust_u(H5S_t *space, const hsize_t *offset);
-static herr_t H5S_all_project_scalar(const H5S_t *space, hsize_t *offset);
-static herr_t H5S_all_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
-static herr_t H5S_all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
+static htri_t H5S__all_is_contiguous(const H5S_t *space);
+static htri_t H5S__all_is_single(const H5S_t *space);
+static htri_t H5S__all_is_regular(const H5S_t *space);
+static void H5S__all_adjust_u(H5S_t *space, const hsize_t *offset);
+static herr_t H5S__all_project_scalar(const H5S_t *space, hsize_t *offset);
+static herr_t H5S__all_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
+static herr_t H5S__all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
/* Selection iteration callbacks */
-static herr_t H5S_all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
-static herr_t H5S_all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
-static hsize_t H5S_all_iter_nelmts(const H5S_sel_iter_t *iter);
-static htri_t H5S_all_iter_has_next_block(const H5S_sel_iter_t *iter);
-static herr_t H5S_all_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
-static herr_t H5S_all_iter_next_block(H5S_sel_iter_t *sel_iter);
-static herr_t H5S_all_iter_release(H5S_sel_iter_t *sel_iter);
+static herr_t H5S__all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
+static herr_t H5S__all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
+static hsize_t H5S__all_iter_nelmts(const H5S_sel_iter_t *iter);
+static htri_t H5S__all_iter_has_next_block(const H5S_sel_iter_t *iter);
+static herr_t H5S__all_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
+static herr_t H5S__all_iter_next_block(H5S_sel_iter_t *sel_iter);
+static herr_t H5S__all_iter_release(H5S_sel_iter_t *sel_iter);
/* Selection properties for "all" selections */
const H5S_select_class_t H5S_sel_all[1] = {{
H5S_SEL_ALL,
/* Methods on selection */
- H5S_all_copy,
- H5S_all_get_seq_list,
- H5S_all_release,
- H5S_all_is_valid,
- H5S_all_serial_size,
- H5S_all_serialize,
- H5S_all_deserialize,
- H5S_all_bounds,
- H5S_all_offset,
+ H5S__all_copy,
+ H5S__all_get_seq_list,
+ H5S__all_release,
+ H5S__all_is_valid,
+ H5S__all_serial_size,
+ H5S__all_serialize,
+ H5S__all_deserialize,
+ H5S__all_bounds,
+ H5S__all_offset,
H5S__all_unlim_dim,
NULL,
- H5S_all_is_contiguous,
- H5S_all_is_single,
- H5S_all_is_regular,
- H5S_all_adjust_u,
- H5S_all_project_scalar,
- H5S_all_project_simple,
- H5S_all_iter_init,
+ H5S__all_is_contiguous,
+ H5S__all_is_single,
+ H5S__all_is_regular,
+ H5S__all_adjust_u,
+ H5S__all_project_scalar,
+ H5S__all_project_simple,
+ H5S__all_iter_init,
}};
/* Iteration properties for "all" selections */
@@ -90,18 +90,18 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{
H5S_SEL_ALL,
/* Methods on selection iterator */
- H5S_all_iter_coords,
- H5S_all_iter_block,
- H5S_all_iter_nelmts,
- H5S_all_iter_has_next_block,
- H5S_all_iter_next,
- H5S_all_iter_next_block,
- H5S_all_iter_release,
+ H5S__all_iter_coords,
+ H5S__all_iter_block,
+ H5S__all_iter_nelmts,
+ H5S__all_iter_has_next_block,
+ H5S__all_iter_next,
+ H5S__all_iter_next_block,
+ H5S__all_iter_release,
}};
/*-------------------------------------------------------------------------
- * Function: H5S_all_iter_init
+ * Function: H5S__all_iter_init
*
* Purpose: Initializes iteration information for "all" selection.
*
@@ -110,35 +110,33 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{
* Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space)
+H5S__all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
- HDassert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space));
- HDassert (iter);
+ HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space));
+ HDassert(iter);
/* Initialize the number of elements to iterate over */
- iter->elmt_left=H5S_GET_SELECT_NPOINTS(space);
+ iter->elmt_left = H5S_GET_SELECT_NPOINTS(space);
/* Start at the upper left location */
- iter->u.all.elmt_offset=0;
- iter->u.all.byte_offset=0;
+ iter->u.all.elmt_offset = 0;
+ iter->u.all.byte_offset = 0;
/* Initialize type of selection iterator */
- iter->type=H5S_sel_iter_all;
+ iter->type = H5S_sel_iter_all;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_iter_init() */
+} /* H5S__all_iter_init() */
/*-------------------------------------------------------------------------
- * Function: H5S_all_iter_coords
+ * Function: H5S__all_iter_coords
*
* Purpose: Retrieve the current coordinates of iterator for current
* selection
@@ -148,32 +146,30 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space)
* Programmer: Quincey Koziol
* Tuesday, April 22, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
+H5S__all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords)
{
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
- HDassert (iter);
- HDassert (coords);
+ HDassert(iter);
+ HDassert(coords);
/* Calculate the coordinates for the current iterator offset */
- if(H5VM_array_calc(iter->u.all.elmt_offset,iter->rank,iter->dims,coords)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates");
+ if(H5VM_array_calc(iter->u.all.elmt_offset, iter->rank, iter->dims, coords) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_all_iter_coords() */
+} /* H5S__all_iter_coords() */
/*-------------------------------------------------------------------------
- * Function: H5S_all_iter_block
+ * Function: H5S__all_iter_block
*
* Purpose: Retrieve the current block of iterator for current
* selection
@@ -183,38 +179,36 @@ done:
* Programmer: Quincey Koziol
* Monday, June 2, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
+H5S__all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
- HDassert (iter);
- HDassert (start);
- HDassert (end);
+ HDassert(iter);
+ HDassert(start);
+ HDassert(end);
- for(u=0; u<iter->rank; u++) {
+ for(u = 0; u < iter->rank; u++) {
/* Set the start of the 'all' block */
/* (Always '0' coordinates for now) */
- start[u]=0;
+ start[u] = 0;
/* Compute the end of the 'all' block */
/* (Always size of the extent for now) */
- end[u]=iter->dims[u]-1;
+ end[u] = iter->dims[u] - 1;
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_iter_coords() */
+} /* H5S__all_iter_block() */
/*-------------------------------------------------------------------------
- * Function: H5S_all_iter_nelmts
+ * Function: H5S__all_iter_nelmts
*
* Purpose: Return number of elements left to process in iterator
*
@@ -223,29 +217,27 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
* Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hsize_t
-H5S_all_iter_nelmts (const H5S_sel_iter_t *iter)
+H5S__all_iter_nelmts(const H5S_sel_iter_t *iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
- HDassert (iter);
+ HDassert(iter);
FUNC_LEAVE_NOAPI(iter->elmt_left)
-} /* H5S_all_iter_nelmts() */
+} /* H5S__all_iter_nelmts() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_iter_next
+ H5S__all_iter_has_next_block
PURPOSE
Check if there is another block left in the current iterator
USAGE
- htri_t H5S_all_iter_has_next_block(iter)
+ htri_t H5S__all_iter_has_next_block(iter)
const H5S_sel_iter_t *iter; IN: Pointer to selection iterator
RETURNS
Non-negative (TRUE/FALSE) on success/Negative on failure
@@ -257,24 +249,24 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_all_iter_has_next_block (const H5S_sel_iter_t H5_ATTR_UNUSED *iter)
+H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
- HDassert (iter);
+ HDassert(iter);
FUNC_LEAVE_NOAPI(FALSE)
-} /* H5S_all_iter_has_next_block() */
+} /* H5S__all_iter_has_next_block() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_iter_next
+ H5S__all_iter_next
PURPOSE
Increment selection iterator
USAGE
- herr_t H5S_all_iter_next(iter, nelem)
+ herr_t H5S__all_iter_next(iter, nelem)
H5S_sel_iter_t *iter; IN: Pointer to selection iterator
hsize_t nelem; IN: Number of elements to advance by
RETURNS
@@ -287,29 +279,29 @@ H5S_all_iter_has_next_block (const H5S_sel_iter_t H5_ATTR_UNUSED *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
+H5S__all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
- HDassert (iter);
- HDassert (nelem>0);
+ HDassert(iter);
+ HDassert(nelem > 0);
/* Increment the iterator */
- iter->u.all.elmt_offset+=nelem;
- iter->u.all.byte_offset+=(nelem*iter->elmt_size);
+ iter->u.all.elmt_offset += nelem;
+ iter->u.all.byte_offset += (nelem * iter->elmt_size);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_iter_next() */
+} /* H5S__all_iter_next() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_iter_next_block
+ H5S__all_iter_next_block
PURPOSE
Increment selection iterator to next block
USAGE
- herr_t H5S_all_iter_next_block(iter)
+ herr_t H5S__all_iter_next_block(iter)
H5S_sel_iter_t *iter; IN: Pointer to selection iterator
RETURNS
Non-negative on success/Negative on failure
@@ -321,24 +313,24 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter)
+H5S__all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
- HDassert (iter);
+ HDassert(iter);
FUNC_LEAVE_NOAPI(FAIL)
-} /* H5S_all_iter_next_block() */
+} /* H5S__all_iter_next_block() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_iter_release
+ H5S__all_iter_release
PURPOSE
Release "all" selection iterator information for a dataspace
USAGE
- herr_t H5S_all_iter_release(iter)
+ herr_t H5S__all_iter_release(iter)
H5S_sel_iter_t *iter; IN: Pointer to selection iterator
RETURNS
Non-negative on success/Negative on failure
@@ -350,24 +342,24 @@ H5S_all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_iter_release (H5S_sel_iter_t H5_ATTR_UNUSED * iter)
+H5S__all_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED * iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
- HDassert (iter);
+ HDassert(iter);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_iter_release() */
+} /* H5S__all_iter_release() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_release
+ H5S__all_release
PURPOSE
Release all selection information for a dataspace
USAGE
- herr_t H5S_all_release(space)
+ herr_t H5S__all_release(space)
H5S_t *space; IN: Pointer to dataspace
RETURNS
Non-negative on success/Negative on failure
@@ -379,9 +371,9 @@ H5S_all_iter_release (H5S_sel_iter_t H5_ATTR_UNUSED * iter)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_release(H5S_t *space)
+H5S__all_release(H5S_t *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
@@ -390,16 +382,16 @@ H5S_all_release(H5S_t *space)
space->select.num_elem = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_release() */
+} /* H5S__all_release() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_copy
+ H5S__all_copy
PURPOSE
Copy a selection from one dataspace to another
USAGE
- herr_t H5S_all_copy(dst, src)
+ herr_t H5S__all_copy(dst, src)
H5S_t *dst; OUT: Pointer to the destination dataspace
H5S_t *src; IN: Pointer to the source dataspace
RETURNS
@@ -413,9 +405,9 @@ H5S_all_release(H5S_t *space)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection)
+H5S__all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED share_selection)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(src);
HDassert(dst);
@@ -424,17 +416,17 @@ H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED
dst->select.num_elem = (hsize_t)H5S_GET_EXTENT_NPOINTS(dst);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5S_all_copy() */
+} /* end H5S__all_copy() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_is_valid
+ H5S__all_is_valid
PURPOSE
Check whether the selection fits within the extent, with the current
offset defined.
USAGE
- htri_t H5S_all_is_valid(space);
+ htri_t H5S__all_is_valid(space);
H5S_t *space; IN: Dataspace pointer to query
RETURNS
TRUE if the selection fits within the extent, FALSE if it does not and
@@ -448,19 +440,19 @@ H5S_all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSED
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space)
+H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
-} /* end H5S_all_is_valid() */
+} /* end H5S__all_is_valid() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_serial_size
+ H5S__all_serial_size
PURPOSE
Determine the number of bytes needed to store the serialized "all"
selection information.
@@ -479,9 +471,9 @@ H5S_all_is_valid (const H5S_t H5_ATTR_UNUSED *space)
REVISION LOG
--------------------------------------------------------------------------*/
static hssize_t
-H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
+H5S__all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
@@ -490,16 +482,16 @@ H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
* <length (4 bytes)> = 16 bytes
*/
FUNC_LEAVE_NOAPI(16)
-} /* end H5S_all_serial_size() */
+} /* end H5S__all_serial_size() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_serialize
+ H5S__all_serialize
PURPOSE
Serialize the current selection into a user-provided buffer.
USAGE
- herr_t H5S_all_serialize(space, p, f)
+ herr_t H5S__all_serialize(space, p, f)
const H5S_t *space; IN: Dataspace with selection to serialize
uint8_t **p; OUT: Pointer to buffer to put serialized
selection. Will be advanced to end of
@@ -516,11 +508,11 @@ H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space, H5F_t H5_ATTR_UNUSED *f)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
+H5S__all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
{
uint8_t *pp = (*p); /* Local pointer for decoding */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
@@ -537,12 +529,12 @@ H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
*p = pp;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_serialize() */
+} /* H5S__all_serialize() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_deserialize
+ H5S__all_deserialize
PURPOSE
Deserialize the current selection from a user-provided buffer.
USAGE
@@ -565,12 +557,12 @@ H5S_all_serialize(const H5S_t *space, uint8_t **p, H5F_t H5_ATTR_UNUSED *f)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED flags,
+H5S__all_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_ATTR_UNUSED flags,
const uint8_t H5_ATTR_UNUSED **p)
{
herr_t ret_value = SUCCEED; /* return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
HDassert(space);
HDassert(p);
@@ -582,16 +574,16 @@ H5S_all_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t H5_AT
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_all_deserialize() */
+} /* H5S__all_deserialize() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_bounds
+ H5S__all_bounds
PURPOSE
Gets the bounding box containing the selection.
USAGE
- herr_t H5S_all_bounds(space, start, end)
+ herr_t H5S__all_bounds(space, start, end)
H5S_t *space; IN: Dataspace pointer of selection to query
hsize_t *start; OUT: Starting coordinate of bounding box
hsize_t *end; OUT: Opposite coordinate of bounding box
@@ -611,12 +603,12 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
+H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
unsigned rank; /* Dataspace rank */
unsigned i; /* index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
HDassert(start);
@@ -632,16 +624,16 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_bounds() */
+} /* H5S__all_bounds() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_offset
+ H5S__all_offset
PURPOSE
Gets the linear offset of the first element for the selection.
USAGE
- herr_t H5S_all_offset(space, offset)
+ herr_t H5S__all_offset(space, offset)
const H5S_t *space; IN: Dataspace pointer of selection to query
hsize_t *offset; OUT: Linear offset of first element in selection
RETURNS
@@ -656,9 +648,9 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
+H5S__all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
HDassert(offset);
@@ -667,7 +659,7 @@ H5S_all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
*offset = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_offset() */
+} /* H5S__all_offset() */
/*--------------------------------------------------------------------------
@@ -702,11 +694,11 @@ H5S__all_unlim_dim(const H5S_t H5_ATTR_UNUSED *space)
/*--------------------------------------------------------------------------
NAME
- H5S_all_is_contiguous
+ H5S__all_is_contiguous
PURPOSE
Check if a "all" selection is contiguous within the dataspace extent.
USAGE
- htri_t H5S_all_is_contiguous(space)
+ htri_t H5S__all_is_contiguous(space)
H5S_t *space; IN: Dataspace pointer to check
RETURNS
TRUE/FALSE/FAIL
@@ -719,23 +711,23 @@ H5S__all_unlim_dim(const H5S_t H5_ATTR_UNUSED *space)
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space)
+H5S__all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
-} /* H5S_all_is_contiguous() */
+} /* H5S__all_is_contiguous() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_is_single
+ H5S__all_is_single
PURPOSE
Check if a "all" selection is a single block within the dataspace extent.
USAGE
- htri_t H5S_all_is_single(space)
+ htri_t H5S__all_is_single(space)
H5S_t *space; IN: Dataspace pointer to check
RETURNS
TRUE/FALSE/FAIL
@@ -748,23 +740,23 @@ H5S_all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space)
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_all_is_single(const H5S_t H5_ATTR_UNUSED *space)
+H5S__all_is_single(const H5S_t H5_ATTR_UNUSED *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
-} /* H5S_all_is_single() */
+} /* H5S__all_is_single() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_is_regular
+ H5S__all_is_regular
PURPOSE
Check if a "all" selection is "regular"
USAGE
- htri_t H5S_all_is_regular(space)
+ htri_t H5S__all_is_regular(space)
const H5S_t *space; IN: Dataspace pointer to check
RETURNS
TRUE/FALSE/FAIL
@@ -778,28 +770,28 @@ H5S_all_is_single(const H5S_t H5_ATTR_UNUSED *space)
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_all_is_regular(const H5S_t H5_ATTR_UNUSED *space)
+H5S__all_is_regular(const H5S_t H5_ATTR_UNUSED *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
FUNC_LEAVE_NOAPI(TRUE)
-} /* H5S_all_is_regular() */
+} /* H5S__all_is_regular() */
/*--------------------------------------------------------------------------
NAME
- H5S_all_adjust_u
+ H5S__all_adjust_u
PURPOSE
Adjust an "all" selection by subtracting an offset
USAGE
- herr_t H5S_all_adjust_u(space, offset)
+ void H5S__all_adjust_u(space, offset)
H5S_t *space; IN/OUT: Pointer to dataspace to adjust
const hsize_t *offset; IN: Offset to subtract
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Moves selection by subtracting an offset from it.
GLOBAL VARIABLES
@@ -807,21 +799,21 @@ H5S_all_is_regular(const H5S_t H5_ATTR_UNUSED *space)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static herr_t
-H5S_all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset)
+static void
+H5S__all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
HDassert(offset);
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_adjust_u() */
+ FUNC_LEAVE_NOAPI_VOID
+} /* H5S__all_adjust_u() */
/*-------------------------------------------------------------------------
- * Function: H5S_all_project_scalar
+ * Function: H5S__all_project_scalar
*
* Purpose: Projects a single element 'all' selection into a scalar
* dataspace
@@ -834,9 +826,9 @@ H5S_all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offs
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
+H5S__all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space));
@@ -846,11 +838,11 @@ H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
*offset = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_all_project_scalar() */
+} /* H5S__all_project_scalar() */
/*-------------------------------------------------------------------------
- * Function: H5S_all_project_simple
+ * Function: H5S__all_project_simple
*
* Purpose: Projects an 'all' selection onto/into a simple dataspace
* of a different rank
@@ -863,11 +855,11 @@ H5S_all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset)
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offset)
+H5S__all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offset)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(base_space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(base_space));
@@ -880,7 +872,7 @@ H5S_all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offse
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_all_project_simple() */
+} /* H5S__all_project_simple() */
/*--------------------------------------------------------------------------
@@ -955,7 +947,7 @@ H5Sselect_all(hid_t spaceid)
/* Check args */
if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Call internal routine to do the work */
if(H5S_select_all(space, TRUE) < 0)
@@ -968,11 +960,11 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_all_get_seq_list
+ H5S__all_get_seq_list
PURPOSE
Create a list of offsets & lengths for a selection
USAGE
- herr_t H5S_all_get_seq_list(space,flags,iter,maxseq,maxelem,nseq,nelem,off,len)
+ herr_t H5S__all_get_seq_list(space,flags,iter,maxseq,maxelem,nseq,nelem,off,len)
H5S_t *space; IN: Dataspace containing selection to use.
unsigned flags; IN: Flags for extra information about operation
H5S_sel_iter_t *iter; IN/OUT: Selection iterator describing last
@@ -998,44 +990,44 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_all_get_seq_list(const H5S_t H5_ATTR_UNUSED *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter,
+H5S__all_get_seq_list(const H5S_t H5_ATTR_UNUSED *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter,
size_t H5_ATTR_UNUSED maxseq, size_t maxelem, size_t *nseq, size_t *nelem,
hsize_t *off, size_t *len)
{
size_t elem_used; /* The number of elements used */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
HDassert(iter);
- HDassert(maxseq>0);
- HDassert(maxelem>0);
+ HDassert(maxseq > 0);
+ HDassert(maxelem > 0);
HDassert(nseq);
HDassert(nelem);
HDassert(off);
HDassert(len);
/* Determine the actual number of elements to use */
- H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t);
- elem_used=MIN(maxelem,(size_t)iter->elmt_left);
+ H5_CHECK_OVERFLOW(iter->elmt_left, hsize_t, size_t);
+ elem_used = MIN(maxelem, (size_t)iter->elmt_left);
HDassert(elem_used > 0);
/* Compute the offset in the dataset */
- off[0]=iter->u.all.byte_offset;
- len[0]=elem_used*iter->elmt_size;
+ off[0] = iter->u.all.byte_offset;
+ len[0] = elem_used * iter->elmt_size;
/* Should only need one sequence for 'all' selections */
- *nseq=1;
+ *nseq = 1;
/* Set the number of elements used */
- *nelem=elem_used;
+ *nelem = elem_used;
/* Update the iterator */
- iter->elmt_left-=elem_used;
- iter->u.all.elmt_offset+=elem_used;
- iter->u.all.byte_offset+=len[0];
+ iter->elmt_left -= elem_used;
+ iter->u.all.elmt_offset += elem_used;
+ iter->u.all.byte_offset += len[0];
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5S_all_get_seq_list() */
+} /* end H5S__all_get_seq_list() */
diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c
index c9103f7..ebd05ce 100644
--- a/src/H5Sdbg.c
+++ b/src/H5Sdbg.c
@@ -76,7 +76,7 @@
/*-------------------------------------------------------------------------
* Function: H5S_debug
*
- * Purpose: Prints debugging information about a data space.
+ * Purpose: Prints debugging information about a dataspace.
*
* Return: Non-negative on success/Negative on failure
*
@@ -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/H5Shyper.c b/src/H5Shyper.c
index 94b600d..f2050b6 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -15,7 +15,7 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Thursday, June 18, 1998
*
- * Purpose: Hyperslab selection data space I/O functions.
+ * Purpose: Hyperslab selection dataspace I/O functions.
*/
#include "H5Smodule.h" /* This source code file is part of the H5S module */
@@ -38,14 +38,37 @@ const unsigned H5O_sds_hyper_ver_bounds[] = {
/* Local datatypes */
/* Static function prototypes */
-static herr_t H5S_hyper_free_span_info(H5S_hyper_span_info_t *span_info);
-static herr_t H5S_hyper_free_span(H5S_hyper_span_t *span);
-static H5S_hyper_span_info_t *H5S_hyper_copy_span(H5S_hyper_span_info_t *spans);
-static void H5S_hyper_span_scratch(H5S_hyper_span_info_t *spans, void *scr_value);
-static herr_t H5S_hyper_span_precompute(H5S_hyper_span_info_t *spans, size_t elmt_size);
-static herr_t H5S_generate_hyperslab(H5S_t *space, H5S_seloper_t op,
- const hsize_t start[], const hsize_t stride[], const hsize_t count[], const hsize_t block[]);
-static herr_t H5S_hyper_generate_spans(H5S_t *space);
+static H5S_hyper_span_t *H5S__hyper_new_span(hsize_t low, hsize_t high,
+ H5S_hyper_span_info_t *down, H5S_hyper_span_t *next);
+static herr_t H5S__hyper_span_precompute(H5S_hyper_span_info_t *spans, size_t elmt_size);
+static void H5S__hyper_span_scratch(H5S_hyper_span_info_t *spans);
+static H5S_hyper_span_info_t *H5S__hyper_copy_span(H5S_hyper_span_info_t *spans);
+static hbool_t H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1,
+ const H5S_hyper_span_info_t *span_info2);
+static herr_t H5S__hyper_free_span_info(H5S_hyper_span_info_t *span_info);
+static herr_t H5S__hyper_free_span(H5S_hyper_span_t *span);
+static hbool_t H5S__hyper_is_valid_helper(const H5S_hyper_span_info_t *spans,
+ const hssize_t *offset, const hsize_t *size);
+static herr_t H5S__hyper_recover_span(hbool_t *recover,
+ H5S_hyper_span_t **curr_span, H5S_hyper_span_t *next_span);
+static H5S_hyper_span_t *H5S__hyper_coord_to_span(unsigned rank,
+ const hsize_t *coords);
+static herr_t H5S__hyper_append_span(H5S_hyper_span_t **prev_span,
+ H5S_hyper_span_info_t **span_tree, hsize_t low, hsize_t high,
+ H5S_hyper_span_info_t *down, H5S_hyper_span_t *next);
+static herr_t H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans,
+ H5S_hyper_span_info_t *b_spans, H5S_hyper_span_info_t **a_not_b,
+ H5S_hyper_span_info_t **a_and_b, H5S_hyper_span_info_t **b_not_a);
+static herr_t H5S__hyper_merge_spans(H5S_t *space,
+ H5S_hyper_span_info_t *new_spans, hbool_t can_own);
+static hsize_t H5S__hyper_spans_nelem(const H5S_hyper_span_info_t *spans);
+static H5S_hyper_span_info_t *H5S__hyper_make_spans(unsigned rank,
+ const hsize_t *start, const hsize_t *stride, const hsize_t *count,
+ const hsize_t *block);
+static herr_t H5S__hyper_generate_spans(H5S_t *space);
+static herr_t H5S__generate_hyperslab(H5S_t *space, H5S_seloper_t op,
+ const hsize_t start[], const hsize_t stride[], const hsize_t count[],
+ const hsize_t block[]);
/* Needed for use in hyperslab code (H5Shyper.c) */
#ifdef NEW_HYPERSLAB_API
static herr_t H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2);
@@ -56,66 +79,65 @@ static hsize_t H5S__hyper_get_clip_extent_real(const H5S_t *clip_space,
hsize_t num_slices, hbool_t incl_trail);
/* Selection callbacks */
-static herr_t H5S_hyper_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection);
-static herr_t H5S_hyper_get_seq_list(const H5S_t *space, unsigned flags,
+static herr_t H5S__hyper_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection);
+static herr_t H5S__hyper_get_seq_list(const H5S_t *space, unsigned flags,
H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes,
size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
-static herr_t H5S_hyper_release(H5S_t *space);
-static htri_t H5S_hyper_is_valid(const H5S_t *space);
-static hssize_t H5S_hyper_serial_size(const H5S_t *space, H5F_t *f);
-static herr_t H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
-static herr_t H5S_hyper_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
+static herr_t H5S__hyper_release(H5S_t *space);
+static htri_t H5S__hyper_is_valid(const H5S_t *space);
+static hssize_t H5S__hyper_serial_size(const H5S_t *space, H5F_t *f);
+static herr_t H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
+static herr_t H5S__hyper_deserialize(H5S_t *space, uint32_t version, uint8_t flags,
const uint8_t **p);
-static herr_t H5S_hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
-static herr_t H5S_hyper_offset(const H5S_t *space, hsize_t *offset);
+static herr_t H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
+static herr_t H5S__hyper_offset(const H5S_t *space, hsize_t *offset);
static int H5S__hyper_unlim_dim(const H5S_t *space);
-static herr_t H5S_hyper_num_elem_non_unlim(const H5S_t *space,
+static herr_t H5S__hyper_num_elem_non_unlim(const H5S_t *space,
hsize_t *num_elem_non_unlim);
-static htri_t H5S_hyper_is_contiguous(const H5S_t *space);
-static htri_t H5S_hyper_is_single(const H5S_t *space);
-static htri_t H5S_hyper_is_regular(const H5S_t *space);
-static herr_t H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset);
-static herr_t H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset);
-static herr_t H5S_hyper_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
-static herr_t H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
+static htri_t H5S__hyper_is_contiguous(const H5S_t *space);
+static htri_t H5S__hyper_is_single(const H5S_t *space);
+static htri_t H5S__hyper_is_regular(const H5S_t *space);
+static void H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset);
+static herr_t H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset);
+static herr_t H5S__hyper_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
+static herr_t H5S__hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
/* Selection iteration callbacks */
-static herr_t H5S_hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
-static herr_t H5S_hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
-static hsize_t H5S_hyper_iter_nelmts(const H5S_sel_iter_t *iter);
-static htri_t H5S_hyper_iter_has_next_block(const H5S_sel_iter_t *sel_iter);
-static herr_t H5S_hyper_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
-static herr_t H5S_hyper_iter_next_block(H5S_sel_iter_t *sel_iter);
-static herr_t H5S_hyper_iter_release(H5S_sel_iter_t *sel_iter);
-
+static herr_t H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
+static herr_t H5S__hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
+static hsize_t H5S__hyper_iter_nelmts(const H5S_sel_iter_t *iter);
+static htri_t H5S__hyper_iter_has_next_block(const H5S_sel_iter_t *sel_iter);
+static herr_t H5S__hyper_iter_next(H5S_sel_iter_t *sel_iter, hsize_t nelem);
+static herr_t H5S__hyper_iter_next_block(H5S_sel_iter_t *sel_iter);
+static herr_t H5S__hyper_iter_release(H5S_sel_iter_t *sel_iter);
/* Static function for optimizing hyperslab */
-static hbool_t H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span,
+static hbool_t H5S__hyper_rebuild_helper(const H5S_hyper_span_t *span,
H5S_hyper_dim_t span_slab_info[], unsigned rank);
-static htri_t H5S_hyper_rebuild(H5S_t *space);
+static hbool_t H5S__hyper_rebuild(H5S_t *space);
/* Selection properties for hyperslab selections */
const H5S_select_class_t H5S_sel_hyper[1] = {{
H5S_SEL_HYPERSLABS,
/* Methods on selection */
- H5S_hyper_copy,
- H5S_hyper_get_seq_list,
- H5S_hyper_release,
- H5S_hyper_is_valid,
- H5S_hyper_serial_size,
- H5S_hyper_serialize,
- H5S_hyper_deserialize,
- H5S_hyper_bounds,
- H5S_hyper_offset,
+ H5S__hyper_copy,
+ H5S__hyper_get_seq_list,
+ H5S__hyper_release,
+ H5S__hyper_is_valid,
+ H5S__hyper_serial_size,
+ H5S__hyper_serialize,
+ H5S__hyper_deserialize,
+ H5S__hyper_bounds,
+ H5S__hyper_offset,
H5S__hyper_unlim_dim,
- H5S_hyper_num_elem_non_unlim,
- H5S_hyper_is_contiguous,
- H5S_hyper_is_single,
- H5S_hyper_is_regular,
- H5S_hyper_adjust_u,
- H5S_hyper_project_scalar,
- H5S_hyper_project_simple,
- H5S_hyper_iter_init,
+ H5S__hyper_num_elem_non_unlim,
+ H5S__hyper_is_contiguous,
+ H5S__hyper_is_single,
+ H5S__hyper_is_regular,
+ H5S__hyper_adjust_u,
+ H5S__hyper_project_scalar,
+ H5S__hyper_project_simple,
+ H5S__hyper_iter_init,
}};
/* Iteration properties for hyperslab selections */
@@ -123,19 +145,24 @@ static const H5S_sel_iter_class_t H5S_sel_iter_hyper[1] = {{
H5S_SEL_HYPERSLABS,
/* Methods on selection iterator */
- H5S_hyper_iter_coords,
- H5S_hyper_iter_block,
- H5S_hyper_iter_nelmts,
- H5S_hyper_iter_has_next_block,
- H5S_hyper_iter_next,
- H5S_hyper_iter_next_block,
- H5S_hyper_iter_release,
+ H5S__hyper_iter_coords,
+ H5S__hyper_iter_block,
+ H5S__hyper_iter_nelmts,
+ H5S__hyper_iter_has_next_block,
+ H5S__hyper_iter_next,
+ H5S__hyper_iter_next_block,
+ H5S__hyper_iter_release,
}};
/* Static variables */
-/* Array for default stride, block, etc. */
-static const hsize_t _ones[H5O_LAYOUT_NDIMS]={
+/* Arrays for default stride, block, etc. */
+static const hsize_t H5S_hyper_zeros_g[H5O_LAYOUT_NDIMS] = {
+ 0,0,0,0, 0,0,0,0,
+ 0,0,0,0, 0,0,0,0,
+ 0,0,0,0, 0,0,0,0,
+ 0,0,0,0, 0,0,0,0,0};
+static const hsize_t H5S_hyper_ones_g[H5O_LAYOUT_NDIMS] = {
1,1,1,1, 1,1,1,1,
1,1,1,1, 1,1,1,1,
1,1,1,1, 1,1,1,1,
@@ -156,79 +183,79 @@ H5FL_EXTERN(H5S_sel_iter_t);
/* #define H5S_HYPER_DEBUG */
#ifdef H5S_HYPER_DEBUG
static herr_t
-H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned depth)
+H5S__hyper_print_spans_helper(FILE *f, const H5S_hyper_span_t *span, unsigned depth)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
while(span) {
- HDfprintf(f,"%s: depth=%u, span=%p, (%d, %d), nelem=%u, pstride=%u\n",FUNC,depth,span,(int)span->low,(int)span->high,(unsigned)span->nelem,(unsigned)span->pstride);
+ HDfprintf(f,"%s: depth=%u, span=%p, (%Hu, %Hu), nelem=%Hu, pstride=%Hu\n", FUNC, depth, span, span->low, span->high, span->nelem, span->pstride);
if(span->down && span->down->head) {
- HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span->down,span->down->count,span->down->scratch,span->down->head);
- H5S_hyper_print_spans_helper(f,span->down->head,depth+1);
+ HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n", FUNC, span->down, span->down->count, span->down->scratch, span->down->head);
+ H5S__hyper_print_spans_helper(f, span->down->head, depth + 1);
} /* end if */
- span=span->next;
+ span = span->next;
} /* end while */
FUNC_LEAVE_NOAPI(SUCCEED)
}
-herr_t
-H5S_hyper_print_spans(FILE *f, const struct H5S_hyper_span_info_t *span_lst)
+static herr_t
+H5S__hyper_print_spans(FILE *f, const H5S_hyper_span_info_t *span_lst)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- if(span_lst!=NULL) {
- HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span_lst,span_lst->count,span_lst->scratch,span_lst->head);
- H5S_hyper_print_spans_helper(f,span_lst->head,0);
+ if(span_lst != NULL) {
+ HDfprintf(f, "%s: spans=%p, count=%u, scratch=%p, head=%p\n", FUNC, span_lst, span_lst->count, span_lst->scratch, span_lst->head);
+ H5S__hyper_print_spans_helper(f, span_lst->head, 0);
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
}
-herr_t
-H5S_space_print_spans(FILE *f, const H5S_t *space)
+static herr_t
+H5S__space_print_spans(FILE *f, const H5S_t *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5S_hyper_print_spans(f,space->select.sel_info.hslab->span_lst);
+ H5S__hyper_print_spans(f, space->select.sel_info.hslab->span_lst);
FUNC_LEAVE_NOAPI(SUCCEED)
}
static herr_t
-H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const H5S_hyper_dim_t *dinfo)
+H5S__hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const H5S_hyper_dim_t *dinfo)
{
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- if(dinfo!=NULL) {
- HDfprintf(f,"%s: %s: start=[",FUNC,field);
- for(u=0; u<ndims; u++)
- HDfprintf(f,"%Hd%s",dinfo[u].start, (u<(ndims-1) ? ", " : "]\n"));
- HDfprintf(f,"%s: %s: stride=[",FUNC,field);
- for(u=0; u<ndims; u++)
- HDfprintf(f,"%Hu%s",dinfo[u].stride, (u<(ndims-1) ? ", " : "]\n"));
- HDfprintf(f,"%s: %s: count=[",FUNC,field);
- for(u=0; u<ndims; u++)
- HDfprintf(f,"%Hu%s",dinfo[u].count, (u<(ndims-1) ? ", " : "]\n"));
- HDfprintf(f,"%s: %s: block=[",FUNC,field);
- for(u=0; u<ndims; u++)
- HDfprintf(f,"%Hu%s",dinfo[u].block, (u<(ndims-1) ? ", " : "]\n"));
+ if(dinfo != NULL) {
+ HDfprintf(f, "%s: %s: start=[", FUNC, field);
+ for(u = 0; u < ndims; u++)
+ HDfprintf(f, "%Hd%s", dinfo[u].start, (u < (ndims - 1) ? ", " : "]\n"));
+ HDfprintf(f, "%s: %s: stride=[", FUNC, field);
+ for(u = 0; u < ndims; u++)
+ HDfprintf(f, "%Hu%s", dinfo[u].stride, (u < (ndims - 1) ? ", " : "]\n"));
+ HDfprintf(f, "%s: %s: count=[", FUNC, field);
+ for(u = 0; u < ndims; u++)
+ HDfprintf(f, "%Hu%s", dinfo[u].count, (u < (ndims - 1) ? ", " : "]\n"));
+ HDfprintf(f, "%s: %s: block=[", FUNC, field);
+ for(u = 0; u < ndims; u++)
+ HDfprintf(f, "%Hu%s", dinfo[u].block, (u < (ndims - 1) ? ", " : "]\n"));
} /* end if */
else
- HDfprintf(f,"%s: %s==NULL\n",FUNC,field);
+ HDfprintf(f, "%s: %s==NULL\n", FUNC, field);
FUNC_LEAVE_NOAPI(SUCCEED)
}
-herr_t
-H5S_hyper_print_diminfo(FILE *f, const H5S_t *space)
+static herr_t
+H5S__hyper_print_diminfo(FILE *f, const H5S_t *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5S_hyper_print_diminfo_helper(f,"opt_diminfo",space->extent.rank,space->select.sel_info.hslab->opt_diminfo);
- H5S_hyper_print_diminfo_helper(f,"app_diminfo",space->extent.rank,space->select.sel_info.hslab->app_diminfo);
+ H5S__hyper_print_diminfo_helper(f, "opt_diminfo", space->extent.rank, space->select.sel_info.hslab->opt_diminfo);
+ H5S__hyper_print_diminfo_helper(f, "app_diminfo", space->extent.rank, space->select.sel_info.hslab->app_diminfo);
FUNC_LEAVE_NOAPI(SUCCEED)
}
@@ -236,7 +263,7 @@ H5S_hyper_print_diminfo(FILE *f, const H5S_t *space)
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_iter_init
+ * Function: H5S__hyper_iter_init
*
* Purpose: Initializes iteration information for hyperslab span tree selection.
*
@@ -253,7 +280,7 @@ H5S_hyper_print_diminfo(FILE *f, const H5S_t *space)
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
+H5S__hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
{
const H5S_hyper_dim_t *tdiminfo; /* Temporary pointer to diminfo information */
H5S_hyper_span_info_t *spans; /* Pointer to hyperslab span info node */
@@ -261,7 +288,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
unsigned u; /* Index variable */
int i; /* Index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space));
@@ -396,10 +423,10 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
/* Initialize the information needed for non-regular hyperslab I/O */
HDassert(space->select.sel_info.hslab->span_lst);
/* Make a copy of the span tree to iterate over */
- iter->u.hyp.spans = H5S_hyper_copy_span(space->select.sel_info.hslab->span_lst);
+ iter->u.hyp.spans = H5S__hyper_copy_span(space->select.sel_info.hslab->span_lst);
/* Set the nelem & pstride values according to the element size */
- H5S_hyper_span_precompute(iter->u.hyp.spans,iter->elmt_size);
+ H5S__hyper_span_precompute(iter->u.hyp.spans, iter->elmt_size);
/* Initialize the starting span_info's and spans */
spans = iter->u.hyp.spans;
@@ -426,11 +453,11 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
iter->type = H5S_sel_iter_hyper;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_iter_init() */
+} /* end H5S__hyper_iter_init() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_iter_coords
+ * Function: H5S__hyper_iter_coords
*
* Purpose: Retrieve the current coordinates of iterator for current
* selection
@@ -440,14 +467,12 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
* Programmer: Quincey Koziol
* Tuesday, April 22, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
+H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
@@ -513,11 +538,11 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
HDmemcpy(coords, iter->u.hyp.off, sizeof(hsize_t) * iter->rank);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_iter_coords() */
+} /* end H5S__hyper_iter_coords() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_iter_block
+ * Function: H5S__hyper_iter_block
*
* Purpose: Retrieve the current block of iterator for current
* selection
@@ -530,16 +555,14 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
* Notes: This routine assumes that the iterator is always located at
* the beginning of a block.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
+H5S__hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
@@ -551,27 +574,27 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
/* Check for a single "regular" hyperslab */
if(iter->u.hyp.diminfo_valid) {
/* Compute the end of the block */
- for(u=0; u<iter->rank; u++) {
- start[u]=iter->u.hyp.off[u];
- end[u]=(start[u]+iter->u.hyp.diminfo[u].block)-1;
+ for(u = 0; u < iter->rank; u++) {
+ start[u] = iter->u.hyp.off[u];
+ end[u] = (start[u] + iter->u.hyp.diminfo[u].block) - 1;
} /* end for */
} /* end if */
else {
/* Copy the start of the block */
- for(u=0; u<iter->rank; u++)
- start[u]=iter->u.hyp.span[u]->low;
+ for(u = 0; u < iter->rank; u++)
+ start[u] = iter->u.hyp.span[u]->low;
/* Copy the end of the block */
- for(u=0; u<iter->rank; u++)
- end[u]=iter->u.hyp.span[u]->high;
+ for(u = 0; u < iter->rank; u++)
+ end[u] = iter->u.hyp.span[u]->high;
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_iter_block() */
+} /* end H5S__hyper_iter_block() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_iter_nelmts
+ * Function: H5S__hyper_iter_nelmts
*
* Purpose: Return number of elements left to process in iterator
*
@@ -580,29 +603,27 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
* Programmer: Quincey Koziol
* Tuesday, June 16, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hsize_t
-H5S_hyper_iter_nelmts (const H5S_sel_iter_t *iter)
+H5S__hyper_iter_nelmts(const H5S_sel_iter_t *iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
FUNC_LEAVE_NOAPI(iter->elmt_left)
-} /* H5S_hyper_iter_nelmts() */
+} /* end H5S__hyper_iter_nelmts() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_iter_has_next_block
+ H5S__hyper_iter_has_next_block
PURPOSE
Check if there is another block left in the current iterator
USAGE
- htri_t H5S_hyper_iter_has_next_block(iter)
+ htri_t H5S__hyper_iter_has_next_block(iter)
const H5S_sel_iter_t *iter; IN: Pointer to selection iterator
RETURNS
Non-negative (TRUE/FALSE) on success/Negative on failure
@@ -614,12 +635,12 @@ H5S_hyper_iter_nelmts (const H5S_sel_iter_t *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_hyper_iter_has_next_block(const H5S_sel_iter_t *iter)
+H5S__hyper_iter_has_next_block(const H5S_sel_iter_t *iter)
{
unsigned u; /* Local index variable */
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
@@ -649,11 +670,11 @@ H5S_hyper_iter_has_next_block(const H5S_sel_iter_t *iter)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_iter_has_next_block() */
+} /* end H5S__hyper_iter_has_next_block() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_iter_next
+ * Function: H5S__hyper_iter_next
*
* Purpose: Moves a hyperslab iterator to the beginning of the next sequence
* of elements to read. Handles walking off the end in all dimensions.
@@ -664,20 +685,16 @@ done:
* Programmer: Quincey Koziol
* Friday, September 8, 2000
*
- * Modifications:
- * Modified for both general and optimized hyperslab I/O
- * Quincey Koziol, April 17, 2003
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
+H5S__hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
{
unsigned ndims; /* Number of dimensions of dataset */
int fast_dim; /* Rank of the fastest changing dimension for the dataspace */
unsigned i; /* Counters */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check for the special case of just one H5Sselect_hyperslab call made */
/* (i.e. a regular hyperslab selection */
@@ -688,35 +705,35 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
int temp_dim; /* Temporary rank holder */
/* Check if this is a "flattened" regular hyperslab selection */
- if(iter->u.hyp.iter_rank!=0 && iter->u.hyp.iter_rank<iter->rank) {
+ if(iter->u.hyp.iter_rank != 0 && iter->u.hyp.iter_rank < iter->rank) {
/* Set the aliases for the dimension rank */
- ndims=iter->u.hyp.iter_rank;
+ ndims = iter->u.hyp.iter_rank;
} /* end if */
else {
/* Set the aliases for the dimension rank */
- ndims=iter->rank;
+ ndims = iter->rank;
} /* end else */
/* Set the fastest dimension rank */
fast_dim = (int)ndims - 1;
/* Set the local copy of the diminfo pointer */
- tdiminfo=iter->u.hyp.diminfo;
+ tdiminfo = iter->u.hyp.diminfo;
/* Calculate the offset and block count for each dimension */
- for(i=0; i<ndims; i++) {
- if(tdiminfo[i].count==1) {
- iter_offset[i]=iter->u.hyp.off[i]-tdiminfo[i].start;
- iter_count[i]=0;
+ for(i = 0; i < ndims; i++) {
+ if(tdiminfo[i].count == 1) {
+ iter_offset[i] = iter->u.hyp.off[i] - tdiminfo[i].start;
+ iter_count[i] = 0;
} /* end if */
else {
- iter_offset[i]=(iter->u.hyp.off[i]-tdiminfo[i].start)%tdiminfo[i].stride;
- iter_count[i]=(iter->u.hyp.off[i]-tdiminfo[i].start)/tdiminfo[i].stride;
+ iter_offset[i] = (iter->u.hyp.off[i] - tdiminfo[i].start) % tdiminfo[i].stride;
+ iter_count[i] = (iter->u.hyp.off[i] - tdiminfo[i].start) / tdiminfo[i].stride;
} /* end else */
} /* end for */
/* Loop through, advancing the offset & counts, until all the nelements are accounted for */
- while(nelem>0) {
+ while(nelem > 0) {
/* Start with the fastest changing dimension */
temp_dim=fast_dim;
while(temp_dim>=0) {
@@ -725,16 +742,16 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
hsize_t block_elem; /* Number of elements left in a block */
/* Compute the number of elements left in block */
- block_elem=tdiminfo[temp_dim].block-iter_offset[temp_dim];
+ block_elem = tdiminfo[temp_dim].block - iter_offset[temp_dim];
/* Compute the number of actual elements to advance */
actual_elem=MIN(nelem,block_elem);
/* Move the iterator over as many elements as possible */
- iter_offset[temp_dim]+=actual_elem;
+ iter_offset[temp_dim] += actual_elem;
/* Decrement the number of elements advanced */
- nelem-=actual_elem;
+ nelem -= actual_elem;
} /* end if */
else {
/* Move to the next row in the current dimension */
@@ -742,18 +759,18 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
} /* end else */
/* If this block is still in the range of blocks to output for the dimension, break out of loop */
- if(iter_offset[temp_dim]<tdiminfo[temp_dim].block)
+ if(iter_offset[temp_dim] < tdiminfo[temp_dim].block)
break;
else {
/* Move to the next block in the current dimension */
- iter_offset[temp_dim]=0;
+ iter_offset[temp_dim] = 0;
iter_count[temp_dim]++;
/* If this block is still in the range of blocks to output for the dimension, break out of loop */
- if(iter_count[temp_dim]<tdiminfo[temp_dim].count)
+ if(iter_count[temp_dim] < tdiminfo[temp_dim].count)
break;
else
- iter_count[temp_dim]=0; /* reset back to the beginning of the line */
+ iter_count[temp_dim] = 0; /* reset back to the beginning of the line */
} /* end else */
/* Decrement dimension count */
@@ -762,8 +779,8 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
} /* end while */
/* Translate current iter_offset and iter_count into iterator position */
- for(i=0; i<ndims; i++)
- iter->u.hyp.off[i]=tdiminfo[i].start+(tdiminfo[i].stride*iter_count[i])+iter_offset[i];
+ for(i = 0; i < ndims; i++)
+ iter->u.hyp.off[i] = tdiminfo[i].start + (tdiminfo[i].stride * iter_count[i]) + iter_offset[i];
} /* end if */
/* Must be an irregular hyperslab selection */
else {
@@ -773,22 +790,22 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
int curr_dim; /* Temporary rank holder */
/* Set the rank of the fastest changing dimension */
- ndims=iter->rank;
+ ndims = iter->rank;
fast_dim = (int)ndims - 1;
/* Get the pointers to the current span info and span nodes */
- abs_arr=iter->u.hyp.off;
- ispan=iter->u.hyp.span;
+ abs_arr = iter->u.hyp.off;
+ ispan = iter->u.hyp.span;
/* Loop through, advancing the span information, until all the nelements are accounted for */
- while(nelem>0) {
+ while(nelem > 0) {
/* Start at the fastest dim */
- curr_dim=fast_dim;
+ curr_dim = fast_dim;
/* Work back up through the dimensions */
- while(curr_dim>=0) {
+ while(curr_dim >= 0) {
/* Reset the current span */
- curr_span=ispan[curr_dim];
+ curr_span = ispan[curr_dim];
/* Increment absolute position */
if(curr_dim==fast_dim) {
@@ -796,16 +813,16 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
hsize_t span_elem; /* Number of elements left in a span */
/* Compute the number of elements left in block */
- span_elem=(curr_span->high-abs_arr[curr_dim])+1;
+ span_elem = (curr_span->high - abs_arr[curr_dim]) + 1;
/* Compute the number of actual elements to advance */
- actual_elem=MIN(nelem,span_elem);
+ actual_elem = (size_t)MIN(nelem, span_elem);
/* Move the iterator over as many elements as possible */
- abs_arr[curr_dim]+=actual_elem;
+ abs_arr[curr_dim] += actual_elem;
/* Decrement the number of elements advanced */
- nelem-=actual_elem;
+ nelem -= actual_elem;
} /* end if */
else {
/* Move to the next row in the current dimension */
@@ -813,21 +830,21 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
} /* end else */
/* Check if we are still within the span */
- if(abs_arr[curr_dim]<=curr_span->high) {
+ if(abs_arr[curr_dim] <= curr_span->high) {
break;
} /* end if */
/* If we walked off that span, advance to the next span */
else {
/* Advance span in this dimension */
- curr_span=curr_span->next;
+ curr_span = curr_span->next;
/* Check if we have a valid span in this dimension still */
- if(curr_span!=NULL) {
+ if(curr_span != NULL) {
/* Reset the span in the current dimension */
- ispan[curr_dim]=curr_span;
+ ispan[curr_dim] = curr_span;
/* Reset absolute position */
- abs_arr[curr_dim]=curr_span->low;
+ abs_arr[curr_dim] = curr_span->low;
break;
} /* end if */
@@ -839,9 +856,9 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
} /* end while */
/* Check if we are finished with the spans in the tree */
- if(curr_dim>=0) {
+ if(curr_dim >= 0) {
/* Walk back down the iterator positions, reseting them */
- while(curr_dim<fast_dim) {
+ while(curr_dim < fast_dim) {
HDassert(curr_span);
HDassert(curr_span->down);
HDassert(curr_span->down->head);
@@ -850,27 +867,27 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
curr_dim++;
/* Set the new span_info & span for this dimension */
- ispan[curr_dim]=curr_span->down->head;
+ ispan[curr_dim] = curr_span->down->head;
/* Advance span down the tree */
- curr_span=curr_span->down->head;
+ curr_span = curr_span->down->head;
/* Reset the absolute offset for the dim */
- abs_arr[curr_dim]=curr_span->low;
+ abs_arr[curr_dim] = curr_span->low;
} /* end while */
/* Verify that the curr_span points to the fastest dim */
- HDassert(curr_span==ispan[fast_dim]);
+ HDassert(curr_span == ispan[fast_dim]);
} /* end if */
} /* end while */
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_iter_next() */
+} /* end H5S__hyper_iter_next() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_iter_next_block
+ * Function: H5S__hyper_iter_next_block
*
* Purpose: Moves a hyperslab iterator to the beginning of the next sequence
* of elements to read. Handles walking off the end in all dimensions.
@@ -881,18 +898,16 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, hsize_t nelem)
* Programmer: Quincey Koziol
* Tuesday, June 3, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
+H5S__hyper_iter_next_block(H5S_sel_iter_t *iter)
{
unsigned ndims; /* Number of dimensions of dataset */
int fast_dim; /* Rank of the fastest changing dimension for the dataspace */
unsigned u; /* Counters */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check for the special case of just one H5Sselect_hyperslab call made */
/* (i.e. a regular hyperslab selection */
@@ -903,39 +918,39 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
int temp_dim; /* Temporary rank holder */
/* Check if this is a "flattened" regular hyperslab selection */
- if(iter->u.hyp.iter_rank!=0 && iter->u.hyp.iter_rank<iter->rank) {
+ if(iter->u.hyp.iter_rank != 0 && iter->u.hyp.iter_rank < iter->rank) {
/* Set the aliases for the dimension rank */
- ndims=iter->u.hyp.iter_rank;
+ ndims = iter->u.hyp.iter_rank;
} /* end if */
else {
/* Set the aliases for the dimension rank */
- ndims=iter->rank;
+ ndims = iter->rank;
} /* end else */
/* Set the fastest dimension rank */
fast_dim = (int)ndims - 1;
/* Set the local copy of the diminfo pointer */
- tdiminfo=iter->u.hyp.diminfo;
+ tdiminfo = iter->u.hyp.diminfo;
/* Calculate the offset and block count for each dimension */
- for(u=0; u<ndims; u++) {
- if(tdiminfo[u].count==1) {
- iter_offset[u]=iter->u.hyp.off[u]-tdiminfo[u].start;
- iter_count[u]=0;
+ for(u = 0; u < ndims; u++) {
+ if(tdiminfo[u].count == 1) {
+ iter_offset[u] = iter->u.hyp.off[u] - tdiminfo[u].start;
+ iter_count[u] = 0;
} /* end if */
else {
- iter_offset[u]=(iter->u.hyp.off[u]-tdiminfo[u].start)%tdiminfo[u].stride;
- iter_count[u]=(iter->u.hyp.off[u]-tdiminfo[u].start)/tdiminfo[u].stride;
+ iter_offset[u] = (iter->u.hyp.off[u] - tdiminfo[u].start) % tdiminfo[u].stride;
+ iter_count[u] = (iter->u.hyp.off[u] - tdiminfo[u].start) / tdiminfo[u].stride;
} /* end else */
} /* end for */
/* Advance one block */
- temp_dim=fast_dim; /* Start with the fastest changing dimension */
- while(temp_dim>=0) {
- if(temp_dim==fast_dim) {
+ temp_dim = fast_dim; /* Start with the fastest changing dimension */
+ while(temp_dim >= 0) {
+ if(temp_dim == fast_dim) {
/* Move iterator over current block */
- iter_offset[temp_dim]+=tdiminfo[temp_dim].block;
+ iter_offset[temp_dim] += tdiminfo[temp_dim].block;
} /* end if */
else {
/* Move to the next row in the current dimension */
@@ -943,18 +958,18 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
} /* end else */
/* If this block is still in the range of blocks to output for the dimension, break out of loop */
- if(iter_offset[temp_dim]<tdiminfo[temp_dim].block)
+ if(iter_offset[temp_dim] < tdiminfo[temp_dim].block)
break;
else {
/* Move to the next block in the current dimension */
- iter_offset[temp_dim]=0;
+ iter_offset[temp_dim] = 0;
iter_count[temp_dim]++;
/* If this block is still in the range of blocks to output for the dimension, break out of loop */
- if(iter_count[temp_dim]<tdiminfo[temp_dim].count)
+ if(iter_count[temp_dim] < tdiminfo[temp_dim].count)
break;
else
- iter_count[temp_dim]=0; /* reset back to the beginning of the line */
+ iter_count[temp_dim] = 0; /* reset back to the beginning of the line */
} /* end else */
/* Decrement dimension count */
@@ -962,8 +977,8 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
} /* end while */
/* Translate current iter_offset and iter_count into iterator position */
- for(u=0; u<ndims; u++)
- iter->u.hyp.off[u]=tdiminfo[u].start+(tdiminfo[u].stride*iter_count[u])+iter_offset[u];
+ for(u = 0; u < ndims; u++)
+ iter->u.hyp.off[u] = tdiminfo[u].start + (tdiminfo[u].stride * iter_count[u]) + iter_offset[u];
} /* end if */
/* Must be an irregular hyperslab selection */
else {
@@ -977,21 +992,21 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
fast_dim = (int)ndims - 1;
/* Get the pointers to the current span info and span nodes */
- abs_arr=iter->u.hyp.off;
- ispan=iter->u.hyp.span;
+ abs_arr = iter->u.hyp.off;
+ ispan = iter->u.hyp.span;
/* Loop through, advancing the span information, until all the nelements are accounted for */
- curr_dim=fast_dim; /* Start at the fastest dim */
+ curr_dim = fast_dim; /* Start at the fastest dim */
/* Work back up through the dimensions */
- while(curr_dim>=0) {
+ while(curr_dim >= 0) {
/* Reset the current span */
- curr_span=ispan[curr_dim];
+ curr_span = ispan[curr_dim];
/* Increment absolute position */
- if(curr_dim==fast_dim) {
+ if(curr_dim == fast_dim) {
/* Move the iterator over rest of element in span */
- abs_arr[curr_dim]=curr_span->high+1;
+ abs_arr[curr_dim] = curr_span->high + 1;
} /* end if */
else {
/* Move to the next row in the current dimension */
@@ -999,21 +1014,21 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
} /* end else */
/* Check if we are still within the span */
- if(abs_arr[curr_dim]<=curr_span->high) {
+ if(abs_arr[curr_dim] <= curr_span->high) {
break;
} /* end if */
/* If we walked off that span, advance to the next span */
else {
/* Advance span in this dimension */
- curr_span=curr_span->next;
+ curr_span = curr_span->next;
/* Check if we have a valid span in this dimension still */
- if(curr_span!=NULL) {
+ if(curr_span != NULL) {
/* Reset the span in the current dimension */
- ispan[curr_dim]=curr_span;
+ ispan[curr_dim] = curr_span;
/* Reset absolute position */
- abs_arr[curr_dim]=curr_span->low;
+ abs_arr[curr_dim] = curr_span->low;
break;
} /* end if */
@@ -1025,9 +1040,9 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
} /* end while */
/* Check if we are finished with the spans in the tree */
- if(curr_dim>=0) {
+ if(curr_dim >= 0) {
/* Walk back down the iterator positions, reseting them */
- while(curr_dim<fast_dim) {
+ while(curr_dim < fast_dim) {
HDassert(curr_span);
HDassert(curr_span->down);
HDassert(curr_span->down->head);
@@ -1036,13 +1051,13 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
curr_dim++;
/* Set the new span_info & span for this dimension */
- ispan[curr_dim]=curr_span->down->head;
+ ispan[curr_dim] = curr_span->down->head;
/* Advance span down the tree */
- curr_span=curr_span->down->head;
+ curr_span = curr_span->down->head;
/* Reset the absolute offset for the dim */
- abs_arr[curr_dim]=curr_span->low;
+ abs_arr[curr_dim] = curr_span->low;
} /* end while */
/* Verify that the curr_span points to the fastest dim */
@@ -1051,16 +1066,16 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_iter_next() */
+} /* end H5S__hyper_iter_next() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_iter_release
+ H5S__hyper_iter_release
PURPOSE
Release hyperslab selection iterator information for a dataspace
USAGE
- herr_t H5S_hyper_iter_release(iter)
+ herr_t H5S__hyper_iter_release(iter)
H5S_sel_iter_t *iter; IN: Pointer to selection iterator
RETURNS
Non-negative on success/Negative on failure
@@ -1072,9 +1087,9 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_iter_release (H5S_sel_iter_t *iter)
+H5S__hyper_iter_release(H5S_sel_iter_t *iter)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(iter);
@@ -1082,19 +1097,19 @@ H5S_hyper_iter_release (H5S_sel_iter_t *iter)
/* Release the information needed for non-regular hyperslab I/O */
/* Free the copy of the selections span tree */
if(iter->u.hyp.spans != NULL)
- H5S_hyper_free_span_info(iter->u.hyp.spans);
+ H5S__hyper_free_span_info(iter->u.hyp.spans);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_iter_release() */
+} /* end H5S__hyper_iter_release() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_new_span
+ H5S__hyper_new_span
PURPOSE
Make a new hyperslab span node
USAGE
- H5S_hyper_span_t *H5S_hyper_new_span(low, high, down, next)
+ H5S_hyper_span_t *H5S__hyper_new_span(low, high, down, next)
hsize_t low, high; IN: Low and high bounds for new span node
H5S_hyper_span_info_t *down; IN: Down span tree for new node
H5S_hyper_span_t *next; IN: Next span for new node
@@ -1110,11 +1125,11 @@ H5S_hyper_iter_release (H5S_sel_iter_t *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_t *
-H5S_hyper_new_span(hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
+H5S__hyper_new_span(hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
{
H5S_hyper_span_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Allocate a new span node */
if(NULL == (ret_value = H5FL_MALLOC(H5S_hyper_span_t)))
@@ -1134,20 +1149,20 @@ H5S_hyper_new_span(hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_h
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_new_span() */
+} /* end H5S__hyper_new_span() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_span_precompute_helper
+ H5S__hyper_span_precompute_helper
PURPOSE
Helper routine to precompute the nelem and pstrides in bytes.
USAGE
- herr_t H5S_hyper_span_precompute_helper(span_info, elmt_size)
+ void H5S__hyper_span_precompute_helper(span_info, elmt_size)
H5S_hyper_span_info_t *span_info; IN/OUT: Span tree to work on
size_t elmt_size; IN: element size to work with
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Change the nelem and pstride values in the span tree from elements to
bytes using the elmt_size parameter.
@@ -1156,53 +1171,52 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static herr_t
-H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size)
+static void
+H5S__hyper_span_precompute_helper(H5S_hyper_span_info_t *spans, size_t elmt_size)
{
- H5S_hyper_span_t *span; /* Hyperslab span */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
+ /* Sanity checks */
HDassert(spans);
+ HDassert(spans->scratch == (H5S_hyper_span_info_t *)~((size_t)NULL) ||
+ spans->scratch == NULL);
/* Check if we've already set this down span tree */
- if(spans->scratch!=(H5S_hyper_span_info_t *)~((size_t)NULL)) {
+ if(spans->scratch != (H5S_hyper_span_info_t *)~((size_t)NULL)) {
+ H5S_hyper_span_t *span; /* Hyperslab span */
+
/* Set the tree's scratch pointer */
- spans->scratch=(H5S_hyper_span_info_t *)~((size_t)NULL);
+ spans->scratch = (H5S_hyper_span_info_t *)~((size_t)NULL);
/* Set the scratch pointers in all the nodes */
- span=spans->head;
+ span = spans->head;
/* Loop over all the spans for this down span tree */
- while(span!=NULL) {
- /* If there are down spans, set their scratch value also */
- if(span->down!=NULL) {
- if(H5S_hyper_span_precompute_helper(span->down,elmt_size)==FAIL)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't reset hyperslab scratch pointer")
- } /* end if */
+ while(span != NULL) {
+ /* If there are down spans, precompute their values also */
+ if(span->down != NULL)
+ H5S__hyper_span_precompute_helper(span->down, elmt_size);
/* Change the nelem & pstride values into bytes */
span->nelem *= elmt_size;
span->pstride *= elmt_size;
/* Advance to next span */
- span=span->next;
+ span = span->next;
} /* end while */
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_span_precompute_helper() */
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5S__hyper_span_precompute_helper() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_span_precompute
+ H5S__hyper_span_precompute
PURPOSE
Precompute the nelem and pstrides in bytes.
USAGE
- herr_t H5S_hyper_span_precompute(span_info, elmt_size)
+ herr_t H5S__hyper_span_precompute(span_info, elmt_size)
H5S_hyper_span_info_t *span_info; IN/OUT: Span tree to work on
size_t elmt_size; IN: element size to work with
RETURNS
@@ -1216,63 +1230,59 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_span_precompute(H5S_hyper_span_info_t *spans, size_t elmt_size)
+H5S__hyper_span_precompute(H5S_hyper_span_info_t *spans, size_t elmt_size)
{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
HDassert(spans);
/* Call the helper routine to actually do the work */
- if(H5S_hyper_span_precompute_helper(spans, elmt_size) < 0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't precompute span info")
+ H5S__hyper_span_precompute_helper(spans, elmt_size);
/* Reset the scratch pointers for the next routine which needs them */
- H5S_hyper_span_scratch(spans, NULL);
+ H5S__hyper_span_scratch(spans);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_span_precompute() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5S__hyper_span_precompute() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_span_scratch
+ H5S__hyper_span_scratch
PURPOSE
- Set the scratch pointers on hyperslab span trees
+ Reset the scratch pointers on hyperslab span trees
USAGE
- void H5S_hyper_span_scratch(span_info)
+ void H5S__hyper_span_scratch(span_info)
H5S_hyper_span_info_t *span_info; IN: Span tree to reset
RETURNS
<none>
DESCRIPTION
- Set the scratch pointers on a hyperslab span tree.
+ Reset the scratch pointers on a hyperslab span tree to NULL.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
static void
-H5S_hyper_span_scratch(H5S_hyper_span_info_t *spans, void *scr_value)
+H5S__hyper_span_scratch(H5S_hyper_span_info_t *spans)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(spans);
/* Check if we've already set this down span tree */
- if(spans->scratch != scr_value) {
+ if(spans->scratch != NULL) {
H5S_hyper_span_t *span; /* Hyperslab span */
- /* Set the tree's scratch pointer */
- spans->scratch = (H5S_hyper_span_info_t *)scr_value;
+ /* Reset the tree's scratch pointer */
+ spans->scratch = NULL;
/* Set the scratch pointers in all the nodes */
span = spans->head;
while(span != NULL) {
/* If there are down spans, set their scratch value also */
if(span->down != NULL)
- H5S_hyper_span_scratch(span->down, scr_value);
+ H5S__hyper_span_scratch(span->down);
/* Advance to next span */
span = span->next;
@@ -1280,16 +1290,16 @@ H5S_hyper_span_scratch(H5S_hyper_span_info_t *spans, void *scr_value)
} /* end if */
FUNC_LEAVE_NOAPI_VOID
-} /* H5S_hyper_span_scratch() */
+} /* end H5S__hyper_span_scratch() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_copy_span_helper
+ H5S__hyper_copy_span_helper
PURPOSE
Helper routine to copy a hyperslab span tree
USAGE
- H5S_hyper_span_info_t * H5S_hyper_copy_span_helper(spans)
+ H5S_hyper_span_info_t * H5S__hyper_copy_span_helper(spans)
H5S_hyper_span_info_t *spans; IN: Span tree to copy
RETURNS
Pointer to the copied span tree on success, NULL on failure
@@ -1301,7 +1311,7 @@ H5S_hyper_span_scratch(H5S_hyper_span_info_t *spans, void *scr_value)
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_info_t *
-H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans)
+H5S__hyper_copy_span_helper(H5S_hyper_span_info_t *spans)
{
H5S_hyper_span_t *span; /* Hyperslab span */
H5S_hyper_span_t *new_span; /* Temporary hyperslab span */
@@ -1309,12 +1319,14 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans)
H5S_hyper_span_info_t *new_down; /* New down span tree */
H5S_hyper_span_info_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
+ /* Sanity checks */
HDassert(spans);
+ HDassert(spans->scratch != (H5S_hyper_span_info_t *)~((size_t)NULL));
/* Check if the span tree was already copied */
- if(spans->scratch != NULL && spans->scratch != (H5S_hyper_span_info_t *)~((size_t)NULL)) {
+ if(spans->scratch != NULL) {
/* Just return the value of the already copied span tree */
ret_value = spans->scratch;
@@ -1323,13 +1335,11 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans)
} /* end if */
else {
/* Allocate a new span_info node */
- if(NULL == (ret_value = H5FL_MALLOC(H5S_hyper_span_info_t)))
+ if(NULL == (ret_value = H5FL_CALLOC(H5S_hyper_span_info_t)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span info")
/* Copy the span_info information */
ret_value->count = 1;
- ret_value->scratch = NULL;
- ret_value->head = NULL;
/* Set the scratch pointer in the node being copied to the newly allocated node */
spans->scratch = ret_value;
@@ -1339,7 +1349,7 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans)
prev_span = NULL;
while(span != NULL) {
/* Allocate a new node */
- if(NULL == (new_span = H5S_hyper_new_span(span->low, span->high, NULL, NULL)))
+ if(NULL == (new_span = H5S__hyper_new_span(span->low, span->high, NULL, NULL)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
/* Append to list of spans */
@@ -1353,7 +1363,7 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans)
/* Recurse to copy the 'down' spans, if there are any */
if(span->down != NULL) {
- if(NULL == (new_down = H5S_hyper_copy_span_helper(span->down)))
+ if(NULL == (new_down = H5S__hyper_copy_span_helper(span->down)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy hyperslab spans")
new_span->down = new_down;
} /* end if */
@@ -1368,16 +1378,16 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_copy_span_helper() */
+} /* end H5S__hyper_copy_span_helper() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_copy_span
+ H5S__hyper_copy_span
PURPOSE
Copy a hyperslab span tree
USAGE
- H5S_hyper_span_info_t * H5S_hyper_copy_span(span_info)
+ H5S_hyper_span_info_t * H5S__hyper_copy_span(span_info)
H5S_hyper_span_info_t *span_info; IN: Span tree to copy
RETURNS
Non-negative on success, negative on failure
@@ -1391,37 +1401,37 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_info_t *
-H5S_hyper_copy_span(H5S_hyper_span_info_t *spans)
+H5S__hyper_copy_span(H5S_hyper_span_info_t *spans)
{
H5S_hyper_span_info_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(spans);
/* Copy the hyperslab span tree */
- if(NULL == (ret_value = H5S_hyper_copy_span_helper(spans)))
+ if(NULL == (ret_value = H5S__hyper_copy_span_helper(spans)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, NULL, "can't copy hyperslab span tree")
/* Reset the scratch pointers for the next routine which needs them */
- H5S_hyper_span_scratch(spans, NULL);
+ H5S__hyper_span_scratch(spans);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_copy_span() */
+} /* end H5S__hyper_copy_span() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_cmp_spans
+ H5S__hyper_cmp_spans
PURPOSE
Check if two hyperslab slabs are the same
USAGE
- htri_d H5S_hyper_cmp_spans(span1, span2)
+ hbool_t H5S__hyper_cmp_spans(span1, span2)
H5S_hyper_span_t *span1; IN: First span tree to compare
H5S_hyper_span_t *span2; IN: Second span tree to compare
RETURNS
- TRUE (1) or FALSE (0) on success, negative on failure
+ TRUE (1) or FALSE (0) on success, can't fail
DESCRIPTION
Compare two hyperslab slabs to determine if they refer to the same
selection. If span1 & span2 are both NULL, that counts as equal
@@ -1430,69 +1440,63 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static htri_t
-H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *span_info2)
+static hbool_t
+H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_span_info_t *span_info2)
{
- H5S_hyper_span_t *span1;
- H5S_hyper_span_t *span2;
- htri_t nest=FAIL;
- htri_t ret_value=FAIL;
+ hbool_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check for redundant comparison */
- if(span_info1==span_info2)
- ret_value=TRUE;
+ if(span_info1 == span_info2)
+ ret_value = TRUE;
else {
+ const H5S_hyper_span_t *span1;
+ const H5S_hyper_span_t *span2;
+
/* Check for both spans being NULL */
- if(span_info1==NULL && span_info2==NULL)
- ret_value=TRUE;
+ if(span_info1 == NULL && span_info2 == NULL)
+ ret_value = TRUE;
else {
/* Check for one span being NULL */
- if(span_info1==NULL || span_info2==NULL)
- ret_value=FALSE;
+ if(span_info1 == NULL || span_info2 == NULL)
+ ret_value = FALSE;
else {
/* Get the pointers to the actual lists of spans */
- span1=span_info1->head;
- span2=span_info2->head;
+ span1 = span_info1->head;
+ span2 = span_info2->head;
/* Sanity checking */
HDassert(span1);
HDassert(span2);
/* infinite loop which must be broken out of */
- while (1) {
+ while(1) {
/* Check for both spans being NULL */
- if(span1==NULL && span2==NULL) {
- ret_value=TRUE;
+ if(span1 == NULL && span2 == NULL) {
+ ret_value = TRUE;
break;
} /* end if */
else {
/* Check for one span being NULL */
- if(span1==NULL || span2==NULL) {
- ret_value=FALSE;
+ if(span1 == NULL || span2 == NULL) {
+ ret_value = FALSE;
break;
} /* end if */
else {
/* Check if the actual low & high span information is the same */
- if(span1->low!=span2->low || span1->high!=span2->high) {
- ret_value=FALSE;
+ if(span1->low != span2->low || span1->high != span2->high) {
+ ret_value = FALSE;
break;
} /* end if */
else {
- if(span1->down!=NULL || span2!=NULL) {
- if((nest=H5S_hyper_cmp_spans(span1->down,span2->down))==FAIL) {
- ret_value=FAIL;
+ if(span1->down != NULL || span2 != NULL) {
+ if(!H5S__hyper_cmp_spans(span1->down, span2->down)) {
+ ret_value = FALSE;
break;
} /* end if */
else {
- if(nest==FALSE) {
- ret_value=FALSE;
- break;
- } /* end if */
- else {
- /* Keep going... */
- } /* end else */
+ /* Keep going... */
} /* end else */
} /* end if */
else {
@@ -1503,24 +1507,24 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s
} /* end else */
/* Advance to the next nodes in the span list */
- span1=span1->next;
- span2=span2->next;
+ span1 = span1->next;
+ span2 = span2->next;
} /* end while */
} /* end else */
} /* end else */
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_cmp_spans() */
+} /* end H5S__hyper_cmp_spans() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_free_span_info
+ H5S__hyper_free_span_info
PURPOSE
Free a hyperslab span info node
USAGE
- herr_t H5S_hyper_free_span_info(span_info)
+ herr_t H5S__hyper_free_span_info(span_info)
H5S_hyper_span_info_t *span_info; IN: Span info node to free
RETURNS
Non-negative on success, negative on failure
@@ -1534,12 +1538,12 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info)
+H5S__hyper_free_span_info(H5S_hyper_span_info_t *span_info)
{
H5S_hyper_span_t *span, *next_span;
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(span_info);
@@ -1547,15 +1551,15 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info)
span_info->count--;
/* Free the span tree if the reference count drops to zero */
- if(span_info->count==0) {
+ if(span_info->count == 0) {
/* Work through the list of spans pointed to by this 'info' node */
- span=span_info->head;
- while(span!=NULL) {
- next_span=span->next;
- if(H5S_hyper_free_span(span)<0)
+ span = span_info->head;
+ while(span != NULL) {
+ next_span = span->next;
+ if(H5S__hyper_free_span(span) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span")
- span=next_span;
+ span = next_span;
} /* end while */
/* Free this span info */
@@ -1564,16 +1568,16 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_free_span_info() */
+} /* end H5S__hyper_free_span_info() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_free_span
+ H5S__hyper_free_span
PURPOSE
Free a hyperslab span node
USAGE
- herr_t H5S_hyper_free_span(span)
+ herr_t H5S__hyper_free_span(span)
H5S_hyper_span_t *span; IN: Span node to free
RETURNS
Non-negative on success, negative on failure
@@ -1587,35 +1591,34 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_free_span (H5S_hyper_span_t *span)
+H5S__hyper_free_span(H5S_hyper_span_t *span)
{
- herr_t ret_value=SUCCEED;
+ herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(span);
/* Decrement the reference count of the 'down spans', freeing them if appropriate */
- if(span->down!=NULL) {
- if(H5S_hyper_free_span_info(span->down)<0)
+ if(span->down != NULL)
+ if(H5S__hyper_free_span_info(span->down) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab span tree")
- } /* end if */
/* Free this span */
span = H5FL_FREE(H5S_hyper_span_t, span);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_free_span() */
+} /* end H5S__hyper_free_span() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_copy
+ H5S__hyper_copy
PURPOSE
Copy a selection from one dataspace to another
USAGE
- herr_t H5S_hyper_copy(dst, src)
+ herr_t H5S__hyper_copy(dst, src)
H5S_t *dst; OUT: Pointer to the destination dataspace
H5S_t *src; IN: Pointer to the source dataspace
RETURNS
@@ -1634,27 +1637,28 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
+H5S__hyper_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection)
{
H5S_hyper_sel_t *dst_hslab; /* Pointer to destination hyperslab info */
const H5S_hyper_sel_t *src_hslab; /* Pointer to source hyperslab info */
- herr_t ret_value=SUCCEED; /* return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
+ /* Sanity check */
HDassert(src);
HDassert(dst);
/* Allocate space for the hyperslab selection information */
if(NULL == (dst->select.sel_info.hslab = H5FL_MALLOC(H5S_hyper_sel_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab info")
/* Set temporary pointers */
- dst_hslab=dst->select.sel_info.hslab;
- src_hslab=src->select.sel_info.hslab;
+ dst_hslab = dst->select.sel_info.hslab;
+ src_hslab = src->select.sel_info.hslab;
/* Copy the hyperslab information */
- dst_hslab->diminfo_valid=src_hslab->diminfo_valid;
+ dst_hslab->diminfo_valid = src_hslab->diminfo_valid;
if(src_hslab->diminfo_valid) {
size_t u; /* Local index variable */
@@ -1663,42 +1667,46 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
dst_hslab->app_diminfo[u]=src_hslab->app_diminfo[u];
} /* end for */
} /* end if */
- dst_hslab->unlim_dim = src_hslab->unlim_dim;
- dst_hslab->num_elem_non_unlim = src_hslab->num_elem_non_unlim;
dst->select.sel_info.hslab->span_lst=src->select.sel_info.hslab->span_lst;
/* Check if there is hyperslab span information to copy */
/* (Regular hyperslab information is copied with the selection structure) */
- if(src->select.sel_info.hslab->span_lst!=NULL) {
+ if(src->select.sel_info.hslab->span_lst != NULL) {
if(share_selection) {
/* Share the source's span tree by incrementing the reference count on it */
+ dst->select.sel_info.hslab->span_lst = src->select.sel_info.hslab->span_lst;
dst->select.sel_info.hslab->span_lst->count++;
} /* end if */
else
/* Copy the hyperslab span information */
- dst->select.sel_info.hslab->span_lst = H5S_hyper_copy_span(src->select.sel_info.hslab->span_lst);
+ dst->select.sel_info.hslab->span_lst = H5S__hyper_copy_span(src->select.sel_info.hslab->span_lst);
} /* end if */
+ else
+ dst->select.sel_info.hslab->span_lst = NULL;
+
+ /* Copy the unlimited dimension info */
+ dst_hslab->unlim_dim = src_hslab->unlim_dim;
+ dst_hslab->num_elem_non_unlim = src_hslab->num_elem_non_unlim;
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_hyper_copy() */
+} /* end H5S__hyper_copy() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_is_valid_helper
+ H5S__hyper_is_valid_helper
PURPOSE
Check whether the selection fits within the extent, with the current
offset defined.
USAGE
- htri_t H5S_hyper_is_valid_helper(spans, offset, rank);
+ hbool_t H5S__hyper_is_valid_helper(spans, offset, rank);
const H5S_hyper_span_info_t *spans; IN: Pointer to current hyperslab span tree
const hssize_t *offset; IN: Pointer to offset array
const hsize_t *size; IN: Pointer to size array
hsize_t rank; IN: Current rank looking at
RETURNS
- TRUE if the selection fits within the extent, FALSE if it does not and
- Negative on an error.
+ TRUE if the selection fits within the extent, FALSE if it does not
DESCRIPTION
Determines if the current selection at the current offet fits within the
extent for the dataspace.
@@ -1707,57 +1715,52 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static htri_t
-H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *offset, const hsize_t *size, hsize_t rank)
+static hbool_t
+H5S__hyper_is_valid_helper(const H5S_hyper_span_info_t *spans, const hssize_t *offset,
+ const hsize_t *size)
{
H5S_hyper_span_t *curr; /* Hyperslab information nodes */
- htri_t tmp; /* temporary return value */
- htri_t ret_value=TRUE; /* return value */
+ hbool_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(spans);
HDassert(offset);
HDassert(size);
- HDassert(rank < H5O_LAYOUT_NDIMS);
- /* Check each point to determine whether selection+offset is within extent */
- curr=spans->head;
- while(curr!=NULL && ret_value==TRUE) {
+ /* Check each point to determine whether selection + offset is within extent */
+ curr = spans->head;
+ while(curr != NULL) {
/* Check if an offset has been defined */
/* Bounds check the selected point + offset against the extent */
- if((((hssize_t)curr->low+offset[rank])>=(hssize_t)size[rank])
- || (((hssize_t)curr->low+offset[rank])<0)
- || (((hssize_t)curr->high+offset[rank])>=(hssize_t)size[rank])
- || (((hssize_t)curr->high+offset[rank])<0)) {
- ret_value=FALSE;
- break;
- } /* end if */
+ if((((hssize_t)curr->low + *offset) >= (hssize_t)*size)
+ || (((hssize_t)curr->low + *offset) < 0)
+ || (((hssize_t)curr->high + *offset) >= (hssize_t)*size)
+ || (((hssize_t)curr->high + *offset) < 0))
+ HGOTO_DONE(FALSE)
/* Recurse if this node has down spans */
- if(curr->down!=NULL) {
- if((tmp=H5S_hyper_is_valid_helper(curr->down,offset,size,rank+1))!=TRUE) {
- ret_value=tmp;
- break;
- } /* end if */
- } /* end if */
+ if(curr->down != NULL)
+ if(!H5S__hyper_is_valid_helper(curr->down, offset + 1, size + 1))
+ HGOTO_DONE(FALSE)
/* Advance to next node */
- curr=curr->next;
+ curr = curr->next;
} /* end while */
+done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_hyper_is_valid_helper() */
+} /* end H5S__hyper_is_valid_helper() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_is_valid
+ H5S__hyper_is_valid
PURPOSE
Check whether the selection fits within the extent, with the current
offset defined.
USAGE
- htri_t H5S_hyper_is_valid(space);
+ htri_t H5S__hyper_is_valid(space);
H5S_t *space; IN: Dataspace pointer to query
RETURNS
TRUE if the selection fits within the extent, FALSE if it does not and
@@ -1771,12 +1774,11 @@ H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *o
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_hyper_is_valid (const H5S_t *space)
+H5S__hyper_is_valid(const H5S_t *space)
{
- unsigned u; /* Counter */
htri_t ret_value = TRUE; /* return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
@@ -1788,43 +1790,43 @@ H5S_hyper_is_valid (const H5S_t *space)
if(space->select.sel_info.hslab->diminfo_valid) {
const H5S_hyper_dim_t *diminfo=space->select.sel_info.hslab->opt_diminfo; /* local alias for diminfo */
hssize_t end; /* The high bound of a region in a dimension */
+ unsigned u; /* Counter */
/* Check each dimension */
- for(u=0; u<space->extent.rank; u++) {
+ for(u = 0; u < space->extent.rank; u++) {
/* if block or count is zero, then can skip the test since */
/* no data point is chosen */
- if (diminfo[u].count && diminfo[u].block) {
+ if(diminfo[u].count && diminfo[u].block) {
/* Bounds check the start point in this dimension */
- if(((hssize_t)diminfo[u].start+space->select.offset[u])<0 ||
- ((hssize_t)diminfo[u].start+space->select.offset[u])>=(hssize_t)space->extent.size[u])
+ if(((hssize_t)diminfo[u].start + space->select.offset[u]) < 0 ||
+ ((hssize_t)diminfo[u].start + space->select.offset[u]) >= (hssize_t)space->extent.size[u])
HGOTO_DONE(FALSE)
/* Compute the largest location in this dimension */
- end=(hssize_t)(diminfo[u].start+diminfo[u].stride*(diminfo[u].count-1)+(diminfo[u].block-1))+space->select.offset[u];
+ end = (hssize_t)(diminfo[u].start + diminfo[u].stride * (diminfo[u].count - 1) + (diminfo[u].block - 1)) + space->select.offset[u];
/* Bounds check the end point in this dimension */
- if(end<0 || end>=(hssize_t)space->extent.size[u])
+ if(end < 0 || end >= (hssize_t)space->extent.size[u])
HGOTO_DONE(FALSE)
} /* end if */
} /* end for */
} /* end if */
- else {
+ else
/* Call the recursive routine to validate the span tree */
- ret_value=H5S_hyper_is_valid_helper(space->select.sel_info.hslab->span_lst,space->select.offset,space->extent.size,(hsize_t)0);
- } /* end else */
+ ret_value = H5S__hyper_is_valid_helper(space->select.sel_info.hslab->span_lst, space->select.offset, space->extent.size);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_hyper_is_valid() */
+} /* end H5S__hyper_is_valid() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_span_nblocks
+ H5S__hyper_span_nblocks
PURPOSE
Count the number of blocks in a span tree
USAGE
- hsize_t H5S_hyper_span_nblocks(spans)
+ hsize_t H5S__hyper_span_nblocks(spans)
const H5S_hyper_span_info_t *spans; IN: Hyperslab span tree to count elements of
RETURNS
Number of blocks in span tree on success; negative on failure
@@ -1836,20 +1838,21 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static hsize_t
-H5S_hyper_span_nblocks(H5S_hyper_span_info_t *spans)
+H5S__hyper_span_nblocks(const H5S_hyper_span_info_t *spans)
{
- H5S_hyper_span_t *span; /* Hyperslab span */
hsize_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Count the number of elements in the span tree */
if(spans != NULL) {
+ H5S_hyper_span_t *span; /* Hyperslab span */
+
span = spans->head;
while(span != NULL) {
/* If there are down spans, add the total down span blocks */
- if(span->down!=NULL)
- ret_value += H5S_hyper_span_nblocks(span->down);
+ if(span->down != NULL)
+ ret_value += H5S__hyper_span_nblocks(span->down);
/* If there are no down spans, just count the block in this span */
else
ret_value++;
@@ -1860,16 +1863,16 @@ H5S_hyper_span_nblocks(H5S_hyper_span_info_t *spans)
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_span_nblocks() */
+} /* end H5S__hyper_span_nblocks() */
/*--------------------------------------------------------------------------
NAME
- H5S_get_select_hyper_nblocks
+ H5S__get_select_hyper_nblocks
PURPOSE
Get the number of hyperslab blocks in current hyperslab selection
USAGE
- hsize_t H5S_get_select_hyper_nblocks(space)
+ hsize_t H5S__get_select_hyper_nblocks(space)
H5S_t *space; IN: Dataspace ptr of selection to query
RETURNS
The number of hyperslab blocks in selection on success, negative on failure
@@ -1881,11 +1884,11 @@ H5S_hyper_span_nblocks(H5S_hyper_span_info_t *spans)
REVISION LOG
--------------------------------------------------------------------------*/
static hsize_t
-H5S_get_select_hyper_nblocks(H5S_t *space)
+H5S__get_select_hyper_nblocks(const H5S_t *space)
{
hsize_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
HDassert(space->select.sel_info.hslab->unlim_dim < 0);
@@ -1899,10 +1902,10 @@ H5S_get_select_hyper_nblocks(H5S_t *space)
ret_value *= space->select.sel_info.hslab->app_diminfo[u].count;
} /* end if */
else
- ret_value = H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
+ ret_value = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_get_select_hyper_nblocks() */
+} /* end H5S__get_select_hyper_nblocks() */
/*--------------------------------------------------------------------------
@@ -1933,17 +1936,17 @@ H5Sget_select_hyper_nblocks(hid_t spaceid)
/* Check args */
if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(H5S_GET_SELECT_TYPE(space) != H5S_SEL_HYPERSLABS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection")
if(space->select.sel_info.hslab->unlim_dim >= 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "cannot get number of blocks for unlimited selection")
- ret_value = (hssize_t)H5S_get_select_hyper_nblocks(space);
+ ret_value = (hssize_t)H5S__get_select_hyper_nblocks(space);
done:
FUNC_LEAVE_API(ret_value)
-} /* H5Sget_select_hyper_nblocks() */
+} /* end H5Sget_select_hyper_nblocks() */
/*--------------------------------------------------------------------------
@@ -2042,7 +2045,7 @@ H5S_hyper_set_version(const H5S_t *space, hsize_t block_count, hsize_t bounds_en
/* Use version 2 for unlimited selection */
if(space->select.sel_info.hslab->unlim_dim >= 0)
tmp_version = H5S_HYPER_VERSION_2;
- else if(H5S_hyper_is_regular(space)) {
+ else if(H5S__hyper_is_regular(space)) {
/* If exceed (2^32 -1) */
if(count_up_version || bound_up_version)
@@ -2074,7 +2077,7 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_serial_size
+ H5S__hyper_serial_size
PURPOSE
Determine the number of bytes needed to store the serialized hyperslab
selection information.
@@ -2093,7 +2096,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static hssize_t
-H5S_hyper_serial_size(const H5S_t *space, H5F_t *f)
+H5S__hyper_serial_size(const H5S_t *space, H5F_t *f)
{
hsize_t block_count = 0; /* block counter for regular hyperslabs */
hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds */
@@ -2111,17 +2114,17 @@ H5S_hyper_serial_size(const H5S_t *space, H5F_t *f)
HDmemset(bounds_end, 0, sizeof(bounds_end));
if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */
/* Determine the number of blocks */
- if(H5S_hyper_is_regular(space)) {
+ if(H5S__hyper_is_regular(space)) {
/* Check each dimension */
for(block_count = 1, u = 0; u < space->extent.rank; u++)
block_count *= space->select.sel_info.hslab->opt_diminfo[u].count;
} /* end if */
else
/* Spin through hyperslab spans, adding 8 * rank bytes for each block */
- block_count = H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
+ block_count = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
/* Get bounding box for the selection */
- if(H5S_hyper_bounds(space, bounds_start, bounds_end) < 0)
+ if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
}
@@ -2160,23 +2163,23 @@ H5S_hyper_serial_size(const H5S_t *space, H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_hyper_serial_size() */
+} /* end H5S__hyper_serial_size() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_serialize_helper
+ H5S__hyper_serialize_helper
PURPOSE
Serialize the current selection into a user-provided buffer.
USAGE
- void H5S_hyper_serialize_helper(spans, start, end, rank, buf)
+ void H5S__hyper_serialize_helper(spans, start, end, rank, buf)
H5S_hyper_span_info_t *spans; IN: Hyperslab span tree to serialize
hssize_t start[]; IN/OUT: Accumulated start points
hssize_t end[]; IN/OUT: Accumulated end points
hsize_t rank; IN: Current rank looking at
uint8 *buf; OUT: Buffer to put serialized selection into
RETURNS
- <none>
+ None
DESCRIPTION
Serializes the current element selection into a buffer. (Primarily for
storing on disk).
@@ -2186,14 +2189,13 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static void
-H5S_hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
+H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
hsize_t *start, hsize_t *end, hsize_t rank, uint8_t **p)
{
H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */
uint8_t *pp = (*p); /* Local pointer for decoding */
- hsize_t u; /* Index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(spans);
@@ -2203,29 +2205,31 @@ H5S_hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
HDassert(p && pp);
/* Walk through the list of spans, recursing or outputing them */
- curr=spans->head;
- while(curr!=NULL) {
+ curr = spans->head;
+ while(curr != NULL) {
/* Recurse if this node has down spans */
- if(curr->down!=NULL) {
+ if(curr->down != NULL) {
/* Add the starting and ending points for this span to the list */
- start[rank]=curr->low;
- end[rank]=curr->high;
+ start[rank] = curr->low;
+ end[rank] = curr->high;
/* Recurse down to the next dimension */
- H5S_hyper_serialize_helper(curr->down, start, end, rank + 1, &pp);
+ H5S__hyper_serialize_helper(curr->down, start, end, rank + 1, &pp);
} /* end if */
else {
+ hsize_t u; /* Index variable */
+
/* Encode all the previous dimensions starting & ending points */
/* Encode previous starting points */
- for(u=0; u<rank; u++)
+ for(u = 0; u < rank; u++)
UINT32ENCODE(pp, (uint32_t)start[u]);
/* Encode starting point for this span */
UINT32ENCODE(pp, (uint32_t)curr->low);
/* Encode previous ending points */
- for(u=0; u<rank; u++)
+ for(u = 0; u < rank; u++)
UINT32ENCODE(pp, (uint32_t)end[u]);
/* Encode starting point for this span */
@@ -2233,23 +2237,23 @@ H5S_hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
} /* end else */
/* Advance to next node */
- curr=curr->next;
+ curr = curr->next;
} /* end while */
/* Update encoding pointer */
*p = pp;
FUNC_LEAVE_NOAPI_VOID
-} /* H5S_hyper_serialize_helper() */
+} /* H5S__hyper_serialize_helper() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_serialize
+ H5S__hyper_serialize
PURPOSE
Serialize the current selection into a user-provided buffer.
USAGE
- herr_t H5S_hyper_serialize(space, p)
+ herr_t H5S__hyper_serialize(space, p)
const H5S_t *space; IN: Dataspace with selection to serialize
uint8_t **p; OUT: Pointer to buffer to put serialized
selection. Will be advanced to end of
@@ -2266,7 +2270,7 @@ H5S_hyper_serialize_helper(const H5S_hyper_span_info_t *spans,
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
+H5S__hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
{
const H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */
uint8_t *pp = (*p); /* Local pointer for decoding */
@@ -2291,8 +2295,10 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
FUNC_ENTER_NOAPI_NOINIT
+ /* Sanity checks */
HDassert(space);
HDassert(p);
+ pp = (*p);
HDassert(pp);
/* Set some convienence values */
@@ -2301,17 +2307,17 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
if(space->select.sel_info.hslab->unlim_dim < 0) { /* ! H5S_UNLIMITED */
/* Calculate the # of blocks */
- if(H5S_hyper_is_regular(space)) {
+ if(H5S__hyper_is_regular(space)) {
/* Check each dimension */
for(block_count = 1, u = 0; u < ndims; u++)
block_count *= diminfo[u].count;
} /* end if */
else
/* Spin through hyperslab spans, adding 8 * rank bytes for each block */
- block_count = H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
+ block_count = H5S__hyper_span_nblocks(space->select.sel_info.hslab->span_lst);
/* Get bounding box */
- if(H5S_hyper_bounds(space, bounds_start, bounds_end) < 0)
+ if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
}
@@ -2323,7 +2329,7 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
if(H5S_hyper_set_offset_size(space, block_count, bounds_end, version, &offset_size) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't determine hyper version")
- if(H5S_hyper_is_regular(space) && version == H5S_HYPER_VERSION_2)
+ if(H5S__hyper_is_regular(space) && version == H5S_HYPER_VERSION_2)
flags |= H5S_HYPER_REGULAR;
/* Store the preamble information */
@@ -2360,16 +2366,15 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
len += (4 * space->extent.rank * 8);
} /* end if */
/* Check for a "regular" hyperslab selection */
- else if(H5S_hyper_is_regular(space)) {
+ else if(H5S__hyper_is_regular(space)) {
HDassert(version == H5S_HYPER_VERSION_1);
/* Set some convienence values */
fast_dim = ndims - 1;
-
/* Encode number of hyperslabs */
H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t);
UINT32ENCODE(pp, (uint32_t)block_count);
- len+=4;
+ len += 4;
/* Now serialize the information for the regular hyperslab */
@@ -2380,14 +2385,14 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
} /* end for */
/* We're not done with the iteration */
- done=0;
+ done = FALSE;
/* Go iterate over the hyperslabs */
- while(done==0) {
+ while(done == FALSE) {
/* Iterate over the blocks in the fastest dimension */
- while(tmp_count[fast_dim]>0) {
+ while(tmp_count[fast_dim] > 0) {
/* Add 8 bytes times the rank for each hyperslab selected */
- len+=8*ndims;
+ len += 8 * ndims;
/* Encode hyperslab starting location */
for(u = 0; u < ndims; u++)
@@ -2409,11 +2414,11 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
int temp_dim; /* Temporary rank holder */
/* Reset the block counts */
- tmp_count[fast_dim]=diminfo[fast_dim].count;
+ tmp_count[fast_dim] = diminfo[fast_dim].count;
/* Bubble up the decrement to the slower changing dimensions */
temp_dim = (int)fast_dim - 1;
- while(temp_dim >= 0 && done == 0) {
+ while(temp_dim >= 0 && done == FALSE) {
/* Decrement the block count */
tmp_count[temp_dim]--;
@@ -2423,7 +2428,7 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
/* Check for getting out of iterator */
if(temp_dim == 0)
- done = 1;
+ done = TRUE;
/* Reset the block count in this dimension */
tmp_count[temp_dim] = diminfo[temp_dim].count;
@@ -2436,10 +2441,8 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
break; /* Break out now, for 1-D selections */
/* Re-compute offset array */
- for(u = 0; u < ndims; u++) {
- temp_off = diminfo[u].start + diminfo[u].stride * (diminfo[u].count - tmp_count[u]);
- offset[u] = temp_off;
- } /* end for */
+ for(u = 0; u < ndims; u++)
+ offset[u] = diminfo[u].start + diminfo[u].stride * (diminfo[u].count - tmp_count[u]);
} /* end while */
} /* end if */
else {
@@ -2455,7 +2458,7 @@ H5S_hyper_serialize(const H5S_t *space, uint8_t **p, H5F_t *f)
len += (uint32_t)(8 * ndims * block_count);
/* Encode each hyperslab in selection */
- H5S_hyper_serialize_helper(space->select.sel_info.hslab->span_lst, start, end, (hsize_t)0, &pp);
+ H5S__hyper_serialize_helper(space->select.sel_info.hslab->span_lst, start, end, (hsize_t)0, &pp);
} /* end else */
/* Encode length */
@@ -2471,11 +2474,11 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_deserialize
+ H5S__hyper_deserialize
PURPOSE
Deserialize the current selection from a user-provided buffer.
USAGE
- herr_t H5S_hyper_deserialize(space, p)
+ herr_t H5S__hyper_deserialize(space, p)
H5S_t *space; IN/OUT: Dataspace pointer to place
selection into
uint32_t version IN: Selection version
@@ -2494,30 +2497,22 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t flags,
+H5S__hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t flags,
const uint8_t **p)
{
- unsigned rank; /* rank of points */
- const uint8_t *pp = (*p); /* Local pointer for decoding */
- hsize_t num_elem=0; /* number of elements in selection */
- hsize_t start[H5O_LAYOUT_NDIMS]; /* hyperslab start information */
- hsize_t end[H5O_LAYOUT_NDIMS]; /* hyperslab end information */
- hsize_t stride[H5O_LAYOUT_NDIMS]; /* hyperslab stride information */
- hsize_t count[H5O_LAYOUT_NDIMS]; /* hyperslab count information */
- hsize_t block[H5O_LAYOUT_NDIMS]; /* hyperslab block information */
- hsize_t *tstart=NULL; /* temporary hyperslab pointers */
- hsize_t *tend=NULL; /* temporary hyperslab pointers */
- hsize_t *tstride=NULL; /* temporary hyperslab pointers */
- hsize_t *tcount=NULL; /* temporary hyperslab pointers */
- hsize_t *tblock=NULL; /* temporary hyperslab pointers */
- unsigned i,j; /* local counting variables */
- herr_t ret_value=FAIL; /* return value */
+ unsigned rank; /* Rank of points */
+ const uint8_t *pp; /* Local pointer for decoding */
+ hsize_t start[H5O_LAYOUT_NDIMS]; /* Hyperslab start information */
+ hsize_t block[H5O_LAYOUT_NDIMS]; /* Hyperslab block information */
+ unsigned u; /* Local counting variable */
+ herr_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(space);
HDassert(p);
+ pp = (*p);
HDassert(pp);
/* Deserialize slabs to select */
@@ -2525,48 +2520,59 @@ H5S_hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t fla
rank = space->extent.rank; /* Retrieve rank from space */
if(flags & H5S_HYPER_REGULAR) {
+ hsize_t stride[H5O_LAYOUT_NDIMS]; /* Hyperslab stride information */
+ hsize_t count[H5O_LAYOUT_NDIMS]; /* Hyperslab count information */
+
+ /* Sanity checks */
HDassert(H5S_UNLIMITED == HSIZE_UNDEF);
HDassert(version >= 2);
/* Iterate over dimensions */
- /* Decode start/stride/block/count */
- for(i = 0; i < space->extent.rank; i++) {
- UINT64DECODE(pp, start[i]);
- UINT64DECODE(pp, stride[i]);
- UINT64DECODE(pp, count[i]);
- UINT64DECODE(pp, block[i]);
+ for(u = 0; u < rank; u++) {
+ /* Decode start/stride/block/count */
+ UINT64DECODE(pp, start[u]);
+ UINT64DECODE(pp, stride[u]);
+ UINT64DECODE(pp, count[u]);
+ UINT64DECODE(pp, block[u]);
} /* end for */
/* Select the hyperslab to the current selection */
if((ret_value = H5S_select_hyperslab(space, H5S_SELECT_SET, start, stride, count, block)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't change selection")
} /* end if */
else {
- /* decode the number of blocks */
- UINT32DECODE(pp,num_elem);
+ const hsize_t *stride; /* Hyperslab stride information */
+ const hsize_t *count; /* Hyperslab count information */
+ hsize_t end[H5O_LAYOUT_NDIMS]; /* Hyperslab end information */
+ hsize_t *tstart; /* Temporary hyperslab pointers */
+ hsize_t *tend; /* Temporary hyperslab pointers */
+ hsize_t *tblock; /* Temporary hyperslab pointers */
+ size_t num_elem; /* Number of elements in selection */
+ unsigned v; /* Local counting variable */
+
+ /* Decode the number of points */
+ UINT32DECODE(pp, num_elem);
/* Set the count & stride for all blocks */
- for(tcount = count, tstride = stride, j = 0; j < rank; j++, tstride++, tcount++) {
- *tcount=1;
- *tstride=1;
- } /* end for */
+ stride = count = H5S_hyper_ones_g;
/* Retrieve the coordinates from the buffer */
- for(i = 0; i < num_elem; i++) {
-
- /* Decode the starting and ending points */
- for(tstart=start,j=0; j<rank; j++,tstart++)
+ for(u = 0; u < num_elem; u++) {
+ /* Decode the starting points */
+ for(tstart = start, v = 0; v < rank; v++, tstart++)
UINT32DECODE(pp, *tstart);
- for(tend = end, j = 0; j < rank; j++, tend++)
+
+ /* Decode the ending points */
+ for(tend = end, v = 0; v < rank; v++, tend++)
UINT32DECODE(pp, *tend);
/* Change the ending points into blocks */
- for(tblock=block,tstart=start,tend=end,j=0; j<rank; j++,tstart++,tend++,tblock++)
- *tblock=(*tend-*tstart)+1;
+ for(tblock = block, tstart = start, tend = end, v = 0; v < rank; v++, tstart++, tend++, tblock++)
+ *tblock = (*tend - *tstart) + 1;
/* Select or add the hyperslab to the current selection */
- if((ret_value=H5S_select_hyperslab(space,(i==0 ? H5S_SELECT_SET : H5S_SELECT_OR),start,stride,count,block))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+ if((ret_value = H5S_select_hyperslab(space, (u == 0 ? H5S_SELECT_SET : H5S_SELECT_OR), start, stride, count, block)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't change selection")
} /* end for */
} /* end else */
@@ -2575,16 +2581,16 @@ H5S_hyper_deserialize(H5S_t *space, uint32_t H5_ATTR_UNUSED version, uint8_t fla
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_deserialize() */
+} /* end H5S__hyper_deserialize() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_span_blocklist
+ H5S__hyper_span_blocklist
PURPOSE
Get a list of hyperslab blocks currently selected
USAGE
- herr_t H5S_hyper_span_blocklist(spans, start, end, rank, startblock, numblocks, buf)
+ herr_t H5S__hyper_span_blocklist(spans, start, end, rank, startblock, numblocks, buf)
H5S_hyper_span_info_t *spans; IN: Dataspace pointer of selection to query
hsize_t start[]; IN/OUT: Accumulated start points
hsize_t end[]; IN/OUT: Accumulated end points
@@ -2612,13 +2618,15 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hsize_t start[], hsize_t end[], hsize_t rank, hsize_t *startblock, hsize_t *numblocks, hsize_t **buf)
+H5S__hyper_span_blocklist(const H5S_hyper_span_info_t *spans, hsize_t start[],
+ hsize_t end[], hsize_t rank, hsize_t *startblock, hsize_t *numblocks,
+ hsize_t **buf)
{
- H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */
+ const H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */
hsize_t u; /* Index variable */
herr_t ret_value = SUCCEED; /* return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(spans);
@@ -2639,7 +2647,7 @@ H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hsize_t start[], hsize_t
end[rank] = curr->high;
/* Recurse down to the next dimension */
- if(H5S_hyper_span_blocklist(curr->down, start, end, (rank + 1), startblock, numblocks, buf) < 0)
+ if(H5S__hyper_span_blocklist(curr->down, start, end, (rank + 1), startblock, numblocks, buf) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
} /* end if */
else {
@@ -2679,16 +2687,16 @@ H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hsize_t start[], hsize_t
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_span_blocklist() */
+} /* end H5S__hyper_span_blocklist() */
/*--------------------------------------------------------------------------
NAME
- H5S_get_select_hyper_blocklist
+ H5S__get_select_hyper_blocklist
PURPOSE
Get the list of hyperslab blocks currently selected
USAGE
- herr_t H5S_get_select_hyper_blocklist(space, startblock, numblocks, buf)
+ herr_t H5S__get_select_hyper_blocklist(space, startblock, numblocks, buf)
H5S_t *space; IN: Dataspace pointer of selection to query
hsize_t startblock; IN: Hyperslab block to start with
hsize_t numblocks; IN: Number of hyperslab blocks to get
@@ -2713,11 +2721,11 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startblock, hsize_t numblocks, hsize_t *buf)
+H5S__get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startblock, hsize_t numblocks, hsize_t *buf)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
HDassert(buf);
@@ -2840,11 +2848,11 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc
hsize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */
hsize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */
- ret_value = H5S_hyper_span_blocklist(space->select.sel_info.hslab->span_lst, start, end, (hsize_t)0, &startblock, &numblocks, &buf);
+ ret_value = H5S__hyper_span_blocklist(space->select.sel_info.hslab->span_lst, start, end, (hsize_t)0, &startblock, &numblocks, &buf);
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_get_select_hyper_blocklist() */
+} /* end H5S__get_select_hyper_blocklist() */
/*--------------------------------------------------------------------------
@@ -2891,7 +2899,7 @@ H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock,
if(buf == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer")
if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(H5S_GET_SELECT_TYPE(space)!=H5S_SEL_HYPERSLABS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection")
if(space->select.sel_info.hslab->unlim_dim >= 0)
@@ -2899,13 +2907,13 @@ H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock,
/* Go get the correct number of blocks */
if(numblocks > 0)
- ret_value = H5S_get_select_hyper_blocklist(space, 0, startblock, numblocks, buf);
+ ret_value = H5S__get_select_hyper_blocklist(space, 0, startblock, numblocks, buf);
else
- ret_value=SUCCEED; /* Successfully got 0 blocks... */
+ ret_value = SUCCEED; /* Successfully got 0 blocks... */
done:
FUNC_LEAVE_API(ret_value)
-} /* H5Sget_select_hyper_blocklist() */
+} /* end H5Sget_select_hyper_blocklist() */
/*--------------------------------------------------------------------------
@@ -2980,11 +2988,11 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_bounds
+ H5S__hyper_bounds
PURPOSE
Gets the bounding box containing the selection.
USAGE
- herr_t H5S_hyper_bounds(space, hsize_t *start, hsize_t *end)
+ herr_t H5S__hyper_bounds(space, hsize_t *start, hsize_t *end)
H5S_t *space; IN: Dataspace pointer of selection to query
hsize_t *start; OUT: Starting coordinate of bounding box
hsize_t *end; OUT: Opposite coordinate of bounding box
@@ -3005,14 +3013,15 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
+H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
unsigned rank; /* Dataspace rank */
unsigned i; /* index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
+ /* Sanity check */
HDassert(space);
HDassert(start);
HDassert(end);
@@ -3051,16 +3060,16 @@ H5S_hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_bounds() */
+} /* end H5S__hyper_bounds() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_offset
+ H5S__hyper_offset
PURPOSE
Gets the linear offset of the first element for the selection.
USAGE
- herr_t H5S_hyper_offset(space, offset)
+ herr_t H5S__hyper_offset(space, offset)
const H5S_t *space; IN: Dataspace pointer of selection to query
hsize_t *offset; OUT: Linear offset of first element in selection
RETURNS
@@ -3075,7 +3084,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_offset(const H5S_t *space, hsize_t *offset)
+H5S__hyper_offset(const H5S_t *space, hsize_t *offset)
{
const hssize_t *sel_offset; /* Pointer to the selection's offset */
const hsize_t *dim_size; /* Pointer to a dataspace's extent */
@@ -3084,7 +3093,7 @@ H5S_hyper_offset(const H5S_t *space, hsize_t *offset)
int i; /* index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
HDassert(space && space->extent.rank>0);
HDassert(offset);
@@ -3159,7 +3168,7 @@ H5S_hyper_offset(const H5S_t *space, hsize_t *offset)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_offset() */
+} /* end H5S__hyper_offset() */
/*--------------------------------------------------------------------------
@@ -3191,11 +3200,11 @@ H5S__hyper_unlim_dim(const H5S_t *space)
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_num_elem_non_unlim
+ H5S__hyper_num_elem_non_unlim
PURPOSE
Return number of elements in the non-unlimited dimensions
USAGE
- herr_t H5S_hyper_num_elem_non_unlim(space,num_elem_non_unlim)
+ herr_t H5S__hyper_num_elem_non_unlim(space,num_elem_non_unlim)
H5S_t *space; IN: Dataspace pointer to check
hsize_t *num_elem_non_unlim; OUT: Number of elements in the non-unlimited dimensions
RETURNS
@@ -3210,11 +3219,11 @@ H5S__hyper_unlim_dim(const H5S_t *space)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim)
+H5S__hyper_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(space);
@@ -3228,16 +3237,16 @@ H5S_hyper_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_hyper_num_elem_non_unlim() */
+} /* end H5S__hyper_num_elem_non_unlim() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_is_contiguous
+ H5S__hyper_is_contiguous
PURPOSE
Check if a hyperslab selection is contiguous within the dataspace extent.
USAGE
- htri_t H5S_hyper_is_contiguous(space)
+ htri_t H5S__hyper_is_contiguous(space)
H5S_t *space; IN: Dataspace pointer to check
RETURNS
TRUE/FALSE/FAIL
@@ -3250,14 +3259,14 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_hyper_is_contiguous(const H5S_t *space)
+H5S__hyper_is_contiguous(const H5S_t *space)
{
- unsigned small_contiguous, /* Flag for small contiguous block */
+ hbool_t small_contiguous, /* Flag for small contiguous block */
large_contiguous; /* Flag for large contiguous block */
unsigned u; /* index variable */
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
@@ -3279,31 +3288,31 @@ H5S_hyper_is_contiguous(const H5S_t *space)
*/
/* Initialize flags */
- large_contiguous=TRUE; /* assume true and reset if the dimensions don't match */
- small_contiguous=FALSE; /* assume false initially */
+ large_contiguous = TRUE; /* assume true and reset if the dimensions don't match */
+ small_contiguous = FALSE; /* assume false initially */
/* Check for a "large contigous" block */
- for(u=0; u<space->extent.rank; u++) {
- if(diminfo[u].count>1) {
- large_contiguous=FALSE;
+ for(u = 0; u < space->extent.rank; u++) {
+ if(diminfo[u].count > 1) {
+ large_contiguous = FALSE;
break;
} /* end if */
- if(u>0 && diminfo[u].block!=space->extent.size[u]) {
- large_contiguous=FALSE;
+ if(u > 0 && diminfo[u].block != space->extent.size[u]) {
+ large_contiguous = FALSE;
break;
} /* end if */
} /* end for */
/* If we didn't find a large contiguous block, check for a small one */
- if(large_contiguous==FALSE) {
- small_contiguous=TRUE;
- for(u=0; u<space->extent.rank; u++) {
- if(diminfo[u].count>1) {
- small_contiguous=FALSE;
+ if(!large_contiguous) {
+ small_contiguous = TRUE;
+ for(u = 0; u < space->extent.rank; u++) {
+ if(diminfo[u].count > 1) {
+ small_contiguous = FALSE;
break;
} /* end if */
- if(u<(space->extent.rank-1) && diminfo[u].block!=1) {
- small_contiguous=FALSE;
+ if(u < (space->extent.rank - 1) && diminfo[u].block != 1) {
+ small_contiguous = FALSE;
break;
} /* end if */
} /* end for */
@@ -3311,7 +3320,7 @@ H5S_hyper_is_contiguous(const H5S_t *space)
/* Indicate true if it's either a large or small contiguous block */
if(large_contiguous || small_contiguous)
- ret_value=TRUE;
+ ret_value = TRUE;
} /* end if */
else {
H5S_hyper_span_info_t *spans; /* Hyperslab span info node */
@@ -3325,42 +3334,42 @@ H5S_hyper_is_contiguous(const H5S_t *space)
* block size must be 1 in all but the fastest changing dimension).
*/
/* Initialize flags */
- large_contiguous=TRUE; /* assume true and reset if the dimensions don't match */
- small_contiguous=FALSE; /* assume false initially */
+ large_contiguous = TRUE; /* assume true and reset if the dimensions don't match */
+ small_contiguous = FALSE; /* assume false initially */
/* Get information for slowest changing information */
- spans=space->select.sel_info.hslab->span_lst;
- span=spans->head;
+ spans = space->select.sel_info.hslab->span_lst;
+ span = spans->head;
/* If there are multiple spans in the slowest changing dimension, the selection isn't contiguous */
- if(span->next!=NULL)
- large_contiguous=FALSE;
+ if(span->next != NULL)
+ large_contiguous = FALSE;
else {
/* Now check the rest of the dimensions */
- if(span->down!=NULL) {
- u=1; /* Current dimension working on */
+ if(span->down != NULL) {
+ u = 1; /* Current dimension working on */
/* Get the span information for the next fastest dimension */
- spans=span->down;
+ spans = span->down;
/* Cycle down the spans until we run out of down spans or find a non-contiguous span */
- while(spans!=NULL) {
- span=spans->head;
+ while(spans != NULL) {
+ span = spans->head;
/* Check that this is the only span and it spans the entire dimension */
- if(span->next!=NULL) {
- large_contiguous=FALSE;
+ if(span->next != NULL) {
+ large_contiguous = FALSE;
break;
} /* end if */
else {
/* If this span doesn't cover the entire dimension, then this selection isn't contiguous */
- if(((span->high-span->low)+1)!=space->extent.size[u]) {
- large_contiguous=FALSE;
+ if(((span->high - span->low) + 1) != space->extent.size[u]) {
+ large_contiguous = FALSE;
break;
} /* end if */
else {
/* Walk down to the next span */
- spans=span->down;
+ spans = span->down;
/* Increment dimension */
u++;
@@ -3371,34 +3380,34 @@ H5S_hyper_is_contiguous(const H5S_t *space)
} /* end else */
/* If we didn't find a large contiguous block, check for a small one */
- if(large_contiguous==FALSE) {
- small_contiguous=TRUE;
+ if(!large_contiguous) {
+ small_contiguous = TRUE;
/* Get information for slowest changing information */
- spans=space->select.sel_info.hslab->span_lst;
- span=spans->head;
+ spans = space->select.sel_info.hslab->span_lst;
+ span = spans->head;
/* Current dimension working on */
- u=0;
+ u = 0;
/* Cycle down the spans until we run out of down spans or find a non-contiguous span */
- while(spans!=NULL) {
- span=spans->head;
+ while(spans != NULL) {
+ span = spans->head;
/* Check that this is the only span and it spans the entire dimension */
- if(span->next!=NULL) {
- small_contiguous=FALSE;
+ if(span->next != NULL) {
+ small_contiguous = FALSE;
break;
} /* end if */
else {
/* If this span doesn't cover the entire dimension, then this selection isn't contiguous */
- if(u<(space->extent.rank-1) && ((span->high-span->low)+1)!=1) {
- small_contiguous=FALSE;
+ if(u < (space->extent.rank - 1) && ((span->high-span->low) + 1) != 1) {
+ small_contiguous = FALSE;
break;
} /* end if */
else {
/* Walk down to the next span */
- spans=span->down;
+ spans = span->down;
/* Increment dimension */
u++;
@@ -3409,21 +3418,20 @@ H5S_hyper_is_contiguous(const H5S_t *space)
/* Indicate true if it's either a large or small contiguous block */
if(large_contiguous || small_contiguous)
- ret_value=TRUE;
+ ret_value = TRUE;
} /* end else */
-done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_is_contiguous() */
+} /* end H5S__hyper_is_contiguous() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_is_single
+ H5S__hyper_is_single
PURPOSE
Check if a hyperslab selection is a single block within the dataspace extent.
USAGE
- htri_t H5S_hyper_is_single(space)
+ htri_t H5S__hyper_is_single(space)
H5S_t *space; IN: Dataspace pointer to check
RETURNS
TRUE/FALSE/FAIL
@@ -3436,62 +3444,65 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_hyper_is_single(const H5S_t *space)
+H5S__hyper_is_single(const H5S_t *space)
{
- H5S_hyper_span_info_t *spans; /* Hyperslab span info node */
- H5S_hyper_span_t *span; /* Hyperslab span node */
- unsigned u; /* index variable */
- htri_t ret_value=TRUE; /* return value */
+ htri_t ret_value = TRUE; /* return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC_NOERR
HDassert(space);
/* Check for a "single" hyperslab selection */
if(space->select.sel_info.hslab->diminfo_valid) {
+ unsigned u; /* index variable */
+
/*
* For a regular hyperslab to be single, it must have only one
* block (i.e. count==1 in all dimensions)
*/
/* Check for a single block */
- for(u=0; u<space->extent.rank; u++) {
- if(space->select.sel_info.hslab->opt_diminfo[u].count>1)
+ for(u = 0; u < space->extent.rank; u++) {
+ if(space->select.sel_info.hslab->opt_diminfo[u].count > 1)
HGOTO_DONE(FALSE)
} /* end for */
} /* end if */
else {
+ H5S_hyper_span_info_t *spans; /* Hyperslab span info node */
+
/*
* For a region to be single, it must have only one block
*/
/* Get information for slowest changing information */
- spans=space->select.sel_info.hslab->span_lst;
+ spans = space->select.sel_info.hslab->span_lst;
/* Cycle down the spans until we run out of down spans or find a non-contiguous span */
- while(spans!=NULL) {
- span=spans->head;
+ while(spans != NULL) {
+ H5S_hyper_span_t *span; /* Hyperslab span node */
+
+ span = spans->head;
/* Check that this is the only span and it spans the entire dimension */
- if(span->next!=NULL)
+ if(span->next != NULL)
HGOTO_DONE(FALSE)
else
/* Walk down to the next span */
- spans=span->down;
+ spans = span->down;
} /* end while */
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_is_single() */
+} /* end H5S__hyper_is_single() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_is_regular
+ H5S__hyper_is_regular
PURPOSE
Check if a hyperslab selection is "regular"
USAGE
- htri_t H5S_hyper_is_regular(space)
+ htri_t H5S__hyper_is_regular(space)
const H5S_t *space; IN: Dataspace pointer to check
RETURNS
TRUE/FALSE/FAIL
@@ -3506,32 +3517,32 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_hyper_is_regular(const H5S_t *space)
+H5S__hyper_is_regular(const H5S_t *space)
{
htri_t ret_value = FAIL; /* return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
/* Only simple check for regular hyperslabs for now... */
if(space->select.sel_info.hslab->diminfo_valid)
- ret_value=TRUE;
+ ret_value = TRUE;
else
- ret_value=FALSE;
+ ret_value = FALSE;
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_is_regular() */
+} /* end H5S__hyper_is_regular() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_release
+ H5S__hyper_release
PURPOSE
Release hyperslab selection information for a dataspace
USAGE
- herr_t H5S_hyper_release(space)
+ herr_t H5S__hyper_release(space)
H5S_t *space; IN: Pointer to dataspace
RETURNS
Non-negative on success/Negative on failure
@@ -3544,15 +3555,15 @@ H5S_hyper_is_regular(const H5S_t *space)
* Robb Matzke, 1998-08-25
* The fields which are freed are set to NULL to prevent them from being
* freed again later. This fixes some allocation problems where
- * changing the hyperslab selection of one data space causes a core dump
- * when closing some other data space.
+ * changing the hyperslab selection of one dataspace causes a core dump
+ * when closing some other dataspace.
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_release(H5S_t *space)
+H5S__hyper_release(H5S_t *space)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space));
@@ -3562,10 +3573,9 @@ H5S_hyper_release(H5S_t *space)
/* Release irregular hyperslab information */
if(space->select.sel_info.hslab) {
- if(space->select.sel_info.hslab->span_lst != NULL) {
- if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst) < 0)
+ if(space->select.sel_info.hslab->span_lst != NULL)
+ if(H5S__hyper_free_span_info(space->select.sel_info.hslab->span_lst) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
- } /* end if */
/* Release space for the hyperslab selection information */
space->select.sel_info.hslab = H5FL_FREE(H5S_hyper_sel_t, space->select.sel_info.hslab);
@@ -3573,16 +3583,16 @@ H5S_hyper_release(H5S_t *space)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_release() */
+} /* end H5S__hyper_release() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_recover_span
+ H5S__hyper_recover_span
PURPOSE
Recover a generated span, if appropriate
USAGE
- herr_t H5S_hyper_recover_span(recover, curr_span, next_span)
+ herr_t H5S__hyper_recover_span(recover, curr_span, next_span)
unsigned *recover; IN/OUT: Pointer recover flag
H5S_hyper_span_t **curr_span; IN/OUT: Pointer to current span in list
H5S_hyper_span_t *next_span; IN: Pointer to next span
@@ -3597,33 +3607,33 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyper_span_t *next_span)
+H5S__hyper_recover_span(hbool_t *recover, H5S_hyper_span_t **curr_span, H5S_hyper_span_t *next_span)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(recover);
HDassert(curr_span);
/* Check if the span should be recovered */
if(*recover) {
- H5S_hyper_free_span(*curr_span);
- *recover=0;
+ H5S__hyper_free_span(*curr_span);
+ *recover = FALSE;
} /* end if */
/* Set the current span to next span */
- *curr_span=next_span;
+ *curr_span = next_span;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_recover_span() */
+} /* H5S__hyper_recover_span() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_coord_to_span
+ H5S__hyper_coord_to_span
PURPOSE
Create a span tree for a single element
USAGE
- H5S_hyper_span_t *H5S_hyper_coord_to_span(rank, coords)
+ H5S_hyper_span_t *H5S__hyper_coord_to_span(rank, coords)
unsigned rank; IN: Number of dimensions of coordinate
hsize_t *coords; IN: Location of element
RETURNS
@@ -3636,54 +3646,47 @@ H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyp
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_t *
-H5S_hyper_coord_to_span(unsigned rank, hsize_t *coords)
+H5S__hyper_coord_to_span(unsigned rank, const hsize_t *coords)
{
H5S_hyper_span_t *new_span; /* Pointer to new span tree for coordinate */
- H5S_hyper_span_info_t *down=NULL; /* Pointer to new span tree for next level down */
- H5S_hyper_span_t *ret_value=NULL; /* Return value */
+ H5S_hyper_span_info_t *down = NULL; /* Pointer to new span tree for next level down */
+ H5S_hyper_span_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(rank > 0);
HDassert(coords);
/* Search for location to insert new element in tree */
- if(rank>1) {
+ if(rank > 1) {
/* Allocate a span info node */
- if((down = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
+ if(NULL == (down = H5FL_CALLOC(H5S_hyper_span_info_t)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
- /* Set the reference count */
- down->count=0;
-
- /* Reset the scratch pad space */
- down->scratch=0;
/* Build span tree for coordinates below this one */
- if((down->head=H5S_hyper_coord_to_span(rank-1,&coords[1]))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
+ if(NULL == (down->head = H5S__hyper_coord_to_span(rank - 1, &coords[1])))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
} /* end if */
/* Build span for this coordinate */
- if((new_span = H5S_hyper_new_span(coords[0],coords[0],down,NULL))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
+ if(NULL == (new_span = H5S__hyper_new_span(coords[0], coords[0], down, NULL)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
/* Set return value */
- ret_value=new_span;
+ ret_value = new_span;
done:
- if(ret_value==NULL) {
- if(down!=NULL)
- H5S_hyper_free_span_info(down);
- } /* end if */
+ if(ret_value == NULL && down != NULL)
+ H5S__hyper_free_span_info(down);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_coord_to_span() */
+} /* end H5S__hyper_coord_to_span() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_add_span_element_helper
+ H5S__hyper_add_span_element_helper
PURPOSE
Add a single elment to a span tree
USAGE
@@ -3702,17 +3705,19 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned rank, hsize_t *coords)
+H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree,
+ unsigned rank, const hsize_t *coords)
{
H5S_hyper_span_info_t *tspan_info; /* Temporary pointer to span info */
H5S_hyper_span_info_t *prev_span_info; /* Pointer to span info for level above current position */
H5S_hyper_span_t *tmp_span; /* Temporary pointer to a span */
H5S_hyper_span_t *tmp2_span; /* Another temporary pointer to a span */
H5S_hyper_span_t *new_span; /* New span created for element */
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
+ /* Sanity check */
HDassert(span_tree);
HDassert(rank > 0);
HDassert(coords);
@@ -3760,11 +3765,11 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
*/
tmp2_span=tspan_info->head;
while(tmp2_span!=tmp_span) {
- if(H5S_hyper_cmp_spans(tmp2_span->down,tmp_span->down)==TRUE) {
+ if(H5S__hyper_cmp_spans(tmp2_span->down,tmp_span->down)==TRUE) {
/* Check for merging into previous span */
if(tmp2_span->high+1==tmp_span->low) {
/* Release last span created */
- H5S_hyper_free_span(tmp_span);
+ H5S__hyper_free_span(tmp_span);
/* Increase size of previous span */
tmp2_span->high++;
@@ -3776,7 +3781,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
/* Span is disjoint, but has the same "down tree" selection */
else {
/* Release "down tree" information */
- H5S_hyper_free_span_info(tmp_span->down);
+ H5S__hyper_free_span_info(tmp_span->down);
/* Point at earlier span's "down tree" */
tmp_span->down=tmp2_span->down;
@@ -3794,7 +3799,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
} /* end while */
/* Make span tree for current coordinates */
- if((new_span=H5S_hyper_coord_to_span(rank,coords))==NULL)
+ if(NULL == (new_span = H5S__hyper_coord_to_span(rank, coords)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Add new span tree as span */
@@ -3827,11 +3832,11 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
tmp2_span=prev_span_info->head;
tmp_span=(H5S_hyper_span_t *)prev_span_info->scratch;
while(tmp2_span!=tmp_span) {
- if(H5S_hyper_cmp_spans(tmp2_span->down,tmp_span->down)==TRUE) {
+ if(H5S__hyper_cmp_spans(tmp2_span->down,tmp_span->down)==TRUE) {
/* Check for merging into previous span */
if(tmp2_span->high+1==tmp_span->low) {
/* Release last span created */
- H5S_hyper_free_span(tmp_span);
+ H5S__hyper_free_span(tmp_span);
/* Increase size of previous span */
tmp2_span->high++;
@@ -3844,7 +3849,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
/* Span is disjoint, but has the same "down tree" selection */
else {
/* Release "down tree" information */
- H5S_hyper_free_span_info(tmp_span->down);
+ H5S__hyper_free_span_info(tmp_span->down);
/* Point at earlier span's "down tree" */
tmp_span->down=tmp2_span->down;
@@ -3863,7 +3868,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
} /* end if */
} /* end if */
else {
- if((new_span = H5S_hyper_new_span(coords[0],coords[0],NULL,NULL))==NULL)
+ if(NULL == (new_span = H5S__hyper_new_span(coords[0], coords[0], NULL, NULL)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Add new span tree as span */
@@ -3874,13 +3879,13 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran
tspan_info->scratch=(H5S_hyper_span_info_t *)new_span;
/* Set the proper 'pstride' for new span */
- new_span->pstride=new_span->low-tmp_span->low;
+ new_span->pstride = new_span->low - tmp_span->low;
} /* end else */
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_add_span_element_helper() */
+} /* end H5S__hyper_add_span_element_helper() */
/*--------------------------------------------------------------------------
@@ -3904,36 +3909,34 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_hyper_add_span_element(H5S_t *space, unsigned rank, hsize_t *coords)
+H5S_hyper_add_span_element(H5S_t *space, unsigned rank, const hsize_t *coords)
{
H5S_hyper_span_info_t *head = NULL; /* Pointer to new head of span tree */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(space);
HDassert(rank > 0);
HDassert(coords);
+ HDassert(space->extent.rank == rank);
/* Check if this is the first element in the selection */
if(NULL == space->select.sel_info.hslab) {
/* Allocate a span info node */
- if(NULL == (head = H5FL_MALLOC(H5S_hyper_span_info_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
+ if(NULL == (head = H5FL_CALLOC(H5S_hyper_span_info_t)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab span info")
/* Set the reference count */
head->count = 1;
- /* Reset the scratch pad space */
- head->scratch = 0;
-
/* Build span tree for this coordinate */
- if(NULL == (head->head = H5S_hyper_coord_to_span(rank, coords)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
+ if(NULL == (head->head = H5S__hyper_coord_to_span(rank, coords)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab spans for coordinate")
/* Allocate selection info */
if(NULL == (space->select.sel_info.hslab = H5FL_MALLOC(H5S_hyper_sel_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab selection")
/* Set the selection to the new span tree */
space->select.sel_info.hslab->span_lst = head;
@@ -3951,8 +3954,8 @@ H5S_hyper_add_span_element(H5S_t *space, unsigned rank, hsize_t *coords)
space->select.num_elem = 1;
} /* end if */
else {
- if(H5S_hyper_add_span_element_helper(space->select.sel_info.hslab->span_lst, rank, coords) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
+ if(H5S__hyper_add_span_element_helper(space->select.sel_info.hslab->span_lst, rank, coords) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert coordinate into span tree")
/* Increment # of elements in selection */
space->select.num_elem++;
@@ -3961,10 +3964,10 @@ H5S_hyper_add_span_element(H5S_t *space, unsigned rank, hsize_t *coords)
done:
if(ret_value < 0)
if(head)
- H5S_hyper_free_span_info(head);
+ H5S__hyper_free_span_info(head);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_add_span_element() */
+} /* end H5S_hyper_add_span_element() */
/*--------------------------------------------------------------------------
@@ -3988,17 +3991,20 @@ done:
herr_t
H5S_hyper_reset_scratch(H5S_t *space)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(space);
/* Check if there are spans in the span tree */
if(space->select.sel_info.hslab->span_lst != NULL)
/* Reset the scratch pointers for the next routine which needs them */
- H5S_hyper_span_scratch(space->select.sel_info.hslab->span_lst, NULL);
+ H5S__hyper_span_scratch(space->select.sel_info.hslab->span_lst);
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_reset_scratch() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_hyper_reset_scratch() */
/*--------------------------------------------------------------------------
@@ -4024,9 +4030,9 @@ H5S_hyper_reset_scratch(H5S_t *space)
herr_t
H5S_hyper_convert(H5S_t *space)
{
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(FAIL)
HDassert(space);
@@ -4035,23 +4041,19 @@ H5S_hyper_convert(H5S_t *space)
case H5S_SEL_ALL: /* All elements selected in dataspace */
/* Convert current "all" selection to "real" hyperslab selection */
{
- hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
- hsize_t tmp_stride[H5O_LAYOUT_NDIMS]; /* Temporary stride information */
- hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary count information */
- hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
- unsigned u; /* Local index variable */
-
- /* Fill in temporary information for the dimensions */
- for(u=0; u<space->extent.rank; u++) {
- tmp_start[u]=0;
- tmp_stride[u]=1;
- tmp_count[u]=1;
- tmp_block[u]=space->extent.size[u];
- } /* end for */
+ const hsize_t *tmp_start; /* Temporary start information */
+ const hsize_t *tmp_stride; /* Temporary stride information */
+ const hsize_t *tmp_count; /* Temporary count information */
+ const hsize_t *tmp_block; /* Temporary block information */
+
+ /* Set up temporary information for the dimensions */
+ tmp_start = H5S_hyper_zeros_g;
+ tmp_stride = tmp_count = H5S_hyper_ones_g;
+ tmp_block = space->extent.size;
/* Convert to hyperslab selection */
if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't convert selection")
} /* end case */
break;
@@ -4068,7 +4070,7 @@ H5S_hyper_convert(H5S_t *space)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_convert() */
+} /* end H5S_hyper_convert() */
#ifdef LATER
@@ -4192,7 +4194,7 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_intersect_block_helper
+ H5S__hyper_intersect_block_helper
PURPOSE
Helper routine to detect intersections in span trees
USAGE
@@ -4210,14 +4212,14 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static htri_t
-H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t *end)
+static hbool_t
+H5S__hyper_intersect_block_helper(const H5S_hyper_span_info_t *spans,
+ const hsize_t *start, const hsize_t *end)
{
- H5S_hyper_span_t *curr; /* Pointer to current span in 1st span tree */
- htri_t status; /* Status from recursive call */
- htri_t ret_value=FALSE; /* Return value */
+ H5S_hyper_span_t *curr; /* Pointer to current span in 1st span tree */
+ hbool_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(spans);
@@ -4225,39 +4227,42 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s
HDassert(end);
/* Get the span list for spans in this tree */
- curr=spans->head;
+ curr = spans->head;
/* Iterate over the spans in the tree */
- while(curr!=NULL) {
+ while(curr != NULL) {
/* Check for span entirely before block */
if(curr->high < *start)
/* Advance to next span in this dimension */
- curr=curr->next;
+ curr = curr->next;
/* If this span is past the end of the block, then we're done in this dimension */
else if(curr->low > *end)
HGOTO_DONE(FALSE)
/* block & span overlap */
else {
- if(curr->down==NULL)
+ if(curr->down == NULL)
HGOTO_DONE(TRUE)
else {
+ hbool_t status; /* Status from recursive call */
+
/* Recursively check spans in next dimension down */
- if((status=H5S_hyper_intersect_block_helper(curr->down,start+1,end+1))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check")
+ status = H5S__hyper_intersect_block_helper(curr->down, start + 1, end + 1);
/* If there is a span intersection in the down dimensions, the span trees overlap */
- if(status==TRUE)
+ if(status == TRUE)
HGOTO_DONE(TRUE);
/* No intersection in down dimensions, advance to next span */
- curr=curr->next;
+ curr = curr->next;
} /* end else */
} /* end else */
} /* end while */
+ /* Fall through with 'FALSE' return value */
+
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_intersect_block_helper() */
+} /* end H5S__hyper_intersect_block_helper() */
/*--------------------------------------------------------------------------
@@ -4280,11 +4285,11 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
-H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end)
+H5S_hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end)
{
- htri_t ret_value=FAIL; /* Return value */
+ htri_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(space);
@@ -4293,34 +4298,33 @@ H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end)
/* Check for 'all' selection, instead of a hyperslab selection */
/* (Technically, this shouldn't be in the "hyperslab" routines...) */
- if(H5S_GET_SELECT_TYPE(space)==H5S_SEL_ALL)
+ if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL)
HGOTO_DONE(TRUE);
/* Check that the space selection has a span tree */
- if(space->select.sel_info.hslab->span_lst==NULL)
- if(H5S_hyper_generate_spans(space)<0)
+ if(NULL == space->select.sel_info.hslab->span_lst)
+ if(H5S__hyper_generate_spans(space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Perform the span-by-span intersection check */
- if((ret_value=H5S_hyper_intersect_block_helper(space->select.sel_info.hslab->span_lst,start,end))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab intersection check")
+ ret_value = H5S__hyper_intersect_block_helper(space->select.sel_info.hslab->span_lst, start, end);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_intersect_block() */
+} /* end H5S_hyper_intersect_block() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_adjust_helper_u
+ H5S__hyper_adjust_u_helper
PURPOSE
Helper routine to adjust offsets in span trees
USAGE
- herr_t H5S_hyper_adjust_helper_u(spans, offset)
+ void H5S__hyper_adjust_u_helper(spans, offset)
H5S_hyper_span_info_t *spans; IN: Span tree to operate with
- const hsize_t *offset; IN: Offset to subtract
+ const hsize_t *offset; IN: Offset to subtract
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Adjust the location of the spans in a span tree by subtracting an offset
GLOBAL VARIABLES
@@ -4328,56 +4332,57 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static herr_t
-H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset)
+static void
+H5S__hyper_adjust_u_helper(H5S_hyper_span_info_t *spans,
+ const hsize_t *offset)
{
- H5S_hyper_span_t *span; /* Pointer to current span in span tree */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- /* Sanity check */
+ /* Sanity checks */
HDassert(spans);
+ HDassert(spans->scratch == (H5S_hyper_span_info_t *)~((size_t)NULL) ||
+ spans->scratch == NULL);
HDassert(offset);
/* Check if we've already set this down span tree */
- if(spans->scratch!=(H5S_hyper_span_info_t *)~((size_t)NULL)) {
- /* Set the tree's scratch pointer */
- spans->scratch=(H5S_hyper_span_info_t *)~((size_t)NULL);
+ if(spans->scratch != (H5S_hyper_span_info_t *)~((size_t)NULL)) {
+ H5S_hyper_span_t *span; /* Pointer to current span in span tree */
- /* Get the span lists for each span in this tree */
- span=spans->head;
+ /* Set the tree's scratch pointer */
+ spans->scratch = (H5S_hyper_span_info_t *)~((size_t)NULL);
/* Iterate over the spans in tree */
- while(span!=NULL) {
+ span = spans->head;
+ while(span != NULL) {
/* Adjust span offset */
- HDassert(span->low>=*offset);
- span->low-=*offset;
- span->high-=*offset;
+ HDassert(span->low >= *offset);
+ span->low -= *offset;
+ span->high -= *offset;
/* Recursively adjust spans in next dimension down */
- if(span->down!=NULL)
- H5S_hyper_adjust_helper_u(span->down,offset+1);
+ if(span->down != NULL)
+ H5S__hyper_adjust_u_helper(span->down, offset + 1);
/* Advance to next span in this dimension */
- span=span->next;
+ span = span->next;
} /* end while */
} /* end if */
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_adjust_helper_u() */
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5S__hyper_adjust_u_helper() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_adjust_u
+ H5S__hyper_adjust_u
PURPOSE
Adjust a hyperslab selection by subtracting an offset
USAGE
- herr_t H5S_hyper_adjust_u(space,offset)
+ void H5S__hyper_adjust_u(space,offset)
H5S_t *space; IN/OUT: Pointer to dataspace to adjust
const hsize_t *offset; IN: Offset to subtract
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Moves a hyperslab selection by subtracting an offset from it.
GLOBAL VARIABLES
@@ -4385,41 +4390,39 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static herr_t
-H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset)
+static void
+H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset)
{
- unsigned u; /* Local index variable */
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
+ /* Sanity check */
HDassert(space);
HDassert(offset);
/* Subtract the offset from the "regular" coordinates, if they exist */
if(space->select.sel_info.hslab->diminfo_valid) {
- for(u=0; u<space->extent.rank; u++) {
- HDassert(space->select.sel_info.hslab->opt_diminfo[u].start>=offset[u]);
- space->select.sel_info.hslab->opt_diminfo[u].start-=offset[u];
+ unsigned u; /* Local index variable */
+
+ for(u = 0; u < space->extent.rank; u++) {
+ HDassert(space->select.sel_info.hslab->opt_diminfo[u].start >= offset[u]);
+ space->select.sel_info.hslab->opt_diminfo[u].start -= offset[u];
} /* end for */
} /* end if */
/* Subtract the offset from the span tree coordinates, if they exist */
if(space->select.sel_info.hslab->span_lst) {
- if(H5S_hyper_adjust_helper_u(space->select.sel_info.hslab->span_lst,offset)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment")
+ H5S__hyper_adjust_u_helper(space->select.sel_info.hslab->span_lst, offset);
/* Reset the scratch pointers for the next routine which needs them */
- H5S_hyper_span_scratch(space->select.sel_info.hslab->span_lst, NULL);
+ H5S__hyper_span_scratch(space->select.sel_info.hslab->span_lst);
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_adjust_u() */
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5S__hyper_adjust_u() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_project_scalar
+ * Function: H5S__hyper_project_scalar
*
* Purpose: Projects a single element hyperslab selection into a scalar
* dataspace
@@ -4432,12 +4435,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset)
+H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset)
{
- hsize_t block[H5S_MAX_RANK]; /* Block selected in base dataspace */
- herr_t ret_value = SUCCEED; /* Return value */
+ hsize_t block[H5S_MAX_RANK]; /* Block selected in base dataspace */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space));
@@ -4450,11 +4452,8 @@ H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset)
/* Build the table of the initial offset */
for(u = 0; u < space->extent.rank; u++) {
+ /* Keep the offset for later */
block[u] = diminfo[u].start;
-
- /* Check for more than one hyperslab */
- if(diminfo[u].count > 1 || diminfo[u].block > 1)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "hyperslab selection of one element has more than one node!")
} /* end for */
} /* end if */
else {
@@ -4465,9 +4464,9 @@ H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset)
curr = space->select.sel_info.hslab->span_lst->head;
curr_dim = 0;
while(curr) {
- /* Check for more than one span */
- if(curr->next || curr->low != curr->high)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "hyperslab selection of one element has more than one node!")
+ /* Sanity check for more than one span */
+ HDassert(NULL == curr->next);
+ HDassert(curr->low == curr->high);
/* Save the location of the selection in current dimension */
block[curr_dim] = curr->low;
@@ -4479,15 +4478,14 @@ H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset)
} /* end else */
/* Calculate offset of selection in projected buffer */
- *offset = H5VM_array_offset(space->extent.rank, space->extent.size, block);
+ *offset = H5VM_array_offset(space->extent.rank, space->extent.size, block);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_project_scalar() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5S__hyper_project_scalar() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_project_simple_lower
+ * Function: H5S__hyper_project_simple_lower
*
* Purpose: Projects a hyperslab selection onto/into a simple dataspace
* of a lower rank
@@ -4500,12 +4498,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space)
+H5S__hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space)
{
H5S_hyper_span_info_t *down; /* Pointer to list of spans */
unsigned curr_dim; /* Current dimension being operated on */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space));
@@ -4530,11 +4528,11 @@ H5S_hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space)
new_space->select.sel_info.hslab->span_lst->count++;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_project_simple_lower() */
+} /* end H5S__hyper_project_simple_lower() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_project_simple_higher
+ * Function: H5S__hyper_project_simple_higher
*
* Purpose: Projects a hyperslab selection onto/into a simple dataspace
* of a higher rank
@@ -4547,13 +4545,13 @@ H5S_hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space)
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space)
+H5S__hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space)
{
H5S_hyper_span_t *prev_span = NULL; /* Pointer to previous list of spans */
unsigned curr_dim; /* Current dimension being operated on */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space));
@@ -4568,9 +4566,9 @@ H5S_hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space)
H5S_hyper_span_t *new_span; /* Temporary hyperslab span */
/* Allocate a new span_info node */
- if(NULL == (new_span_info = H5FL_MALLOC(H5S_hyper_span_info_t))) {
+ if(NULL == (new_span_info = H5FL_CALLOC(H5S_hyper_span_info_t))) {
if(prev_span)
- if(H5S_hyper_free_span(prev_span) < 0)
+ if(H5S__hyper_free_span(prev_span) < 0)
HERROR(H5E_DATASPACE, H5E_CANTFREE, "can't free hyperslab span");
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab span info")
} /* end if */
@@ -4580,7 +4578,7 @@ H5S_hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space)
prev_span->down = new_span_info;
/* Allocate a new node */
- if(NULL == (new_span = H5S_hyper_new_span(0, 0, NULL, NULL))) {
+ if(NULL == (new_span = H5S__hyper_new_span((hsize_t)0, (hsize_t)0, NULL, NULL))) {
HDassert(new_span_info);
if(!prev_span)
(void)H5FL_FREE(H5S_hyper_span_info_t, new_span_info);
@@ -4589,7 +4587,6 @@ H5S_hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space)
/* Set the span_info information */
new_span_info->count = 1;
- new_span_info->scratch = NULL;
new_span_info->head = new_span;
/* Attach to new space, if top span info */
@@ -4612,19 +4609,18 @@ H5S_hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space)
done:
if(ret_value < 0 && new_space->select.sel_info.hslab->span_lst) {
if(new_space->select.sel_info.hslab->span_lst->head)
- if(H5S_hyper_free_span(
- new_space->select.sel_info.hslab->span_lst->head) < 0)
+ if(H5S__hyper_free_span(new_space->select.sel_info.hslab->span_lst->head) < 0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't free hyperslab span")
new_space->select.sel_info.hslab->span_lst = H5FL_FREE(H5S_hyper_span_info_t, new_space->select.sel_info.hslab->span_lst);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_project_simple_higher() */
+} /* end H5S__hyper_project_simple_higher() */
/*-------------------------------------------------------------------------
- * Function: H5S_hyper_project_simple
+ * Function: H5S__hyper_project_simple
*
* Purpose: Projects a hyperslab selection onto/into a simple dataspace
* of a different rank
@@ -4637,11 +4633,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offset)
+H5S__hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offset)
{
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space));
@@ -4654,7 +4650,7 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
/* Allocate space for the hyperslab selection information */
if(NULL == (new_space->select.sel_info.hslab = H5FL_MALLOC(H5S_hyper_sel_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab info")
/* Set unlim_dim */
new_space->select.sel_info.hslab->unlim_dim = -1;
@@ -4674,7 +4670,7 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
HDmemset(block, 0, sizeof(block));
for(u = 0; u < (base_space->extent.rank - new_space->extent.rank); u++)
block[u] = opt_diminfo[u].start;
- *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block);
+ *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block);
/* Set the correct dimensions for the base & new spaces */
base_space_dim = base_space->extent.rank - new_space->extent.rank;
@@ -4757,10 +4753,10 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
} /* end while */
/* Compute the offset for the down-projection */
- *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block);
+ *offset = H5VM_array_offset(base_space->extent.rank, base_space->extent.size, block);
/* Project the base space's selection down in less dimensions */
- if(H5S_hyper_project_simple_lower(base_space, new_space) < 0)
+ if(H5S__hyper_project_simple_lower(base_space, new_space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't project hyperslab selection into less dimensions")
} /* end if */
else {
@@ -4769,8 +4765,8 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
/* The offset is zero when projected into higher dimensions */
*offset = 0;
- /* Project the base space's selection down in less dimensions */
- if(H5S_hyper_project_simple_higher(base_space, new_space) < 0)
+ /* Project the base space's selection down in more dimensions */
+ if(H5S__hyper_project_simple_higher(base_space, new_space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't project hyperslab selection into less dimensions")
} /* end else */
@@ -4786,20 +4782,20 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_project_simple() */
+} /* end H5S__hyper_project_simple() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_adjust_helper_s
+ H5S__hyper_adjust_s_helper
PURPOSE
Helper routine to adjust offsets in span trees
USAGE
- herr_t H5S_hyper_adjust_helper_s(spans, offset)
+ void H5S__hyper_adjust_s_helper(spans, offset)
H5S_hyper_span_info_t *spans; IN: Span tree to operate with
const hssize_t *offset; IN: Offset to subtract
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Adjust the location of the spans in a span tree by subtracting an offset
GLOBAL VARIABLES
@@ -4807,26 +4803,27 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static herr_t
-H5S_hyper_adjust_helper_s(H5S_hyper_span_info_t *spans, const hssize_t *offset)
+static void
+H5S__hyper_adjust_s_helper(H5S_hyper_span_info_t *spans,
+ const hssize_t *offset)
{
- H5S_hyper_span_t *span; /* Pointer to current span in span tree */
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- /* Sanity check */
+ /* Sanity checks */
HDassert(spans);
+ HDassert(spans->scratch == (H5S_hyper_span_info_t *)~((size_t)NULL) ||
+ spans->scratch == NULL);
HDassert(offset);
/* Check if we've already set this down span tree */
if(spans->scratch != (H5S_hyper_span_info_t *)~((size_t)NULL)) {
+ H5S_hyper_span_t *span; /* Pointer to current span in span tree */
+
/* Set the tree's scratch pointer */
spans->scratch = (H5S_hyper_span_info_t *)~((size_t)NULL);
- /* Get the span lists for each span in this tree */
- span = spans->head;
-
/* Iterate over the spans in tree */
+ span = spans->head;
while(span != NULL) {
/* Adjust span offset */
HDassert((hssize_t)span->low >= *offset);
@@ -4835,15 +4832,15 @@ H5S_hyper_adjust_helper_s(H5S_hyper_span_info_t *spans, const hssize_t *offset)
/* Recursively adjust spans in next dimension down */
if(span->down != NULL)
- H5S_hyper_adjust_helper_s(span->down, offset + 1);
+ H5S__hyper_adjust_s_helper(span->down, offset + 1);
/* Advance to next span in this dimension */
span = span->next;
} /* end while */
} /* end if */
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_adjust_helper_s() */
+ FUNC_LEAVE_NOAPI_VOID
+} /* end H5S__hyper_adjust_s_helper() */
/*--------------------------------------------------------------------------
@@ -4867,16 +4864,18 @@ H5S_hyper_adjust_helper_s(H5S_hyper_span_info_t *spans, const hssize_t *offset)
herr_t
H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset)
{
- unsigned u; /* Local index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(space);
HDassert(offset);
/* Subtract the offset from the "regular" coordinates, if they exist */
if(space->select.sel_info.hslab->diminfo_valid) {
+ unsigned u; /* Local index variable */
+
for(u = 0; u < space->extent.rank; u++) {
HDassert((hssize_t)space->select.sel_info.hslab->opt_diminfo[u].start >= offset[u]);
space->select.sel_info.hslab->opt_diminfo[u].start = (hsize_t)((hssize_t)space->select.sel_info.hslab->opt_diminfo[u].start - offset[u]);
@@ -4885,16 +4884,15 @@ H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset)
/* Subtract the offset from the span tree coordinates, if they exist */
if(space->select.sel_info.hslab->span_lst) {
- if(H5S_hyper_adjust_helper_s(space->select.sel_info.hslab->span_lst, offset) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment")
+ H5S__hyper_adjust_s_helper(space->select.sel_info.hslab->span_lst, offset);
/* Reset the scratch pointers for the next routine which needs them */
- H5S_hyper_span_scratch(space->select.sel_info.hslab->span_lst, NULL);
+ H5S__hyper_span_scratch(space->select.sel_info.hslab->span_lst);
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_adjust_s() */
+} /* end H5S_hyper_adjust_s() */
/*--------------------------------------------------------------------------
@@ -4904,11 +4902,11 @@ done:
"Normalize" a hyperslab selection by adjusting it's coordinates by the
amount of the selection offset.
USAGE
- herr_t H5S_hyper_normalize_offset(space, old_offset)
+ hbool_t H5S_hyper_normalize_offset(space, old_offset)
H5S_t *space; IN/OUT: Pointer to dataspace to move
hssize_t *old_offset; OUT: Pointer to space to store old offset
RETURNS
- Non-negative on success, negative on failure
+ TRUE if space has been normalized, FALSE if not
DESCRIPTION
Copies the current selection offset into the array provided, then
inverts the selection offset, subtracts the offset from the hyperslab
@@ -4921,24 +4919,27 @@ done:
htri_t
H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset)
{
- unsigned u; /* Local index variable */
- herr_t ret_value = FALSE; /* Return value */
+ htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(space);
+ HDassert(old_offset);
/* Check for hyperslab selection & offset changed */
if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS && space->select.offset_changed) {
+ unsigned u; /* Local index variable */
+
/* Copy & invert the selection offset */
- for(u = 0; u<space->extent.rank; u++) {
+ for(u = 0; u < space->extent.rank; u++) {
old_offset[u] = space->select.offset[u];
space->select.offset[u] = -space->select.offset[u];
} /* end for */
- /* Call the existing 'adjust' routine */
+ /* Call the 'adjust' routine */
if(H5S_hyper_adjust_s(space, space->select.offset) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't adjust selection")
/* Zero out the selection offset */
HDmemset(space->select.offset, 0, sizeof(hssize_t) * space->extent.rank);
@@ -4949,7 +4950,7 @@ H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_normalize_offset() */
+} /* end H5S_hyper_normalize_offset() */
/*--------------------------------------------------------------------------
@@ -4959,7 +4960,7 @@ done:
"Denormalize" a hyperslab selection by reverse adjusting it's coordinates
by the amount of the former selection offset.
USAGE
- herr_t H5S_hyper_normalize_offset(space, old_offset)
+ herr_t H5S_hyper_denormalize_offset(space, old_offset)
H5S_t *space; IN/OUT: Pointer to dataspace to move
hssize_t *old_offset; IN: Pointer to old offset array
RETURNS
@@ -4976,32 +4977,33 @@ done:
herr_t
H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity checks */
HDassert(space);
HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS);
- /* Call the existing 'adjust' routine */
+ /* Call the 'adjust' routine */
if(H5S_hyper_adjust_s(space, old_offset) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "can't adjust selection")
/* Copy the selection offset over */
HDmemcpy(space->select.offset, old_offset, sizeof(hssize_t) * space->extent.rank);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_denormalize_offset() */
+} /* end H5S_hyper_denormalize_offset() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_append_span
+ H5S__hyper_append_span
PURPOSE
Create a new span and append to span list
USAGE
- herr_t H5S_hyper_append_span(prev_span, span_tree, low, high, down, next)
+ herr_t H5S__hyper_append_span(prev_span, span_tree, low, high, down, next)
H5S_hyper_span_t **prev_span; IN/OUT: Pointer to previous span in list
H5S_hyper_span_info_t **span_tree; IN/OUT: Pointer to span tree to append to
hsize_t low, high; IN: Low and high bounds for new span node
@@ -5018,62 +5020,62 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** span_tree, hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
+H5S__hyper_append_span(H5S_hyper_span_t **prev_span,
+ H5S_hyper_span_info_t **span_tree, hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
{
H5S_hyper_span_t *new_span = NULL;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(prev_span);
HDassert(span_tree);
/* Check for adding first node to merged spans */
- if(*prev_span==NULL) {
+ if(*prev_span == NULL) {
/* Allocate new span node to append to list */
- if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
+ if(NULL == (new_span = H5S__hyper_new_span(low, high, down, next)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab span")
/* Make first node in span list */
/* Check that we haven't already allocated a span tree */
- HDassert(*span_tree==NULL);
+ HDassert(*span_tree == NULL);
/* Allocate a new span_info node */
- if((*span_tree = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
+ if(NULL == (*span_tree = H5FL_CALLOC(H5S_hyper_span_info_t)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab span")
/* Set the span tree's basic information */
- (*span_tree)->count=1;
- (*span_tree)->scratch=NULL;
- (*span_tree)->head=new_span;
+ (*span_tree)->count = 1;
+ (*span_tree)->head = new_span;
/* Update previous merged span */
- *prev_span=new_span;
+ *prev_span = new_span;
} /* end if */
/* Merge or append to existing merged spans list */
else {
/* Check if span can just extend the previous merged span */
- if((((*prev_span)->high+1)==low) &&
- H5S_hyper_cmp_spans(down,(*prev_span)->down)==TRUE) {
+ if((((*prev_span)->high + 1) == low) &&
+ H5S__hyper_cmp_spans(down, (*prev_span)->down)==TRUE) {
/* Extend previous merged span to include new high bound */
- (*prev_span)->high=high;
- (*prev_span)->nelem+=(high-low)+1;
+ (*prev_span)->high = high;
+ (*prev_span)->nelem += (high - low) + 1;
} /* end if */
else {
/* Allocate new span node to append to list */
- if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL)
+ if(NULL == (new_span = H5S__hyper_new_span(low, high, down, next)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Check if there is actually a down span */
if(new_span->down) {
/* Check if the down spans for the new span node are the same as the previous span node */
- if(H5S_hyper_cmp_spans(new_span->down,(*prev_span)->down)==TRUE) {
+ if(H5S__hyper_cmp_spans(new_span->down, (*prev_span)->down)) {
/* Release the down span for the new node */
- H5S_hyper_free_span_info(new_span->down);
+ H5S__hyper_free_span_info(new_span->down);
/* Point the new node's down span at the previous node's down span */
- new_span->down=(*prev_span)->down;
+ new_span->down = (*prev_span)->down;
/* Increment the reference count to the shared down span */
new_span->down->count++;
@@ -5081,32 +5083,30 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp
} /* end if */
/* Indicate elements from previous span */
- new_span->pstride=low-(*prev_span)->low;
+ new_span->pstride = low - (*prev_span)->low;
/* Append to end of merged spans list */
- (*prev_span)->next=new_span;
- *prev_span=new_span;
+ (*prev_span)->next = new_span;
+ *prev_span = new_span;
} /* end else */
} /* end else */
done:
- if(ret_value < 0) {
- if(new_span)
- if(H5S_hyper_free_span(new_span) < 0)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "failed to release new hyperslab span")
- } /* end if */
+ if(ret_value < 0)
+ if(new_span && H5S__hyper_free_span(new_span) < 0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "failed to release new hyperslab span")
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_append_span() */
+} /* end H5S__hyper_append_span() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_clip_spans
+ H5S__hyper_clip_spans
PURPOSE
Clip a new span tree against the current spans in the hyperslab selection
USAGE
- herr_t H5S_hyper_clip_spans(span_a, span_b, a_not_b, a_and_b, b_not_a)
+ herr_t H5S__hyper_clip_spans(span_a, span_b, a_not_b, a_and_b, b_not_a)
H5S_hyper_span_t *a_spans; IN: Span tree 'a' to clip with.
H5S_hyper_span_t *b_spans; IN: Span tree 'b' to clip with.
H5S_hyper_span_t **a_not_b; OUT: Span tree of 'a' hyperslab spans which
@@ -5131,7 +5131,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_spans,
+H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_spans,
H5S_hyper_span_info_t **a_not_b, H5S_hyper_span_info_t **a_and_b,
H5S_hyper_span_info_t **b_not_a)
{
@@ -5144,10 +5144,10 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
H5S_hyper_span_info_t *down_a_not_b; /* Temporary pointer to a_not_b span tree of down spans for overlapping nodes */
H5S_hyper_span_info_t *down_a_and_b; /* Temporary pointer to a_and_b span tree of down spans for overlapping nodes */
H5S_hyper_span_info_t *down_b_not_a; /* Temporary pointer to b_and_a span tree of down spans for overlapping nodes */
- unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */
- herr_t ret_value=SUCCEED; /* Return value */
+ hbool_t recover_a, recover_b; /* Flags to indicate when to recover temporary spans */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(a_spans);
@@ -5157,74 +5157,72 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
HDassert(b_not_a);
/* Check if both span trees are not defined */
- if(a_spans==NULL && b_spans==NULL) {
- *a_not_b=NULL;
- *a_and_b=NULL;
- *b_not_a=NULL;
+ if(a_spans == NULL && b_spans == NULL) {
+ *a_not_b = NULL;
+ *a_and_b = NULL;
+ *b_not_a = NULL;
} /* end if */
/* If span 'a' is not defined, but 'b' is, copy 'b' and set the other return span trees to empty */
- else if(a_spans==NULL) {
- *a_not_b=NULL;
- *a_and_b=NULL;
- if((*b_not_a=H5S_hyper_copy_span(b_spans))==NULL)
+ else if(a_spans == NULL) {
+ *a_not_b = NULL;
+ *a_and_b = NULL;
+ if(NULL == (*b_not_a = H5S__hyper_copy_span(b_spans)))
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree")
} /* end if */
/* If span 'b' is not defined, but 'a' is, copy 'a' and set the other return span trees to empty */
- else if(b_spans==NULL) {
- if((*a_not_b=H5S_hyper_copy_span(a_spans))==NULL)
+ else if(b_spans == NULL) {
+ if(NULL == (*a_not_b = H5S__hyper_copy_span(a_spans)) )
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree")
- *a_and_b=NULL;
- *b_not_a=NULL;
+ *a_and_b = NULL;
+ *b_not_a = NULL;
} /* end if */
/* If span 'a' and 'b' are both defined, calculate the proper span trees */
else {
/* Check if both span trees completely overlap */
- if(H5S_hyper_cmp_spans(a_spans,b_spans)==TRUE) {
- *a_not_b=NULL;
- if((*a_and_b=H5S_hyper_copy_span(a_spans))==NULL)
+ if(H5S__hyper_cmp_spans(a_spans, b_spans)) {
+ *a_not_b = NULL;
+ if(NULL == (*a_and_b = H5S__hyper_copy_span(a_spans)))
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, FAIL, "can't copy hyperslab span tree")
- *b_not_a=NULL;
+ *b_not_a = NULL;
} /* end if */
else {
/* Get the pointers to the new and old span lists */
- span_a=a_spans->head;
- span_b=b_spans->head;
+ span_a = a_spans->head;
+ span_b = b_spans->head;
- /* Set the pointer to the previous spans */
- last_a_not_b=NULL;
- last_a_and_b=NULL;
- last_b_not_a=NULL;
+ /* Reset the pointers to the previous spans */
+ last_a_not_b = last_a_and_b = last_b_not_a = NULL;
/* No spans to recover yet */
- recover_a=recover_b=0;
+ recover_a = recover_b = FALSE;
/* Work through the list of spans in the new list */
- while(span_a!=NULL && span_b!=NULL) {
+ while(span_a != NULL && span_b != NULL) {
/* Check if span 'a' is completely before span 'b' */
/* AAAAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- if(span_a->high<span_b->low) {
+ if(span_a->high < span_b->low) {
/* Copy span 'a' and add to a_not_b list */
/* Merge/add span 'a' with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
+ if(H5S__hyper_append_span(&last_a_not_b, a_not_b, span_a->low, span_a->high, span_a->down, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Advance span 'a', leave span 'b' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a, &span_a, span_a->next);
} /* end if */
/* Check if span 'a' overlaps only the lower bound */
/* of span 'b' , up to the upper bound of span 'b' */
/* AAAAAAAAAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- else if(span_a->low<span_b->low && (span_a->high>=span_b->low && span_a->high<=span_b->high)) {
+ else if(span_a->low < span_b->low && (span_a->high >= span_b->low && span_a->high <= span_b->high)) {
/* Split span 'a' into two parts at the low bound of span 'b' */
/* Merge/add lower part of span 'a' with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
+ if(H5S__hyper_append_span(&last_a_not_b, a_not_b, span_a->low, span_b->low - 1, span_a->down, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Check for overlaps between upper part of span 'a' and lower part of span 'b' */
@@ -5232,50 +5230,50 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
- if(span_a->down==NULL) {
+ if(span_a->down == NULL) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,NULL,NULL)==FAIL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
+ if(H5S__hyper_append_span(&last_a_and_b, a_and_b, span_b->low, span_a->high, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
/* NULL out the temporary pointers to clipped areas in down spans */
- down_a_not_b=NULL;
- down_a_and_b=NULL;
- down_b_not_a=NULL;
+ down_a_not_b = NULL;
+ down_a_and_b = NULL;
+ down_b_not_a = NULL;
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
- if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
+ if(H5S__hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
- if(down_a_not_b!=NULL) {
+ if(down_a_not_b) {
/* Merge/add overlapped part with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_a->high,down_a_not_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_a->high,down_a_not_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_not_b);
+ H5S__hyper_free_span_info(down_a_not_b);
} /* end if */
/* Check for additions to the a_and_b list */
- if(down_a_and_b!=NULL) {
+ if(down_a_and_b) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,down_a_and_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_a->high,down_a_and_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_and_b);
+ H5S__hyper_free_span_info(down_a_and_b);
} /* end if */
/* Check for additions to the b_not_a list */
- if(down_b_not_a!=NULL) {
+ if(down_b_not_a) {
/* Merge/add overlapped part with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->high,down_b_not_a,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->high,down_b_not_a,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_b_not_a);
+ H5S__hyper_free_span_info(down_b_not_a);
} /* end if */
} /* end else */
@@ -5284,21 +5282,21 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Check if there is actually an upper part of span 'b' to split off */
if(span_a->high<span_b->high) {
/* Allocate new span node for upper part of span 'b' */
- if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
+ if(NULL == (tmp_span = H5S__hyper_new_span(span_a->high + 1, span_b->high, span_b->down, span_b->next)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Advance span 'a' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
/* Make upper part of span 'b' into new span 'b' */
- H5S_hyper_recover_span(&recover_b,&span_b,tmp_span);
- recover_b=1;
+ H5S__hyper_recover_span(&recover_b,&span_b,tmp_span);
+ recover_b = TRUE;
} /* end if */
/* No upper part of span 'b' to split */
else {
/* Advance both 'a' and 'b' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end else */
} /* end if */
/* Check if span 'a' overlaps the lower & upper bound */
@@ -5306,11 +5304,11 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* AAAAAAAAAAAAAAAAAAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- else if(span_a->low<span_b->low && span_a->high>span_b->high) {
+ else if(span_a->low < span_b->low && span_a->high > span_b->high) {
/* Split off lower part of span 'a' at lower span of span 'b' */
/* Merge/add lower part of span 'a' with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Check for overlaps between middle part of span 'a' and span 'b' */
@@ -5319,77 +5317,77 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
- if(span_a->down==NULL) {
+ if(span_a->down == NULL) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,NULL,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,NULL,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
/* NULL out the temporary pointers to clipped areas in down spans */
- down_a_not_b=NULL;
- down_a_and_b=NULL;
- down_b_not_a=NULL;
+ down_a_not_b = NULL;
+ down_a_and_b = NULL;
+ down_b_not_a = NULL;
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
- if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
+ if(H5S__hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
- if(down_a_not_b!=NULL) {
+ if(down_a_not_b) {
/* Merge/add overlapped part with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_b->high,down_a_not_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_not_b,a_not_b,span_b->low,span_b->high,down_a_not_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_not_b);
+ H5S__hyper_free_span_info(down_a_not_b);
} /* end if */
/* Check for additions to the a_and_b list */
- if(down_a_and_b!=NULL) {
+ if(down_a_and_b) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,down_a_and_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_and_b,a_and_b,span_b->low,span_b->high,down_a_and_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_and_b);
+ H5S__hyper_free_span_info(down_a_and_b);
} /* end if */
/* Check for additions to the b_not_a list */
- if(down_b_not_a!=NULL) {
+ if(down_b_not_a) {
/* Merge/add overlapped part with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,down_b_not_a,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,down_b_not_a,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_b_not_a);
+ H5S__hyper_free_span_info(down_b_not_a);
} /* end if */
} /* end else */
/* Split off upper part of span 'a' at upper span of span 'b' */
/* Allocate new span node for upper part of span 'a' */
- if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
+ if(NULL == (tmp_span = H5S__hyper_new_span(span_b->high + 1, span_a->high, span_a->down, span_a->next)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Make upper part of span 'a' the new span 'a' */
- H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
- recover_a=1;
+ H5S__hyper_recover_span(&recover_a,&span_a,tmp_span);
+ recover_a = TRUE;
/* Advance span 'b' */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end if */
/* Check if span 'a' is entirely within span 'b' */
/* AAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- else if(span_a->low>=span_b->low && span_a->high<=span_b->high) {
+ else if(span_a->low >= span_b->low && span_a->high <= span_b->high) {
/* Split off lower part of span 'b' at lower span of span 'a' */
/* Check if there is actually a lower part of span 'b' to split off */
- if(span_a->low>span_b->low) {
+ if(span_a->low > span_b->low) {
/* Merge/add lower part of span 'b' with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
} /* end if */
else {
@@ -5402,50 +5400,50 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
- if(span_a->down==NULL) {
+ if(span_a->down == NULL) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,NULL,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,NULL,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
/* NULL out the temporary pointers to clipped areas in down spans */
- down_a_not_b=NULL;
- down_a_and_b=NULL;
- down_b_not_a=NULL;
+ down_a_not_b = NULL;
+ down_a_and_b = NULL;
+ down_b_not_a = NULL;
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
- if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
+ if(H5S__hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
- if(down_a_not_b!=NULL) {
+ if(down_a_not_b) {
/* Merge/add overlapped part with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,down_a_not_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,down_a_not_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_not_b);
+ H5S__hyper_free_span_info(down_a_not_b);
} /* end if */
/* Check for additions to the a_and_b list */
if(down_a_and_b!=NULL) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,down_a_and_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_a->high,down_a_and_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_and_b);
+ H5S__hyper_free_span_info(down_a_and_b);
} /* end if */
/* Check for additions to the b_not_a list */
if(down_b_not_a!=NULL) {
/* Merge/add overlapped part with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_a->high,down_b_not_a,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_a->high,down_b_not_a,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_b_not_a);
+ H5S__hyper_free_span_info(down_b_not_a);
} /* end if */
} /* end else */
@@ -5454,20 +5452,20 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Split off upper part of span 'b' at upper span of span 'a' */
/* Allocate new span node for upper part of spans 'a' */
- if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
+ if(NULL == (tmp_span = H5S__hyper_new_span(span_a->high + 1, span_b->high, span_b->down, span_b->next)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* And advance span 'a' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
/* Make upper part of span 'b' the new span 'b' */
- H5S_hyper_recover_span(&recover_b,&span_b,tmp_span);
+ H5S__hyper_recover_span(&recover_b,&span_b,tmp_span);
recover_b=1;
} /* end if */
else {
/* Advance both span 'a' & span 'b' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end else */
} /* end if */
/* Check if span 'a' overlaps only the upper bound */
@@ -5481,7 +5479,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Split off lower part of span 'b' at lower span of span 'a' */
/* Merge/add lower part of span 'b' with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
} /* end if */
else {
@@ -5494,65 +5492,65 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
HDassert((span_a->down != NULL && span_b->down != NULL) || (span_a->down == NULL && span_b->down == NULL));
/* If there are no down spans, just add the overlapping area to the a_and_b list */
- if(span_a->down==NULL) {
+ if(span_a->down == NULL) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,NULL,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,NULL,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
} /* end if */
/* If there are down spans, check for the overlap in them and add to each appropriate list */
else {
/* NULL out the temporary pointers to clipped areas in down spans */
- down_a_not_b=NULL;
- down_a_and_b=NULL;
- down_b_not_a=NULL;
+ down_a_not_b = NULL;
+ down_a_and_b = NULL;
+ down_b_not_a = NULL;
/* Check for overlaps in the 'down spans' of span 'a' & 'b' */
- if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
+ if(H5S__hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Check for additions to the a_not_b list */
- if(down_a_not_b!=NULL) {
+ if(down_a_not_b) {
/* Merge/add overlapped part with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->high,down_a_not_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_b->high,down_a_not_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_not_b);
+ H5S__hyper_free_span_info(down_a_not_b);
} /* end if */
/* Check for additions to the a_and_b list */
if(down_a_and_b!=NULL) {
/* Merge/add overlapped part with/to a_and_b list */
- if(H5S_hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,down_a_and_b,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_and_b,a_and_b,span_a->low,span_b->high,down_a_and_b,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_a_and_b);
+ H5S__hyper_free_span_info(down_a_and_b);
} /* end if */
/* Check for additions to the b_not_a list */
- if(down_b_not_a!=NULL) {
+ if(down_b_not_a) {
/* Merge/add overlapped part with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_b->high,down_b_not_a,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_a->low,span_b->high,down_b_not_a,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Release the down span tree generated */
- H5S_hyper_free_span_info(down_b_not_a);
+ H5S__hyper_free_span_info(down_b_not_a);
} /* end if */
} /* end else */
/* Split off upper part of span 'a' at upper span of span 'b' */
/* Allocate new span node for upper part of span 'a' */
- if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
+ if(NULL == (tmp_span = H5S__hyper_new_span(span_b->high + 1, span_a->high, span_a->down, span_a->next)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span")
/* Make upper part of span 'a' into new span 'a' */
- H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
+ H5S__hyper_recover_span(&recover_a,&span_a,tmp_span);
recover_a=1;
/* Advance span 'b' */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end if */
/* span 'a' must be entirely above span 'b' */
/* AAAAA */
@@ -5562,38 +5560,38 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
/* Copy span 'b' and add to b_not_a list */
/* Merge/add span 'b' with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Advance span 'b', leave span 'a' */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end else */
} /* end while */
/* Clean up 'a' spans which haven't been covered yet */
- if(span_a!=NULL && span_b==NULL) {
- while(span_a!=NULL) {
+ if(span_a != NULL && span_b == NULL) {
+ while(span_a != NULL) {
/* Copy span 'a' and add to a_not_b list */
/* Merge/add span 'a' with/to a_not_b list */
- if(H5S_hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_a_not_b,a_not_b,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Advance to the next 'a' span */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
} /* end while */
} /* end if */
/* Clean up 'b' spans which haven't been covered yet */
- else if(span_a==NULL && span_b!=NULL) {
- while(span_b!=NULL) {
+ else if(span_a == NULL && span_b != NULL) {
+ while(span_b != NULL) {
/* Copy span 'b' and add to b_not_a list */
/* Merge/add span 'b' with/to b_not_a list */
- if(H5S_hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&last_b_not_a,b_not_a,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Advance to the next 'b' span */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end while */
} /* end if */
} /* end else */
@@ -5601,16 +5599,16 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_clip_spans() */
+} /* end H5S__hyper_clip_spans() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_merge_spans_helper
+ H5S__hyper_merge_spans_helper
PURPOSE
Merge two hyperslab span tree together
USAGE
- H5S_hyper_span_info_t *H5S_hyper_merge_spans_helper(a_spans, b_spans)
+ H5S_hyper_span_info_t *H5S__hyper_merge_spans_helper(a_spans, b_spans)
H5S_hyper_span_info_t *a_spans; IN: First hyperslab spans to merge
together
H5S_hyper_span_info_t *b_spans; IN: Second hyperslab spans to merge
@@ -5626,104 +5624,104 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_info_t *
-H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_spans)
+H5S__hyper_merge_spans_helper(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_spans)
{
- H5S_hyper_span_info_t *merged_spans=NULL; /* Pointer to the merged span tree */
+ H5S_hyper_span_info_t *merged_spans = NULL; /* Pointer to the merged span tree */
H5S_hyper_span_info_t *tmp_spans; /* Pointer to temporary new span tree */
H5S_hyper_span_t *tmp_span; /* Pointer to temporary new span */
H5S_hyper_span_t *span_a; /* Pointer to current span 'a' working on */
H5S_hyper_span_t *span_b; /* Pointer to current span 'b' working on */
H5S_hyper_span_t *prev_span_merge; /* Pointer to previous merged span */
- unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */
+ hbool_t recover_a, recover_b; /* Flags to indicate when to recover temporary spans */
H5S_hyper_span_info_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Make certain both 'a' & 'b' spans have down span trees or neither does */
HDassert((a_spans != NULL && b_spans != NULL) || (a_spans == NULL && b_spans == NULL));
/* Check if the span trees for the 'a' span and the 'b' span are the same */
- if(H5S_hyper_cmp_spans(a_spans,b_spans)==TRUE) {
- if(a_spans==NULL)
- merged_spans=NULL;
+ if(H5S__hyper_cmp_spans(a_spans, b_spans)) {
+ if(a_spans == NULL)
+ merged_spans = NULL;
else {
/* Copy one of the span trees to return */
- if((merged_spans=H5S_hyper_copy_span(a_spans))==NULL)
+ if(NULL == (merged_spans = H5S__hyper_copy_span(a_spans)))
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOPY, NULL, "can't copy hyperslab span tree")
} /* end else */
} /* end if */
else {
/* Get the pointers to the 'a' and 'b' span lists */
- span_a=a_spans->head;
- span_b=b_spans->head;
+ span_a = a_spans->head;
+ span_b = b_spans->head;
/* Set the pointer to the previous spans */
- prev_span_merge=NULL;
+ prev_span_merge = NULL;
/* No spans to recover yet */
- recover_a=recover_b=0;
+ recover_a = recover_b = FALSE;
/* Work through the list of spans in the new list */
- while(span_a!=NULL && span_b!=NULL) {
+ while(span_a != NULL && span_b != NULL) {
/* Check if the 'a' span is completely before 'b' span */
/* AAAAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- if(span_a->high<span_b->low) {
+ if(span_a->high < span_b->low) {
/* Merge/add span 'a' with/to the merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Advance span 'a' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
} /* end if */
/* Check if span 'a' overlaps only the lower bound */
/* of span 'b', up to the upper bound of span 'b' */
/* AAAAAAAAAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- else if(span_a->low<span_b->low && (span_a->high>=span_b->low && span_a->high<=span_b->high)) {
+ else if(span_a->low < span_b->low && (span_a->high >= span_b->low && span_a->high <= span_b->high)) {
/* Check if span 'a' and span 'b' down spans are equal */
- if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
+ if(H5S__hyper_cmp_spans(span_a->down, span_b->down)) {
/* Merge/add copy of span 'a' with/to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Merge/add lower part of span 'a' with/to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Get merged span tree for overlapped section */
- tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down);
+ tmp_spans = H5S__hyper_merge_spans_helper(span_a->down,span_b->down);
/* Merge/add overlapped section to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,tmp_spans,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,tmp_spans,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
- H5S_hyper_free_span_info(tmp_spans);
+ H5S__hyper_free_span_info(tmp_spans);
} /* end else */
/* Check if there is an upper part of span 'b' */
- if(span_a->high<span_b->high) {
+ if(span_a->high < span_b->high) {
/* Copy upper part of span 'b' as new span 'b' */
/* Allocate new span node to append to list */
- if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
+ if((tmp_span = H5S__hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
/* Advance span 'a' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
/* Set new span 'b' to tmp_span */
- H5S_hyper_recover_span(&recover_b,&span_b,tmp_span);
- recover_b=1;
+ H5S__hyper_recover_span(&recover_b,&span_b,tmp_span);
+ recover_b = TRUE;
} /* end if */
else {
/* Advance both span 'a' & 'b' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end else */
} /* end if */
/* Check if span 'a' overlaps the lower & upper bound */
@@ -5731,58 +5729,58 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* AAAAAAAAAAAAAAAAAAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- else if(span_a->low<span_b->low && span_a->high>span_b->high) {
+ else if(span_a->low < span_b->low && span_a->high > span_b->high) {
/* Check if span 'a' and span 'b' down spans are equal */
- if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
+ if(H5S__hyper_cmp_spans(span_a->down, span_b->down)) {
/* Merge/add copy of lower & middle parts of span 'a' to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Merge/add lower part of span 'a' to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->low-1,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Get merged span tree for overlapped section */
- tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down);
+ tmp_spans = H5S__hyper_merge_spans_helper(span_a->down,span_b->down);
/* Merge/add overlapped section to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,tmp_spans,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,tmp_spans,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
- H5S_hyper_free_span_info(tmp_spans);
+ H5S__hyper_free_span_info(tmp_spans);
} /* end else */
/* Copy upper part of span 'a' as new span 'a' (remember to free) */
/* Allocate new span node to append to list */
- if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
+ if(NULL == (tmp_span = H5S__hyper_new_span(span_b->high + 1, span_a->high, span_a->down, span_a->next)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
/* Set new span 'a' to tmp_span */
- H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
- recover_a=1;
+ H5S__hyper_recover_span(&recover_a,&span_a,tmp_span);
+ recover_a = TRUE;
/* Advance span 'b' */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end if */
/* Check if span 'a' is entirely within span 'b' */
/* AAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- else if(span_a->low>=span_b->low && span_a->high<=span_b->high) {
+ else if(span_a->low >= span_b->low && span_a->high <= span_b->high) {
/* Check if span 'a' and span 'b' down spans are equal */
- if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
+ if(H5S__hyper_cmp_spans(span_a->down, span_b->down)) {
/* Merge/add copy of lower & middle parts of span 'b' to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->high,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Check if there is a lower part of span 'b' */
- if(span_a->low>span_b->low) {
+ if(span_a->low > span_b->low) {
/* Merge/add lower part of span 'b' to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
} /* end if */
else {
@@ -5790,35 +5788,35 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
} /* end else */
/* Get merged span tree for overlapped section */
- tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down);
+ tmp_spans = H5S__hyper_merge_spans_helper(span_a->down,span_b->down);
/* Merge/add overlapped section to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,tmp_spans,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,tmp_spans,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
- H5S_hyper_free_span_info(tmp_spans);
+ H5S__hyper_free_span_info(tmp_spans);
} /* end else */
/* Check if there is an upper part of span 'b' */
- if(span_a->high<span_b->high) {
+ if(span_a->high < span_b->high) {
/* Copy upper part of span 'b' as new span 'b' (remember to free) */
/* Allocate new span node to append to list */
- if((tmp_span = H5S_hyper_new_span(span_a->high+1,span_b->high,span_b->down,span_b->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
+ if(NULL == (tmp_span = H5S__hyper_new_span(span_a->high + 1, span_b->high, span_b->down, span_b->next)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
/* Advance span 'a' */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
/* Set new span 'b' to tmp_span */
- H5S_hyper_recover_span(&recover_b,&span_b,tmp_span);
- recover_b=1;
+ H5S__hyper_recover_span(&recover_b,&span_b,tmp_span);
+ recover_b = TRUE;
} /* end if */
else {
/* Advance both spans */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end else */
} /* end if */
/* Check if span 'a' overlaps only the upper bound */
@@ -5826,18 +5824,18 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* AAAAAAAAAA */
/* <-----------------------------------> */
/* BBBBBBBBBB */
- else if((span_a->low>=span_b->low && span_a->low<=span_b->high) && span_a->high>span_b->high) {
+ else if((span_a->low >= span_b->low && span_a->low <= span_b->high) && span_a->high > span_b->high) {
/* Check if span 'a' and span 'b' down spans are equal */
- if(H5S_hyper_cmp_spans(span_a->down,span_b->down)==TRUE) {
+ if(H5S__hyper_cmp_spans(span_a->down, span_b->down)) {
/* Merge/add copy of span 'b' to merged spans if so */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
} /* end if */
else {
/* Check if there is a lower part of span 'b' */
- if(span_a->low>span_b->low) {
+ if(span_a->low > span_b->low) {
/* Merge/add lower part of span 'b' to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_a->low-1,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
} /* end if */
else {
@@ -5845,28 +5843,28 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
} /* end else */
/* Get merged span tree for overlapped section */
- tmp_spans=H5S_hyper_merge_spans_helper(span_a->down,span_b->down);
+ tmp_spans = H5S__hyper_merge_spans_helper(span_a->down,span_b->down);
/* Merge/add overlapped section to merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,tmp_spans,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_b->high,tmp_spans,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Release merged span tree for overlapped section */
- H5S_hyper_free_span_info(tmp_spans);
+ H5S__hyper_free_span_info(tmp_spans);
} /* end else */
/* Copy upper part of span 'a' as new span 'a' */
/* Allocate new span node to append to list */
- if((tmp_span = H5S_hyper_new_span(span_b->high+1,span_a->high,span_a->down,span_a->next))==NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span")
+ if(NULL == (tmp_span = H5S__hyper_new_span(span_b->high + 1, span_a->high, span_a->down, span_a->next)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
/* Set new span 'a' to tmp_span */
- H5S_hyper_recover_span(&recover_a,&span_a,tmp_span);
- recover_a=1;
+ H5S__hyper_recover_span(&recover_a,&span_a,tmp_span);
+ recover_a = TRUE;
/* Advance span 'b' */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end if */
/* Span 'a' must be entirely above span 'b' */
/* AAAAA */
@@ -5874,35 +5872,35 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
/* BBBBBBBBBB */
else {
/* Merge/add span 'b' with the merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Advance span 'b' */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end else */
} /* end while */
/* Clean up 'a' spans which haven't been added to the list of merged spans */
- if(span_a!=NULL && span_b==NULL) {
- while(span_a!=NULL) {
+ if(span_a != NULL && span_b == NULL) {
+ while(span_a != NULL) {
/* Merge/add all 'a' spans into the merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_a->low,span_a->high,span_a->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Advance to next 'a' span, until all processed */
- H5S_hyper_recover_span(&recover_a,&span_a,span_a->next);
+ H5S__hyper_recover_span(&recover_a,&span_a,span_a->next);
} /* end while */
} /* end if */
/* Clean up 'b' spans which haven't been added to the list of merged spans */
- if(span_a==NULL && span_b!=NULL) {
- while(span_b!=NULL) {
+ if(span_a == NULL && span_b != NULL) {
+ while(span_b != NULL) {
/* Merge/add all 'b' spans into the merged spans */
- if(H5S_hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
+ if(H5S__hyper_append_span(&prev_span_merge,&merged_spans,span_b->low,span_b->high,span_b->down,NULL)==FAIL)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, NULL, "can't allocate hyperslab span")
/* Advance to next 'b' span, until all processed */
- H5S_hyper_recover_span(&recover_b,&span_b,span_b->next);
+ H5S__hyper_recover_span(&recover_b,&span_b,span_b->next);
} /* end while */
} /* end if */
} /* end else */
@@ -5911,23 +5909,21 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf
ret_value = merged_spans;
done:
- if(ret_value == NULL) {
- if(merged_spans)
- if(H5S_hyper_free_span_info(merged_spans) < 0)
- HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, NULL, "failed to release merged hyperslab spans")
- } /* end if */
+ if(ret_value == NULL)
+ if(merged_spans && H5S__hyper_free_span_info(merged_spans) < 0)
+ HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, NULL, "failed to release merged hyperslab spans")
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_merge_spans_helper() */
+} /* end H5S__hyper_merge_spans_helper() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_merge_spans
+ H5S__hyper_merge_spans
PURPOSE
Merge new hyperslab spans to existing hyperslab selection
USAGE
- herr_t H5S_hyper_merge_spans(space, new_spans, can_own)
+ herr_t H5S__hyper_merge_spans(space, new_spans, can_own)
H5S_t *space; IN: Dataspace to add new spans to hyperslab
selection.
H5S_hyper_span_t *new_spans; IN: Span tree of new spans to add to
@@ -5947,7 +5943,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t can_own)
+H5S__hyper_merge_spans(H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t can_own)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -5956,39 +5952,39 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c
HDassert(new_spans);
/* If this is the first span tree in the hyperslab selection, just use it */
- if(space->select.sel_info.hslab->span_lst==NULL) {
+ if(space->select.sel_info.hslab->span_lst == NULL) {
if(can_own)
- space->select.sel_info.hslab->span_lst=new_spans;
+ space->select.sel_info.hslab->span_lst = new_spans;
else
- space->select.sel_info.hslab->span_lst=H5S_hyper_copy_span(new_spans);
+ space->select.sel_info.hslab->span_lst = H5S__hyper_copy_span(new_spans);
} /* end if */
else {
H5S_hyper_span_info_t *merged_spans;
/* Get the merged spans */
- merged_spans=H5S_hyper_merge_spans_helper(space->select.sel_info.hslab->span_lst, new_spans);
+ merged_spans = H5S__hyper_merge_spans_helper(space->select.sel_info.hslab->span_lst, new_spans);
/* Sanity checking since we started with some spans, we should still have some after the merge */
HDassert(merged_spans);
/* Free the previous spans */
- H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst);
+ H5S__hyper_free_span_info(space->select.sel_info.hslab->span_lst);
/* Point to the new merged spans */
- space->select.sel_info.hslab->span_lst=merged_spans;
+ space->select.sel_info.hslab->span_lst = merged_spans;
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5S_hyper_merge_spans() */
+} /* end H5S__hyper_merge_spans() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_spans_nelem
+ H5S__hyper_spans_nelem
PURPOSE
Count the number of elements in a span tree
USAGE
- hsize_t H5S_hyper_spans_nelem(spans)
+ hsize_t H5S__hyper_spans_nelem(spans)
const H5S_hyper_span_info_t *spans; IN: Hyperslan span tree to count elements of
RETURNS
Number of elements in span tree on success; negative on failure
@@ -6000,43 +5996,41 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c
REVISION LOG
--------------------------------------------------------------------------*/
static hsize_t
-H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans)
+H5S__hyper_spans_nelem(const H5S_hyper_span_info_t *spans)
{
- H5S_hyper_span_t *span; /* Hyperslab span */
- hsize_t ret_value = 0; /* Return value */
+ hsize_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Count the number of elements in the span tree */
- if(spans==NULL)
- ret_value=0;
- else {
- span=spans->head;
- ret_value=0;
- while(span!=NULL) {
+ if(spans != NULL) {
+ const H5S_hyper_span_t *span; /* Hyperslab span */
+
+ span = spans->head;
+ while(span != NULL) {
/* If there are down spans, multiply the size of this span by the total down span elements */
- if(span->down!=NULL)
- ret_value+=span->nelem*H5S_hyper_spans_nelem(span->down);
+ if(span->down != NULL)
+ ret_value += span->nelem * H5S__hyper_spans_nelem(span->down);
/* If there are no down spans, just count the elements in this span */
else
- ret_value+=span->nelem;
+ ret_value += span->nelem;
/* Advance to next span */
- span=span->next;
+ span = span->next;
} /* end while */
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_spans_nelem() */
+} /* end H5S__hyper_spans_nelem() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_make_spans
+ H5S__hyper_make_spans
PURPOSE
Create a span tree
USAGE
- H5S_hyper_span_t *H5S_hyper_make_spans(rank, start, stride, count, block)
+ H5S_hyper_span_t *H5S__hyper_make_spans(rank, start, stride, count, block)
unsigned rank; IN: # of dimensions of the space
const hsize_t *start; IN: Starting location of the hyperslabs
const hsize_t *stride; IN: Stride from the beginning of one block to
@@ -6056,7 +6050,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans)
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_info_t *
-H5S_hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride,
+H5S__hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride,
const hsize_t *count, const hsize_t *block)
{
H5S_hyper_span_info_t *down = NULL; /* Pointer to spans in next dimension down */
@@ -6067,7 +6061,7 @@ H5S_hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride,
unsigned u; /* Counters */
H5S_hyper_span_info_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(rank > 0);
@@ -6116,23 +6110,17 @@ H5S_hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride,
span->down = down;
down->count++; /* Increment reference count for shared span */
} /* end if */
- else {
+ else
span->down = NULL;
- } /* end else */
} /* end for */
/* Allocate a span info node */
- if(NULL == (down = H5FL_MALLOC(H5S_hyper_span_info_t)))
+ if(NULL == (down = H5FL_CALLOC(H5S_hyper_span_info_t)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate hyperslab span")
- /* Set the reference count */
- down->count = 0;
-
- /* Reset the scratch pad space */
- down->scratch = 0;
-
/* Keep the pointer to the next dimension down's completed list */
down->head = head;
+
} /* end for */
/* Indicate that there is a pointer to this tree */
@@ -6166,63 +6154,61 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_make_spans() */
+} /* end H5S__hyper_make_spans() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_rebuild_helper
+ H5S__hyper_rebuild_helper
PURPOSE
Helper routine to rebuild optimized hyperslab information if possible.
(It can be recovered with regular selection)
USAGE
- herr_t H5S_hyper_rebuild_helper(space)
+ herr_t H5S__hyper_rebuild_helper(space)
const H5S_hyper_span_t *span; IN: Portion of span tree to check
H5S_hyper_dim_t span_slab[]; OUT: Rebuilt section of hyperslab description
unsigned rank; IN: Current dimension to work on
RETURNS
- >=0 on success, <0 on failure
+ TRUE/FALSE for hyperslab selection rebuilt
DESCRIPTION
Examine the span tree for a hyperslab selection and rebuild
the start/stride/count/block information for the selection, if possible.
-
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
To be able to recover the optimized information, the span tree must conform
to span tree able to be generated from a single H5S_SELECT_SET operation.
-
EXAMPLES
REVISION LOG
KY, 2005/9/22
--------------------------------------------------------------------------*/
static hbool_t
-H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab_info[],
+H5S__hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab_info[],
unsigned rank)
{
- hsize_t curr_stride, next_stride;
- hsize_t curr_block, next_block;
- hsize_t curr_start;
- hsize_t curr_low;
- size_t outcount;
- unsigned u;
- H5S_hyper_dim_t canon_down_span_slab_info[H5S_MAX_RANK];
- hbool_t ret_value = TRUE;
+ hbool_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if(span) {
+ const H5S_hyper_span_t *prev_span = NULL; /* Previous span in list */
+ H5S_hyper_dim_t canon_down_span_slab_info[H5S_MAX_RANK];
+ hsize_t curr_stride;
+ hsize_t curr_block;
+ hsize_t curr_start;
+ hsize_t curr_low;
+ size_t outcount; /* Number of spans encountered in this dimension */
+
/* Initialization */
- curr_stride = 1;
- curr_block = 0;
- outcount = 0;
- curr_low = 0;
+ curr_stride = 1;
+ curr_low = 0;
+ outcount = 0;
/* Get "canonical" down span information */
if(span->down) {
HDassert(span->down->head);
- /* Go to the next down span and check whether the selection can be rebuilt.*/
- if(!H5S_hyper_rebuild_helper(span->down->head, span_slab_info, rank - 1))
+ /* Go to the next down span and check whether the selection can be rebuilt */
+ if(!H5S__hyper_rebuild_helper(span->down->head, span_slab_info, rank - 1))
HGOTO_DONE(FALSE)
HDmemcpy(canon_down_span_slab_info, span_slab_info, sizeof(H5S_hyper_dim_t) * rank);
@@ -6232,22 +6218,27 @@ H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab
curr_start = span->low;
curr_block = (span->high - span->low) + 1;
- /* Loop the span */
+ /* Loop the spans */
while(span) {
if(outcount > 0) {
- if(span->down) {
- H5S_hyper_dim_t *curr_down_span_slab_info;
+ hsize_t next_stride; /* Stride from previous span */
+ hsize_t next_block; /* Block size of current span */
+
+ /* Check that down spans match current slab info */
+ /* (Can skip check if previous span's down pointer is same as current one) */
+ if(span->down && (NULL == prev_span || prev_span->down != span->down)) {
+ H5S_hyper_dim_t *curr_down_span_slab_info;
+ unsigned u; /* Local index variable */
HDassert(span->down->head);
/* Go to the next down span and check whether the selection can be rebuilt.*/
- if(!H5S_hyper_rebuild_helper(span->down->head, span_slab_info, rank - 1))
+ if(!H5S__hyper_rebuild_helper(span->down->head, span_slab_info, rank - 1))
HGOTO_DONE(FALSE)
/* Compare the slab information of the adjacent spans in the down span tree.
We have to compare all the sub-tree slab information with the canon_down_span_slab_info.*/
-
- for( u = 0; u < rank - 1; u++) {
+ for(u = 0; u < rank - 1; u++) {
curr_down_span_slab_info = &span_slab_info[u];
if(curr_down_span_slab_info->count > 0 && canon_down_span_slab_info[u].count > 0) {
@@ -6257,32 +6248,32 @@ H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab
|| curr_down_span_slab_info->count != canon_down_span_slab_info[u].count)
HGOTO_DONE(FALSE)
} /* end if */
- else if (!((curr_down_span_slab_info->count == 0) && (canon_down_span_slab_info[u].count == 0)))
+ else if(!((curr_down_span_slab_info->count == 0) && (canon_down_span_slab_info[u].count == 0)))
HGOTO_DONE(FALSE)
- }
+ } /* end for */
} /* end if */
- } /* end if */
- /* Obtain values for stride and block */
- next_stride = span->low - curr_low;
- next_block = (span->high - span->low) + 1;
+ /* Obtain values for stride and block */
+ next_stride = span->low - curr_low;
+ next_block = (span->high - span->low) + 1;
- /* Compare stride and block in this span, to compare stride,
- * three spans are needed. Ignore the first two spans.
- */
- if(outcount > 1 && curr_stride != next_stride)
- HGOTO_DONE(FALSE)
- if(outcount != 0 && next_block != curr_block)
- HGOTO_DONE(FALSE)
+ /* Compare stride and block in this span, to compare stride,
+ * three spans are needed. Account for the first two spans.
+ */
+ if(next_block != curr_block)
+ HGOTO_DONE(FALSE)
+ if(outcount > 1 && curr_stride != next_stride)
+ HGOTO_DONE(FALSE)
- /* Keep the isolated stride to be 1 */
- if(outcount != 0)
+ /* Keep the isolated stride to be 1 */
curr_stride = next_stride;
+ } /* end if */
/* Keep current starting point */
- curr_low = span->low;
+ curr_low = span->low;
/* Advance to next span */
+ prev_span = span;
span = span->next;
outcount++;
} /* end while */
@@ -6296,47 +6287,42 @@ H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_hyper_rebuild_helper() */
+} /* end H5S__hyper_rebuild_helper() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_rebuild
+ H5S__hyper_rebuild
PURPOSE
Rebuild optimized hyperslab information if possible.
(It can be recovered with regular selection)
USAGE
- herr_t H5S_hyper_rebuild(space)
+ hbool_t H5S__hyper_rebuild(space)
const H5S_t *space; IN: Dataspace to check
RETURNS
- >=0 on success, <0 on failure
+ TRUE/FALSE for hyperslab selection rebuilt
DESCRIPTION
Examine the span tree for a hyperslab selection and rebuild
the start/stride/count/block information for the selection, if possible.
-
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
To be able to recover the optimized information, the span tree must conform
to span tree able to be generated from a single H5S_SELECT_SET operation.
-
EXAMPLES
REVISION LOG
-
This routine is the optimization of the old version. The previous version
can only detect a singluar selection. This version is general enough to
detect any regular selection.
KY, 2005/9/22
--------------------------------------------------------------------------*/
-static htri_t
-H5S_hyper_rebuild(H5S_t *space)
+static hbool_t
+H5S__hyper_rebuild(H5S_t *space)
{
H5S_hyper_dim_t top_span_slab_info[H5O_LAYOUT_NDIMS];
- H5S_hyper_dim_t *diminfo;
- H5S_hyper_dim_t *app_diminfo;
unsigned rank, curr_dim;
- htri_t ret_value = TRUE; /* Return value */
+ hbool_t ret_value = TRUE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
@@ -6346,12 +6332,15 @@ H5S_hyper_rebuild(H5S_t *space)
rank = space->extent.rank;
/* Check whether the slab can be rebuilt. Only regular selection can be rebuilt. If yes, fill in correct values.*/
- if(!H5S_hyper_rebuild_helper(space->select.sel_info.hslab->span_lst->head, top_span_slab_info, rank)) {
+ if(!H5S__hyper_rebuild_helper(space->select.sel_info.hslab->span_lst->head, top_span_slab_info, rank)) {
HGOTO_DONE(FALSE)
} /* end if */
else {
- diminfo=space->select.sel_info.hslab->opt_diminfo;
- app_diminfo=space->select.sel_info.hslab->app_diminfo;
+ H5S_hyper_dim_t *diminfo;
+ H5S_hyper_dim_t *app_diminfo;
+
+ diminfo = space->select.sel_info.hslab->opt_diminfo;
+ app_diminfo = space->select.sel_info.hslab->app_diminfo;
for(curr_dim = 0; curr_dim < rank; curr_dim++) {
@@ -6367,16 +6356,16 @@ H5S_hyper_rebuild(H5S_t *space)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_rebuild() */
+} /* end H5S__hyper_rebuild() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_generate_spans
+ H5S__hyper_generate_spans
PURPOSE
Create span tree for a regular hyperslab selection
USAGE
- herr_t H5S_hyper_generate_spans(space)
+ herr_t H5S__hyper_generate_spans(space)
H5S_t *space; IN/OUT: Pointer to dataspace
RETURNS
Non-negative on success, negative on failure
@@ -6389,22 +6378,22 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_generate_spans(H5S_t *space)
+H5S__hyper_generate_spans(H5S_t *space)
{
- hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
+ hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
hsize_t tmp_stride[H5O_LAYOUT_NDIMS]; /* Temporary stride information */
hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary count information */
hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
- unsigned u; /* Counter */
- herr_t ret_value=SUCCEED; /* Return value */
+ unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(space);
HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS);
/* Get the diminfo */
- for(u=0; u<space->extent.rank; u++) {
+ for(u = 0; u < space->extent.rank; u++) {
/* Check for unlimited dimension and return error */
/* These should be able to be converted to assertions once everything
* that calls this function checks for unlimited selections first
@@ -6421,17 +6410,17 @@ H5S_hyper_generate_spans(H5S_t *space)
} /* end for */
/* Build the hyperslab information also */
- if(H5S_generate_hyperslab (space, H5S_SELECT_SET, tmp_start, tmp_stride, tmp_count, tmp_block)<0)
+ if(H5S__generate_hyperslab(space, H5S_SELECT_SET, tmp_start, tmp_stride, tmp_count, tmp_block) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5S_hyper_generate_spans() */
+} /* end H5S__hyper_generate_spans() */
#ifndef NEW_HYPERSLAB_API
/*-------------------------------------------------------------------------
- * Function: H5S_generate_hyperlab
+ * Function: H5S__generate_hyperlab
*
* Purpose: Generate hyperslab information from H5S_select_hyperslab()
*
@@ -6445,19 +6434,19 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
+H5S__generate_hyperslab (H5S_t *space, H5S_seloper_t op,
const hsize_t start[],
const hsize_t stride[],
const hsize_t count[],
const hsize_t block[])
{
H5S_hyper_span_info_t *new_spans=NULL; /* Span tree for new hyperslab */
- H5S_hyper_span_info_t *a_not_b=NULL; /* Span tree for hyperslab spans in old span tree and not in new span tree */
- H5S_hyper_span_info_t *a_and_b=NULL; /* Span tree for hyperslab spans in both old and new span trees */
- H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */
- herr_t ret_value=SUCCEED; /* Return value */
+ H5S_hyper_span_info_t *a_not_b = NULL; /* Span tree for hyperslab spans in old span tree and not in new span tree */
+ H5S_hyper_span_info_t *a_and_b = NULL; /* Span tree for hyperslab spans in both old and new span trees */
+ H5S_hyper_span_info_t *b_not_a = NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(space);
@@ -6468,17 +6457,17 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HDassert(block);
/* Generate span tree for new hyperslab information */
- if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL)
+ if(NULL == (new_spans = H5S__hyper_make_spans(space->extent.rank, start, stride, count, block)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information")
/* Generate list of blocks to add/remove based on selection operation */
if(op==H5S_SELECT_SET) {
/* Add new spans to current selection */
- if(H5S_hyper_merge_spans(space,new_spans,TRUE)<0)
+ if(H5S__hyper_merge_spans(space,new_spans,TRUE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Set the number of elements in current selection */
- space->select.num_elem=H5S_hyper_spans_nelem(new_spans);
+ space->select.num_elem = H5S__hyper_spans_nelem(new_spans);
/* Indicate that the new_spans are owned */
new_spans=NULL;
@@ -6487,18 +6476,18 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
hbool_t updated_spans = FALSE; /* Whether the spans in the selection were modified */
/* Generate lists of spans which overlap and don't overlap */
- if(H5S_hyper_clip_spans(space->select.sel_info.hslab->span_lst,new_spans,&a_not_b,&a_and_b,&b_not_a)<0)
+ if(H5S__hyper_clip_spans(space->select.sel_info.hslab->span_lst,new_spans,&a_not_b,&a_and_b,&b_not_a)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
switch(op) {
case H5S_SELECT_OR:
/* Add any new spans from b_not_a to current selection */
if(b_not_a!=NULL) {
- if(H5S_hyper_merge_spans(space,b_not_a,FALSE)<0)
+ if(H5S__hyper_merge_spans(space,b_not_a,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
+ space->select.num_elem += H5S__hyper_spans_nelem(b_not_a);
/* Indicate that the spans were updated */
updated_spans = TRUE;
@@ -6507,7 +6496,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_AND:
/* Free the current selection */
- if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
+ if(H5S__hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
@@ -6516,11 +6505,11 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any overlapped selections */
if(a_and_b!=NULL) {
- if(H5S_hyper_merge_spans(space,a_and_b,TRUE)<0)
+ if(H5S__hyper_merge_spans(space,a_and_b,TRUE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- space->select.num_elem=H5S_hyper_spans_nelem(a_and_b);
+ space->select.num_elem = H5S__hyper_spans_nelem(a_and_b);
/* Indicate that the a_and_b spans are owned */
a_and_b=NULL;
@@ -6532,7 +6521,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_XOR:
/* Free the current selection */
- if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
+ if(H5S__hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
@@ -6541,21 +6530,21 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
- if(H5S_hyper_merge_spans(space,a_not_b,FALSE)<0)
+ if(H5S__hyper_merge_spans(space,a_not_b,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- space->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
+ space->select.num_elem = H5S__hyper_spans_nelem(a_not_b);
/* Indicate that the spans were updated */
updated_spans = TRUE;
} /* end if */
if(b_not_a!=NULL) {
- if(H5S_hyper_merge_spans(space,b_not_a,FALSE)<0)
+ if(H5S__hyper_merge_spans(space,b_not_a,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
+ space->select.num_elem += H5S__hyper_spans_nelem(b_not_a);
/* Indicate that the spans were updated */
updated_spans = TRUE;
@@ -6564,7 +6553,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_NOTB:
/* Free the current selection */
- if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
+ if(H5S__hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
@@ -6573,11 +6562,11 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
- if(H5S_hyper_merge_spans(space,a_not_b,TRUE)<0)
+ if(H5S__hyper_merge_spans(space,a_not_b,TRUE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- space->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
+ space->select.num_elem = H5S__hyper_spans_nelem(a_not_b);
/* Indicate that the a_not_b are owned */
a_not_b=NULL;
@@ -6589,7 +6578,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_NOTA:
/* Free the current selection */
- if(H5S_hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
+ if(H5S__hyper_free_span_info(space->select.sel_info.hslab->span_lst)<0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans")
space->select.sel_info.hslab->span_lst=NULL;
@@ -6598,11 +6587,11 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there are any non-overlapped selections */
if(b_not_a!=NULL) {
- if(H5S_hyper_merge_spans(space,b_not_a,TRUE)<0)
+ if(H5S__hyper_merge_spans(space,b_not_a,TRUE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- space->select.num_elem=H5S_hyper_spans_nelem(b_not_a);
+ space->select.num_elem = H5S__hyper_spans_nelem(b_not_a);
/* Indicate that the b_not_a are owned */
b_not_a=NULL;
@@ -6650,8 +6639,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Attempt to rebuild "optimized" start/stride/count/block information.
* from resulting hyperslab span tree
*/
- if(H5S_hyper_rebuild(space) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't rebuild hyperslab info")
+ H5S__hyper_rebuild(space);
} /* end if */
} /* end else */
} /* end else */
@@ -6659,20 +6647,20 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
done:
/* Free resources */
if(a_not_b)
- if(H5S_hyper_free_span_info(a_not_b) < 0)
+ if(H5S__hyper_free_span_info(a_not_b) < 0)
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
if(a_and_b)
- if(H5S_hyper_free_span_info(a_and_b) < 0)
+ if(H5S__hyper_free_span_info(a_and_b) < 0)
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
if(b_not_a)
- if(H5S_hyper_free_span_info(b_not_a) < 0)
+ if(H5S__hyper_free_span_info(b_not_a) < 0)
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
if(new_spans)
- if(H5S_hyper_free_span_info(new_spans) < 0)
+ if(H5S__hyper_free_span_info(new_spans) < 0)
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_generate_hyperslab() */
+} /* end H5S__generate_hyperslab() */
/*-------------------------------------------------------------------------
@@ -6688,11 +6676,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
- const hsize_t start[],
- const hsize_t *stride,
- const hsize_t count[],
- const hsize_t *block)
+H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[],
+ const hsize_t *stride, const hsize_t count[], const hsize_t *block)
{
hsize_t int_stride[H5O_LAYOUT_NDIMS]; /* Internal storage for stride information */
hsize_t int_count[H5O_LAYOUT_NDIMS]; /* Internal storage for count information */
@@ -6700,9 +6685,9 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
const hsize_t *opt_stride; /* Optimized stride information */
const hsize_t *opt_count; /* Optimized count information */
const hsize_t *opt_block; /* Optimized block information */
- unsigned u; /* Counters */
int unlim_dim = -1; /* Unlimited dimension in selection, of -1 if none */
- herr_t ret_value=SUCCEED; /* Return value */
+ unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -6713,31 +6698,19 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
/* Point to the correct stride values */
- if(stride==NULL)
- stride = _ones;
+ if(stride == NULL)
+ stride = H5S_hyper_ones_g;
/* Point to the correct block values */
- if(block==NULL)
- block = _ones;
-
- /* Check for unlimited dimension */
- for(u = 0; u<space->extent.rank; u++)
- if((count[u] == H5S_UNLIMITED) || (block[u] == H5S_UNLIMITED)) {
- if(unlim_dim >= 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "cannot have more than one unlimited dimension in selection")
- else {
- if(count[u] == block[u] /* == H5S_UNLIMITED */)
- HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "count and block cannot both be unlimited")
- unlim_dim = (int)u;
- } /* end else */
- } /* end if */
+ if(block == NULL)
+ block = H5S_hyper_ones_g;
/*
* Check new selection.
*/
- for(u=0; u<space->extent.rank; u++) {
+ for(u = 0; u < space->extent.rank; u++) {
/* Check for overlapping hyperslab blocks in new selection. */
- if(count[u]>1 && stride[u]<block[u])
+ if(count[u] > 1 && stride[u] < block[u])
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab blocks overlap")
/* Detect zero-sized hyperslabs in new selection */
@@ -6747,8 +6720,8 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_AND: /* Binary "and" operation for hyperslabs */
case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */
/* Convert to "none" selection */
- if(H5S_select_none(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
+ if(H5S_select_none(space) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't convert selection")
HGOTO_DONE(SUCCEED);
case H5S_SELECT_OR: /* Binary "or" operation for hyperslabs */
@@ -6764,13 +6737,24 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
} /* end switch */
} /* end if */
+
+ /* Check for unlimited dimension */
+ if((count[u] == H5S_UNLIMITED) || (block[u] == H5S_UNLIMITED)) {
+ if(unlim_dim >= 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "cannot have more than one unlimited dimension in selection")
+ else {
+ if(count[u] == block[u] /* == H5S_UNLIMITED */)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "count and block cannot both be unlimited")
+ unlim_dim = (int)u;
+ } /* end else */
+ } /* end if */
} /* end for */
/* Optimize hyperslab parameters to merge contiguous blocks, etc. */
- if(stride == _ones && block == _ones) {
+ if(stride == H5S_hyper_ones_g && block == H5S_hyper_ones_g) {
/* Point to existing arrays */
- opt_stride = _ones;
- opt_count = _ones;
+ opt_stride = H5S_hyper_ones_g;
+ opt_count = H5S_hyper_ones_g;
opt_block = count;
} /* end if */
else {
@@ -6778,26 +6762,26 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
opt_stride = int_stride;
opt_count = int_count;
opt_block = int_block;
- for(u=0; u<space->extent.rank; u++) {
+ for(u = 0; u < space->extent.rank; u++) {
/* contiguous hyperslabs have the block size equal to the stride */
if((stride[u] == block[u]) && (count[u] != H5S_UNLIMITED)) {
- int_count[u]=1;
- int_stride[u]=1;
- if(block[u]==1)
- int_block[u]=count[u];
+ int_count[u] = 1;
+ int_stride[u] = 1;
+ if(block[u] == 1)
+ int_block[u] = count[u];
else
- int_block[u]=block[u]*count[u];
+ int_block[u] = block[u] * count[u];
} /* end if */
else {
- if(count[u]==1)
- int_stride[u]=1;
+ if(count[u] == 1)
+ int_stride[u] = 1;
else {
- HDassert((stride[u] > block[u]) || ((stride[u] == block[u])
- && (count[u] == H5S_UNLIMITED)));
- int_stride[u]=stride[u];
+ HDassert((stride[u] > block[u]) ||
+ ((stride[u] == block[u]) && (count[u] == H5S_UNLIMITED)));
+ int_stride[u] = stride[u];
} /* end else */
- int_count[u]=count[u];
- int_block[u]=block[u];
+ int_count[u] = count[u];
+ int_block[u] = block[u];
} /* end else */
} /* end for */
} /* end else */
@@ -6805,8 +6789,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check for operating on unlimited selection */
if((H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS)
&& (space->select.sel_info.hslab->unlim_dim >= 0)
- && (op != H5S_SELECT_SET))
- {
+ && (op != H5S_SELECT_SET)) {
/* Check for invalid operation */
if(unlim_dim >= 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "cannot modify unlimited selection with another unlimited selection")
@@ -6817,15 +6800,13 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Clip unlimited selection to include new selection */
if(H5S_hyper_clip_unlim(space,
start[space->select.sel_info.hslab->unlim_dim]
- + ((opt_count[space->select.sel_info.hslab->unlim_dim]
- - (hsize_t)1)
- * opt_stride[space->select.sel_info.hslab->unlim_dim])
- + opt_block[space->select.sel_info.hslab->unlim_dim]) < 0)
+ + ((opt_count[space->select.sel_info.hslab->unlim_dim] - (hsize_t)1)
+ * opt_stride[space->select.sel_info.hslab->unlim_dim])
+ + opt_block[space->select.sel_info.hslab->unlim_dim]) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection")
/* If an empty space was returned it must be "none" */
- HDassert((space->select.num_elem > (hsize_t)0)
- || (space->select.type->type == H5S_SEL_NONE));
+ HDassert((space->select.num_elem > (hsize_t)0) || (space->select.type->type == H5S_SEL_NONE));
} /* end if */
/* Fixup operation for non-hyperslab selections */
@@ -6839,7 +6820,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
case H5S_SELECT_OR: /* Binary "or" operation for hyperslabs */
case H5S_SELECT_XOR: /* Binary "xor" operation for hyperslabs */
case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */
- op=H5S_SELECT_SET; /* Maps to "set" operation when applied to "none" selection */
+ op = H5S_SELECT_SET; /* Maps to "set" operation when applied to "none" selection */
break;
case H5S_SELECT_AND: /* Binary "and" operation for hyperslabs */
@@ -6865,7 +6846,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_DONE(SUCCEED); /* Selection stays "all" */
case H5S_SELECT_AND: /* Binary "and" operation for hyperslabs */
- op=H5S_SELECT_SET; /* Maps to "set" operation when applied to "none" selection */
+ op = H5S_SELECT_SET; /* Maps to "set" operation when applied to "none" selection */
break;
case H5S_SELECT_XOR: /* Binary "xor" operation for hyperslabs */
@@ -6873,29 +6854,26 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Convert current "all" selection to "real" hyperslab selection */
/* Then allow operation to proceed */
{
- hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
- hsize_t tmp_stride[H5O_LAYOUT_NDIMS]; /* Temporary stride information */
- hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary count information */
- hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
+ const hsize_t *tmp_start; /* Temporary start information */
+ const hsize_t *tmp_stride; /* Temporary stride information */
+ const hsize_t *tmp_count; /* Temporary count information */
+ const hsize_t *tmp_block; /* Temporary block information */
- /* Fill in temporary information for the dimensions */
- for(u=0; u<space->extent.rank; u++) {
- tmp_start[u]=0;
- tmp_stride[u]=1;
- tmp_count[u]=1;
- tmp_block[u]=space->extent.size[u];
- } /* end for */
+ /* Set up temporary information for the dimensions */
+ tmp_start = H5S_hyper_zeros_g;
+ tmp_stride = tmp_count = H5S_hyper_ones_g;
+ tmp_block = space->extent.size;
/* Convert to hyperslab selection */
- if(H5S_select_hyperslab(space,H5S_SELECT_SET,tmp_start,tmp_stride,tmp_count,tmp_block)<0)
+ if(H5S_select_hyperslab(space, H5S_SELECT_SET, tmp_start, tmp_stride, tmp_count, tmp_block) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
} /* end case */
break;
case H5S_SELECT_NOTA: /* Binary "B not A" operation for hyperslabs */
/* Convert to "none" selection */
- if(H5S_select_none(space)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't convert selection")
+ if(H5S_select_none(space) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't convert selection")
HGOTO_DONE(SUCCEED);
case H5S_SELECT_NOOP:
@@ -6912,7 +6890,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
break;
case H5S_SEL_POINTS: /* Can't combine hyperslab operations and point selections currently */
- if(op==H5S_SELECT_SET) /* Allow only "set" operation to proceed */
+ if(op == H5S_SELECT_SET) /* Allow only "set" operation to proceed */
break;
/* Else fall through to error */
@@ -6968,6 +6946,9 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
if(space->select.num_elem != (hsize_t)0)
space->select.num_elem = H5S_UNLIMITED;
} /* end if */
+
+ /* Set selection type */
+ space->select.type = H5S_sel_hyper;
} /* end if */
else if(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA) {
/* Sanity check */
@@ -6987,19 +6968,19 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "unsupported operation with unlimited selection")
/* Get bounds of existing selection */
- if(H5S_hyper_bounds(space, bounds_start, bounds_end) < 0)
+ if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
/* Patch count and block to remove unlimited and include the
* existing selection */
H5S__hyper_get_clip_diminfo(start[unlim_dim], opt_stride[unlim_dim], &tmp_count, &tmp_block, bounds_end[unlim_dim] + (hsize_t)1);
- HDassert((tmp_count == 1) || (opt_count != _ones));
- HDassert((tmp_block == 1) || (opt_block != _ones));
- if(opt_count != _ones) {
+ HDassert((tmp_count == 1) || (opt_count != H5S_hyper_ones_g));
+ HDassert((tmp_block == 1) || (opt_block != H5S_hyper_ones_g));
+ if(opt_count != H5S_hyper_ones_g) {
HDassert(opt_count == int_count);
int_count[unlim_dim] = tmp_count;
} /* end if */
- if(opt_block != _ones) {
+ if(opt_block != H5S_hyper_ones_g) {
HDassert(opt_block == int_block);
int_block[unlim_dim] = tmp_block;
} /* end if */
@@ -7007,25 +6988,26 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there's no hyperslab span information currently */
if(NULL == space->select.sel_info.hslab->span_lst)
- if(H5S_hyper_generate_spans(space) < 0)
+ if(H5S__hyper_generate_spans(space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Indicate that the regular dimensions are no longer valid */
space->select.sel_info.hslab->diminfo_valid = FALSE;
+ /* Set selection type */
+ /* (Could be overridden by resetting selection to 'none', below) */
+ space->select.type = H5S_sel_hyper;
+
/* Add in the new hyperslab information */
- if(H5S_generate_hyperslab(space, op, start, opt_stride, opt_count, opt_block) < 0)
+ if(H5S__generate_hyperslab(space, op, start, opt_stride, opt_count, opt_block) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs")
} /* end if */
else
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
- /* Set selection type */
- space->select.type = H5S_sel_hyper;
-
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_select_hyperslab() */
+} /* end H5S_select_hyperslab() */
/*--------------------------------------------------------------------------
@@ -7056,10 +7038,9 @@ done:
--------------------------------------------------------------------------*/
herr_t
H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
- const hsize_t stride[], const hsize_t count[], const hsize_t block[])
+ const hsize_t stride[], const hsize_t count[], const hsize_t block[])
{
H5S_t *space; /* Dataspace to modify selection of */
- unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -7067,7 +7048,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
/* Check args */
if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(H5S_SCALAR == H5S_GET_EXTENT_TYPE(space))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space")
if(H5S_NULL == H5S_GET_EXTENT_TYPE(space))
@@ -7076,15 +7057,16 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified")
if(!(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID))
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
- if(stride!=NULL) {
+ if(stride != NULL) {
+ unsigned u; /* Local index variable */
+
/* Check for 0-sized strides */
- for(u=0; u<space->extent.rank; u++) {
- if(stride[u]==0)
+ for(u = 0; u < space->extent.rank; u++)
+ if(stride[u] == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid stride==0 value")
- } /* end for */
} /* end if */
- if (H5S_select_hyperslab(space, op, start, stride, count, block)<0)
+ if(H5S_select_hyperslab(space, op, start, stride, count, block) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection")
done:
@@ -7126,11 +7108,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Just copy the selection from spans2 if we are setting the selection */
/* ('space1' to 'result' aliasing happens at the next layer up) */
if(op==H5S_SELECT_SET) {
- if(H5S_hyper_merge_spans(result,spans2,can_own_span2)<0)
+ if(H5S__hyper_merge_spans(result,spans2,can_own_span2)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem=H5S_hyper_spans_nelem(spans2);
+ result->select.num_elem = H5S__hyper_spans_nelem(spans2);
/* Indicate that we took ownership of span2, if allowed */
if(can_own_span2)
@@ -7142,7 +7124,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
HDassert(spans1);
/* Generate lists of spans which overlap and don't overlap */
- if(H5S_hyper_clip_spans(spans1,spans2,&a_not_b,&a_and_b,&b_not_a)<0)
+ if(H5S__hyper_clip_spans(spans1,spans2,&a_not_b,&a_and_b,&b_not_a)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Switch on the operation */
@@ -7150,20 +7132,20 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
case H5S_SELECT_OR:
/* Copy spans from spans1 to current selection */
if(spans1!=NULL) {
- if(H5S_hyper_merge_spans(result,spans1,FALSE)<0)
+ if(H5S__hyper_merge_spans(result,spans1,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem=H5S_hyper_spans_nelem(spans1);
+ result->select.num_elem = H5S__hyper_spans_nelem(spans1);
} /* end if */
/* Add any new spans from spans2 to current selection */
if(b_not_a!=NULL) {
- if(H5S_hyper_merge_spans(result,b_not_a,FALSE)<0)
+ if(H5S__hyper_merge_spans(result,b_not_a,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
+ result->select.num_elem += H5S__hyper_spans_nelem(b_not_a);
/* Indicate that the spans were updated */
updated_spans = TRUE;
@@ -7173,11 +7155,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
case H5S_SELECT_AND:
/* Check if there are any overlapped selections */
if(a_and_b!=NULL) {
- if(H5S_hyper_merge_spans(result,a_and_b,TRUE)<0)
+ if(H5S__hyper_merge_spans(result,a_and_b,TRUE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem=H5S_hyper_spans_nelem(a_and_b);
+ result->select.num_elem = H5S__hyper_spans_nelem(a_and_b);
/* Indicate that the result owns the a_and_b spans */
a_and_b=NULL;
@@ -7190,21 +7172,21 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
case H5S_SELECT_XOR:
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
- if(H5S_hyper_merge_spans(result,a_not_b,FALSE)<0)
+ if(H5S__hyper_merge_spans(result,a_not_b,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
+ result->select.num_elem = H5S__hyper_spans_nelem(a_not_b);
/* Indicate that the spans were updated */
updated_spans = TRUE;
} /* end if */
if(b_not_a!=NULL) {
- if(H5S_hyper_merge_spans(result,b_not_a,FALSE)<0)
+ if(H5S__hyper_merge_spans(result,b_not_a,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
+ result->select.num_elem += H5S__hyper_spans_nelem(b_not_a);
/* Indicate that the spans were updated */
updated_spans = TRUE;
@@ -7214,11 +7196,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
case H5S_SELECT_NOTB:
/* Check if there are any non-overlapped selections */
if(a_not_b!=NULL) {
- if(H5S_hyper_merge_spans(result,a_not_b,TRUE)<0)
+ if(H5S__hyper_merge_spans(result,a_not_b,TRUE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
+ result->select.num_elem = H5S__hyper_spans_nelem(a_not_b);
/* Indicate that the result owns the a_not_b spans */
a_not_b=NULL;
@@ -7231,11 +7213,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
case H5S_SELECT_NOTA:
/* Check if there are any non-overlapped selections */
if(b_not_a!=NULL) {
- if(H5S_hyper_merge_spans(result,b_not_a,TRUE)<0)
+ if(H5S__hyper_merge_spans(result,b_not_a,TRUE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs")
/* Update the number of elements in current selection */
- result->select.num_elem=H5S_hyper_spans_nelem(b_not_a);
+ result->select.num_elem = H5S__hyper_spans_nelem(b_not_a);
/* Indicate that the result owns the b_not_a spans */
b_not_a=NULL;
@@ -7251,11 +7233,11 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Free the hyperslab trees generated from the clipping algorithm */
if(a_not_b)
- H5S_hyper_free_span_info(a_not_b);
+ H5S__hyper_free_span_info(a_not_b);
if(a_and_b)
- H5S_hyper_free_span_info(a_and_b);
+ H5S__hyper_free_span_info(a_and_b);
if(b_not_a)
- H5S_hyper_free_span_info(b_not_a);
+ H5S__hyper_free_span_info(b_not_a);
/* Check if the resulting hyperslab span tree is empty */
if(result->select.sel_info.hslab->span_lst==NULL) {
@@ -7286,8 +7268,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper
/* Attempt to rebuild "optimized" start/stride/count/block information.
* from resulting hyperslab span tree
*/
- if(H5S_hyper_rebuild(result) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't rebuild hyperslab info")
+ H5S__hyper_rebuild(result);
} /* end if */
} /* end else */
} /* end else */
@@ -7312,11 +7293,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
- const hsize_t start[],
- const hsize_t stride[],
- const hsize_t count[],
- const hsize_t block[])
+H5S__generate_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[],
+ const hsize_t stride[], const hsize_t count[], const hsize_t block[])
{
H5S_hyper_span_info_t *new_spans=NULL; /* Span tree for new hyperslab */
H5S_hyper_span_info_t *tmp_spans=NULL; /* Temporary copy of selection */
@@ -7334,7 +7312,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HDassert(block);
/* Generate span tree for new hyperslab information */
- if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL)
+ if(NULL == (new_spans = H5S__hyper_make_spans(space->extent.rank, start, stride, count, block)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information")
/* Copy the original dataspace */
@@ -7363,14 +7341,14 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
done:
/* Free temporary data structures */
if(tmp_spans!=NULL)
- if(H5S_hyper_free_span_info(tmp_spans)<0)
+ if(H5S__hyper_free_span_info(tmp_spans)<0)
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
if(new_spans!=NULL && span2_owned==FALSE)
- if(H5S_hyper_free_span_info(new_spans)<0)
+ if(H5S__hyper_free_span_info(new_spans)<0)
HDONE_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release temporary hyperslab spans")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_generate_hyperslab() */
+} /* end H5S__generate_hyperslab() */
/*-------------------------------------------------------------------------
@@ -7414,11 +7392,11 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Point to the correct stride values */
if(stride==NULL)
- stride = _ones;
+ stride = H5S_hyper_ones_g;
/* Point to the correct block values */
if(block==NULL)
- block = _ones;
+ block = H5S_hyper_ones_g;
/* Check for unlimited dimension */
for(u = 0; u<space->extent.rank; u++)
@@ -7463,10 +7441,10 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
} /* end for */
/* Optimize hyperslab parameters to merge contiguous blocks, etc. */
- if(stride == _ones && block == _ones) {
+ if(stride == H5S_hyper_ones_g && block == H5S_hyper_ones_g) {
/* Point to existing arrays */
- opt_stride = _ones;
- opt_count = _ones;
+ opt_stride = H5S_hyper_ones_g;
+ opt_count = H5S_hyper_ones_g;
opt_block = count;
} /* end if */
else {
@@ -7674,19 +7652,19 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "unsupported operation with unlimited selection")
/* Get bounds of existing selection */
- if(H5S_hyper_bounds(space, bounds_start, bounds_end) < 0)
+ if(H5S__hyper_bounds(space, bounds_start, bounds_end) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get selection bounds")
/* Patch count and block to remove unlimited and include the
* existing selection */
H5S__hyper_get_clip_diminfo(start[unlim_dim], opt_stride[unlim_dim], &tmp_count, &tmp_block, bounds_end[unlim_dim] + (hsize_t)1);
- HDassert((tmp_count == 1) || (opt_count != _ones));
- HDassert((tmp_block == 1) || (opt_block != _ones));
- if(opt_count != _ones) {
+ HDassert((tmp_count == 1) || (opt_count != H5S_hyper_ones_g));
+ HDassert((tmp_block == 1) || (opt_block != H5S_hyper_ones_g));
+ if(opt_count != H5S_hyper_ones_g) {
HDassert(opt_count == int_count);
int_count[unlim_dim] = tmp_count;
} /* end if */
- if(opt_block != _ones) {
+ if(opt_block != H5S_hyper_ones_g) {
HDassert(opt_block == int_block);
int_block[unlim_dim] = tmp_block;
} /* end if */
@@ -7694,14 +7672,14 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Check if there's no hyperslab span information currently */
if(NULL == space->select.sel_info.hslab->span_lst)
- if(H5S_hyper_generate_spans(space) < 0)
+ if(H5S__hyper_generate_spans(space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Indicate that the regular dimensions are no longer valid */
space->select.sel_info.hslab->diminfo_valid = FALSE;
/* Add in the new hyperslab information */
- if(H5S_generate_hyperslab (space, op, start, opt_stride, opt_count, opt_block)<0)
+ if(H5S__generate_hyperslab (space, op, start, opt_stride, opt_count, opt_block)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs")
} /* end if */
else
@@ -7753,7 +7731,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
/* Check args */
if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if (H5S_SCALAR==H5S_GET_EXTENT_TYPE(space))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "hyperslab doesn't support H5S_SCALAR space")
if (H5S_NULL==H5S_GET_EXTENT_TYPE(space))
@@ -7811,38 +7789,37 @@ done:
--------------------------------------------------------------------------*/
hid_t
H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
- const hsize_t stride[], const hsize_t count[], const hsize_t block[])
+ const hsize_t stride[], const hsize_t count[], const hsize_t block[])
{
- H5S_t *space = NULL; /* Dataspace to modify selection of */
- H5S_t *new_space = NULL; /* New dataspace created */
- hid_t ret_value;
+ H5S_t *space; /* Dataspace to modify selection of */
+ H5S_t *new_space = NULL; /* New dataspace created */
+ hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE6("i", "iSs*h*h*h*h", space_id, op, start, stride, count, block);
/* Check args */
- if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
- if(start==NULL || count==NULL)
+ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if(start == NULL || count == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hyperslab not specified")
-
- if(!(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID))
+ if(!(op >= H5S_SELECT_SET && op <= H5S_SELECT_NOTA))
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
/* Copy the first dataspace */
if (NULL == (new_space = H5S_copy (space, TRUE, TRUE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy dataspace")
/* Go modify the selection in the new dataspace */
if (H5S_select_hyperslab(new_space, op, start, stride, count, block)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to set hyperslab selection")
/* Atomize */
- if ((ret_value=H5I_register (H5I_DATASPACE, new_space, TRUE))<0)
+ if((ret_value = H5I_register(H5I_DATASPACE, new_space, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
done:
- if (ret_value<0 && new_space)
+ if(ret_value < 0 && new_space)
H5S_close(new_space);
FUNC_LEAVE_API(ret_value)
@@ -7850,7 +7827,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5S_combine_select
+ * Function: H5S__combine_select
*
* Purpose: Internal version of H5Scombine_select().
*
@@ -7859,35 +7836,36 @@ done:
* Programmer: Quincey Koziol
* Tuesday, October 30, 2001
*
- * Modifications:
+ * Chao Mei
+ * Wednesday, June 29, 2011
*
*-------------------------------------------------------------------------
*/
static H5S_t *
-H5S_combine_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
+H5S__combine_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
{
- H5S_t *new_space=NULL; /* New dataspace generated */
+ H5S_t *new_space = NULL; /* New dataspace generated */
hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */
H5S_t *ret_value; /* return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(space1);
HDassert(space2);
- HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID);
+ HDassert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA);
/* Check that the space selections both have span trees */
if(space1->select.sel_info.hslab->span_lst==NULL)
- if(H5S_hyper_generate_spans(space1)<0)
+ if(H5S__hyper_generate_spans(space1)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree")
if(space2->select.sel_info.hslab->span_lst==NULL)
- if(H5S_hyper_generate_spans(space2)<0)
+ if(H5S__hyper_generate_spans(space2)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, NULL, "dataspace does not have span tree")
/* Copy the first dataspace */
if (NULL == (new_space = H5S_copy (space1, TRUE, TRUE)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy data space")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to copy dataspace")
/* Free the current selection for the new dataspace */
if(H5S_SELECT_RELEASE(new_space)<0)
@@ -7905,14 +7883,14 @@ H5S_combine_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, NULL, "can't clip hyperslab information")
/* Set return value */
- ret_value=new_space;
+ ret_value = new_space;
done:
- if(ret_value==NULL && new_space!=NULL)
+ if(ret_value == NULL && new_space)
H5S_close(new_space);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_combine_select() */
+} /* end H5S__combine_select() */
/*--------------------------------------------------------------------------
@@ -7943,37 +7921,37 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
H5S_t *space1; /* First Dataspace */
H5S_t *space2; /* Second Dataspace */
H5S_t *new_space = NULL; /* New Dataspace */
- hid_t ret_value;
+ hid_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("i", "iSsi", space1_id, op, space2_id);
/* Check args */
- if (NULL == (space1 = (H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
- if (NULL == (space2 = (H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
- if(!(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID))
+ if(NULL == (space1 = (H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if(NULL == (space2 = (H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if(!(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA))
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
/* Check that both dataspaces have the same rank */
- if(space1->extent.rank!=space2->extent.rank)
+ if(space1->extent.rank != space2->extent.rank)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank")
/* Check that both dataspaces have hyperslab selections */
- if(H5S_GET_SELECT_TYPE(space1)!=H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2)!=H5S_SEL_HYPERSLABS)
+ if(H5S_GET_SELECT_TYPE(space1) != H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2) != H5S_SEL_HYPERSLABS)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections")
/* Go combine the dataspaces */
- if ((new_space=H5S_combine_select(space1, op, space2))==NULL)
+ if(NULL == (new_space = H5S__combine_select(space1, op, space2)))
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to create hyperslab selection")
/* Atomize */
- if ((ret_value=H5I_register (H5I_DATASPACE, new_space, TRUE))<0)
+ if((ret_value = H5I_register(H5I_DATASPACE, new_space, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
done:
- if (ret_value<0 && new_space)
+ if(ret_value < 0 && new_space)
H5S_close(new_space);
FUNC_LEAVE_API(ret_value)
@@ -8010,10 +7988,10 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
/* Check that the space selections both have span trees */
if(space1->select.sel_info.hslab->span_lst==NULL)
- if(H5S_hyper_generate_spans(space1)<0)
+ if(H5S__hyper_generate_spans(space1)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
if(space2->select.sel_info.hslab->span_lst==NULL)
- if(H5S_hyper_generate_spans(space2)<0)
+ if(H5S__hyper_generate_spans(space2)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Take ownership of the dataspace's hyperslab spans */
@@ -8038,7 +8016,7 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2)
done:
if(tmp_spans!=NULL)
- H5S_hyper_free_span_info(tmp_spans);
+ H5S__hyper_free_span_info(tmp_spans);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_select() */
@@ -8071,25 +8049,25 @@ H5Sselect_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
{
H5S_t *space1; /* First Dataspace */
H5S_t *space2; /* Second Dataspace */
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE3("e", "iSsi", space1_id, op, space2_id);
/* Check args */
- if (NULL == (space1 = (H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
- if (NULL == (space2 = (H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
- if(!(op>H5S_SELECT_NOOP && op<H5S_SELECT_INVALID))
+ if(NULL == (space1 = (H5S_t *)H5I_object_verify(space1_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if(NULL == (space2 = (H5S_t *)H5I_object_verify(space2_id, H5I_DATASPACE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
+ if(!(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA))
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "invalid selection operation")
/* Check that both dataspaces have the same rank */
- if(space1->extent.rank!=space2->extent.rank)
+ if(space1->extent.rank != space2->extent.rank)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces not same rank")
/* Check that both dataspaces have hyperslab selections */
- if(H5S_GET_SELECT_TYPE(space1)!=H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2)!=H5S_SEL_HYPERSLABS)
+ if(H5S_GET_SELECT_TYPE(space1) != H5S_SEL_HYPERSLABS || H5S_GET_SELECT_TYPE(space2) != H5S_SEL_HYPERSLABS)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspaces don't have hyperslab selections")
/* Go refine the first selection */
@@ -8104,7 +8082,7 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_get_seq_list_gen
+ H5S__hyper_get_seq_list_gen
PURPOSE
Create a list of offsets & lengths for a selection
USAGE
@@ -8133,7 +8111,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
+H5S__hyper_get_seq_list_gen(const H5S_t *space, H5S_sel_iter_t *iter,
size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem,
hsize_t *off, size_t *len)
{
@@ -8157,7 +8135,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
unsigned u; /* Index variable */
int i; /* Index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
@@ -8520,12 +8498,12 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
*nelem = io_used;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5S_hyper_get_seq_list_gen() */
+} /* end H5S__hyper_get_seq_list_gen() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_get_seq_list_opt
+ H5S__hyper_get_seq_list_opt
PURPOSE
Create a list of offsets & lengths for a selection
USAGE
@@ -8554,7 +8532,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter,
+H5S__hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter,
size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem,
hsize_t *off, size_t *len)
{
@@ -8591,7 +8569,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter,
unsigned u; /* Local index variable */
int i; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
@@ -8966,16 +8944,16 @@ loc += fast_dim_buf_off;
*nelem += start_io_left - io_left;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5S_hyper_get_seq_list_opt() */
+} /* end H5S__hyper_get_seq_list_opt() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_get_seq_list_single
+ H5S__hyper_get_seq_list_single
PURPOSE
Create a list of offsets & lengths for a selection
USAGE
- herr_t H5S_hyper_get_seq_list_single(space, flags, iter, maxseq, maxelem, nseq, nelem, off, len)
+ herr_t H5S__hyper_get_seq_list_single(space, flags, iter, maxseq, maxelem, nseq, nelem, off, len)
H5S_t *space; IN: Dataspace containing selection to use.
unsigned flags; IN: Flags for extra information about operation
H5S_sel_iter_t *iter; IN/OUT: Selection iterator describing last
@@ -9001,7 +8979,7 @@ loc += fast_dim_buf_off;
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter,
+H5S__hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter,
size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem,
hsize_t *off, size_t *len)
{
@@ -9024,7 +9002,7 @@ H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter,
unsigned u; /* Local index variable */
int i; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
@@ -9251,16 +9229,16 @@ H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter,
HDassert(*nelem > 0);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5S_hyper_get_seq_list_single() */
+} /* end H5S__hyper_get_seq_list_single() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_get_seq_list
+ H5S__hyper_get_seq_list
PURPOSE
Create a list of offsets & lengths for a selection
USAGE
- herr_t H5S_hyper_get_seq_list(space,flags,iter,maxseq,maxelem,nseq,nelem,off,len)
+ herr_t H5S__hyper_get_seq_list(space,flags,iter,maxseq,maxelem,nseq,nelem,off,len)
H5S_t *space; IN: Dataspace containing selection to use.
unsigned flags; IN: Flags for extra information about operation
H5S_sel_iter_t *iter; IN/OUT: Selection iterator describing last
@@ -9286,13 +9264,13 @@ H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter,
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_get_seq_list(const H5S_t *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter,
+H5S__hyper_get_seq_list(const H5S_t *space, unsigned H5_ATTR_UNUSED flags, H5S_sel_iter_t *iter,
size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem,
hsize_t *off, size_t *len)
{
herr_t ret_value = FAIL; /* return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(space);
@@ -9385,7 +9363,7 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned H5_ATTR_UNUSED flags, H5S_se
len++;
/* Advance the hyperslab iterator */
- H5S_hyper_iter_next(iter, actual_elem);
+ H5S__hyper_iter_next(iter, actual_elem);
/* Decrement the number of elements left in selection */
iter->elmt_left -= actual_elem;
@@ -9419,17 +9397,17 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned H5_ATTR_UNUSED flags, H5S_se
/* Check for single block selection */
if(single_block)
/* Use single-block optimized call to generate sequence list */
- ret_value = H5S_hyper_get_seq_list_single(space, iter, maxseq, maxelem, nseq, nelem, off, len);
+ ret_value = H5S__hyper_get_seq_list_single(space, iter, maxseq, maxelem, nseq, nelem, off, len);
else
/* Use optimized call to generate sequence list */
- ret_value = H5S_hyper_get_seq_list_opt(space, iter, maxseq, maxelem, nseq, nelem, off, len);
+ ret_value = H5S__hyper_get_seq_list_opt(space, iter, maxseq, maxelem, nseq, nelem, off, len);
} /* end if */
else
/* Call the general sequence generator routine */
- ret_value = H5S_hyper_get_seq_list_gen(space, iter, maxseq, maxelem, nseq, nelem, off, len);
+ ret_value = H5S__hyper_get_seq_list_gen(space, iter, maxseq, maxelem, nseq, nelem, off, len);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5S_hyper_get_seq_list() */
+} /* end H5S__hyper_get_seq_list() */
/*--------------------------------------------------------------------------
@@ -9558,7 +9536,7 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
/* Allocate space for the hyperslab selection information (note this sets
* diminfo_valid to FALSE, diminfo arrays to 0, and span list to NULL) */
if((proj_space->select.sel_info.hslab = H5FL_CALLOC(H5S_hyper_sel_t)) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab info")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab info")
/* Set selection type */
proj_space->select.type = H5S_sel_hyper;
@@ -9742,13 +9720,13 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
/* Append complete lower dimension span tree to
* current dimension */
low = curr_span_up_dim[i - 1] % proj_space->extent.size[i - 1];
- if(H5S_hyper_append_span(&prev_span[i - 1], &curr_span_tree[i - 1], low, low, curr_span_tree[i], NULL) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
+ if(H5S__hyper_append_span(&prev_span[i - 1], &curr_span_tree[i - 1], low, low, curr_span_tree[i], NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Reset lower dimension's span tree and previous
* span since we just committed it and will start
* over with a new one */
- if(H5S_hyper_free_span_info(curr_span_tree[i]) < 0)
+ if(H5S__hyper_free_span_info(curr_span_tree[i]) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't free span info")
curr_span_tree[i] = NULL;
prev_span[i] = NULL;
@@ -9767,8 +9745,8 @@ H5S__hyper_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
high = low + (hsize_t)span_len - (hsize_t)1;
/* Append span in lowest dimension */
- if(H5S_hyper_append_span(&prev_span[proj_rank - 1], &curr_span_tree[proj_rank - 1], low, high, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
+ if(H5S__hyper_append_span(&prev_span[proj_rank - 1], &curr_span_tree[proj_rank - 1], low, high, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Update remaining offset and length */
proj_off += (hsize_t)span_len;
@@ -9790,11 +9768,11 @@ loop_end:
/* Append remaining span tree to higher dimension */
low = curr_span_up_dim[i - 1] % proj_space->extent.size[i - 1];
- if(H5S_hyper_append_span(&prev_span[i - 1], &curr_span_tree[i - 1], low, low, curr_span_tree[i], NULL) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
+ if(H5S__hyper_append_span(&prev_span[i - 1], &curr_span_tree[i - 1], low, low, curr_span_tree[i], NULL) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTAPPEND, FAIL, "can't allocate hyperslab span")
/* Reset span tree */
- if(H5S_hyper_free_span_info(curr_span_tree[i]) < 0)
+ if(H5S__hyper_free_span_info(curr_span_tree[i]) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't free span info")
curr_span_tree[i] = NULL;
} /* end if */
@@ -9805,12 +9783,11 @@ loop_end:
curr_span_tree[0] = NULL;
/* Set the number of elements in current selection */
- proj_space->select.num_elem = H5S_hyper_spans_nelem(proj_space->select.sel_info.hslab->span_lst);
+ proj_space->select.num_elem = H5S__hyper_spans_nelem(proj_space->select.sel_info.hslab->span_lst);
/* Attempt to rebuild "optimized" start/stride/count/block information.
* from resulting hyperslab span tree */
- if(H5S_hyper_rebuild(proj_space) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't rebuild hyperslab info")
+ H5S__hyper_rebuild(proj_space);
} /* end if */
else
/* If we did not add anything to proj_space, select none instead */
@@ -9845,7 +9822,7 @@ done:
/* Free span trees */
for(i = 0; i < proj_rank; i++)
if(curr_span_tree[i]) {
- if(H5S_hyper_free_span_info(curr_span_tree[i]) < 0)
+ if(H5S__hyper_free_span_info(curr_span_tree[i]) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't free span info")
curr_span_tree[i] = NULL;
} /* end if */
@@ -9895,14 +9872,14 @@ H5S__hyper_subtract(H5S_t *space, H5S_t *subtract_space)
/* Check that the space selections both have span trees */
if(space->select.sel_info.hslab->span_lst == NULL)
- if(H5S_hyper_generate_spans(space) < 0)
+ if(H5S__hyper_generate_spans(space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
if(subtract_space->select.sel_info.hslab->span_lst == NULL)
- if(H5S_hyper_generate_spans(subtract_space) < 0)
+ if(H5S__hyper_generate_spans(subtract_space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree")
/* Generate lists of spans which overlap and don't overlap */
- if(H5S_hyper_clip_spans(space->select.sel_info.hslab->span_lst, subtract_space->select.sel_info.hslab->span_lst, &a_not_b, &a_and_b, &b_not_a)<0)
+ if(H5S__hyper_clip_spans(space->select.sel_info.hslab->span_lst, subtract_space->select.sel_info.hslab->span_lst, &a_not_b, &a_and_b, &b_not_a)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information")
/* Reset the other dataspace selection information */
@@ -9911,7 +9888,7 @@ H5S__hyper_subtract(H5S_t *space, H5S_t *subtract_space)
/* Allocate space for the hyperslab selection information */
if((space->select.sel_info.hslab = H5FL_CALLOC(H5S_hyper_sel_t)) == NULL)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_NOSPACE, FAIL, "can't allocate hyperslab info")
/* Set unlim_dim */
space->select.sel_info.hslab->unlim_dim = -1;
@@ -9923,12 +9900,11 @@ H5S__hyper_subtract(H5S_t *space, H5S_t *subtract_space)
a_not_b = NULL;
/* Update number of elements */
- space->select.num_elem = H5S_hyper_spans_nelem(space->select.sel_info.hslab->span_lst);
+ space->select.num_elem = H5S__hyper_spans_nelem(space->select.sel_info.hslab->span_lst);
/* Attempt to rebuild "optimized" start/stride/count/block information.
* from resulting hyperslab span tree */
- if(H5S_hyper_rebuild(space) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't rebuild hyperslab info")
+ H5S__hyper_rebuild(space);
} /* end if */
else {
H5S_hyper_span_info_t *spans; /* Empty hyperslab span tree */
@@ -9938,7 +9914,7 @@ H5S__hyper_subtract(H5S_t *space, H5S_t *subtract_space)
/* Allocate a span info node */
if(NULL == (spans = H5FL_MALLOC(H5S_hyper_span_info_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab span")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab span")
/* Set the reference count */
spans->count = 1;
@@ -9956,12 +9932,12 @@ H5S__hyper_subtract(H5S_t *space, H5S_t *subtract_space)
done:
/* Free span trees */
if(a_and_b)
- H5S_hyper_free_span_info(a_and_b);
+ H5S__hyper_free_span_info(a_and_b);
if(b_not_a)
- H5S_hyper_free_span_info(b_not_a);
+ H5S__hyper_free_span_info(b_not_a);
if(a_not_b) {
HDassert(ret_value < 0);
- H5S_hyper_free_span_info(b_not_a);
+ H5S__hyper_free_span_info(b_not_a);
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
@@ -10119,7 +10095,7 @@ H5S_hyper_clip_unlim(H5S_t *space, hsize_t clip_size)
/* Generate span tree in selection */
if(!hslab->span_lst)
- if(H5S_hyper_generate_spans(space) < 0)
+ if(H5S__hyper_generate_spans(space) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to generate span tree")
/* Indicate that the regular dimensions are no longer valid */
@@ -10127,7 +10103,7 @@ H5S_hyper_clip_unlim(H5S_t *space, hsize_t clip_size)
/* "And" selection with calculated block to perform clip operation
*/
- if(H5S_generate_hyperslab(space, H5S_SELECT_AND, start, _ones, _ones, block) < 0)
+ if(H5S__generate_hyperslab(space, H5S_SELECT_AND, start, H5S_hyper_ones_g, H5S_hyper_ones_g, block) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't generate hyperslabs")
} /* end if */
else
@@ -10561,7 +10537,7 @@ H5Sis_regular_hyperslab(hid_t spaceid)
if(H5S_GET_SELECT_TYPE(space) != H5S_SEL_HYPERSLABS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection")
- ret_value = H5S_hyper_is_regular(space);
+ ret_value = H5S__hyper_is_regular(space);
done:
FUNC_LEAVE_API(ret_value)
@@ -10610,7 +10586,7 @@ H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[],
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(H5S_GET_SELECT_TYPE(space) != H5S_SEL_HYPERSLABS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection")
- if(TRUE != H5S_hyper_is_regular(space))
+ if(TRUE != H5S__hyper_is_regular(space))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a regular hyperslab selection")
/* Retrieve hyperslab parameters */
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 46f7a59..5c65119 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -1362,7 +1362,7 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type
case H5S_NO_CLASS:
default:
- HDassert("unknown data space type" && 0);
+ HDassert("unknown dataspace type" && 0);
break;
} /* end switch */
diff --git a/src/H5Snone.c b/src/H5Snone.c
index 160745b..4a7a7a3 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.c
@@ -15,7 +15,7 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Tuesday, November 10, 1998
*
- * Purpose: "None" selection data space I/O functions.
+ * Purpose: "None" selection dataspace I/O functions.
*/
#include "H5Smodule.h" /* This source code file is part of the H5S module */
@@ -47,7 +47,7 @@ static int H5S__none_unlim_dim(const H5S_t *space);
static htri_t H5S_none_is_contiguous(const H5S_t *space);
static htri_t H5S_none_is_single(const H5S_t *space);
static htri_t H5S_none_is_regular(const H5S_t *space);
-static herr_t H5S_none_adjust_u(H5S_t *space, const hsize_t *offset);
+static void H5S_none_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S_none_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S_none_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
static herr_t H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
@@ -746,11 +746,11 @@ H5S_none_is_regular(const H5S_t H5_ATTR_UNUSED *space)
PURPOSE
Adjust an "none" selection by subtracting an offset
USAGE
- herr_t H5S_none_adjust_u(space, offset)
+ void H5S_none_adjust_u(space, offset)
H5S_t *space; IN/OUT: Pointer to dataspace to adjust
const hsize_t *offset; IN: Offset to subtract
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Moves selection by subtracting an offset from it.
GLOBAL VARIABLES
@@ -758,7 +758,7 @@ H5S_none_is_regular(const H5S_t H5_ATTR_UNUSED *space)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static herr_t
+static void
H5S_none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *offset)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -767,7 +767,7 @@ H5S_none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *off
HDassert(space);
HDassert(offset);
- FUNC_LEAVE_NOAPI(FAIL)
+ FUNC_LEAVE_NOAPI_VOID
} /* H5S_none_adjust_u() */
@@ -900,7 +900,7 @@ H5Sselect_none(hid_t spaceid)
/* Check args */
if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Change to "none" selection */
if(H5S_select_none(space) < 0)
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index 75c5e77..f6bd3d1 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -119,7 +119,7 @@ struct H5S_hyper_span_t {
struct H5S_hyper_span_t *next; /* Pointer to next span in list */
};
-/* Information about a list of hyperslab spans */
+/* Information about a list of hyperslab spans in one dimension */
struct H5S_hyper_span_info_t {
unsigned count; /* Ref. count of number of spans which share this span */
struct H5S_hyper_span_info_t *scratch; /* Scratch pointer
@@ -142,9 +142,9 @@ typedef struct {
* are only used for re-gurgitating the original values used to set the
* hyperslab to the application when it queries the hyperslab selection
* information. */
- int unlim_dim; /* Dimension where selection is unlimited, or -1 if none */
- hsize_t num_elem_non_unlim; /* # of elements in a "slice" excluding the unlimited dimension */
- H5S_hyper_span_info_t *span_lst; /* List of hyperslab span information */
+ int unlim_dim; /* Dimension where selection is unlimited, or -1 if none */
+ hsize_t num_elem_non_unlim; /* # of elements in a "slice" excluding the unlimited dimension */
+ H5S_hyper_span_info_t *span_lst; /* List of hyperslab span information */
} H5S_hyper_sel_t;
/* Selection information methods */
@@ -181,7 +181,7 @@ typedef htri_t (*H5S_sel_is_single_func_t)(const H5S_t *space);
/* Method to determine if current selection is "regular" */
typedef htri_t (*H5S_sel_is_regular_func_t)(const H5S_t *space);
/* Method to adjust a selection by an offset */
-typedef herr_t (*H5S_sel_adjust_u_func_t)(H5S_t *space, const hsize_t *offset);
+typedef void (*H5S_sel_adjust_u_func_t)(H5S_t *space, const hsize_t *offset);
/* Method to construct single element projection onto scalar dataspace */
typedef herr_t (*H5S_sel_project_scalar)(const H5S_t *space, hsize_t *offset);
/* Method to construct selection projection onto/into simple dataspace */
@@ -203,7 +203,7 @@ typedef struct {
H5S_sel_deserialize_func_t deserialize; /* Method to store create selection from "serialized" form (a byte sequence suitable for storing on disk) */
H5S_sel_bounds_func_t bounds; /* Method to determine to smallest n-D bounding box containing the current selection */
H5S_sel_offset_func_t offset; /* Method to determine linear offset of initial element in selection within dataspace */
- H5S_sel_unlim_dim_func_t unlim_dim; /* Method to get unlimited dimension of selection (or -1 for none) */
+ H5S_sel_unlim_dim_func_t unlim_dim; /* Method to get unlimited dimension of selection (or -1 for none) */
H5S_sel_num_elem_non_unlim_func_t num_elem_non_unlim; /* Method to get the number of elements in a slice through the unlimited dimension */
H5S_sel_is_contiguous_func_t is_contiguous; /* Method to determine if current selection is contiguous */
H5S_sel_is_single_func_t is_single; /* Method to determine if current selection is a single block */
@@ -217,12 +217,15 @@ typedef struct {
/* Selection information object */
typedef struct {
const H5S_select_class_t *type; /* Pointer to selection's class info */
+
hbool_t offset_changed; /* Indicate that the offset for the selection has been changed */
hssize_t offset[H5S_MAX_RANK]; /* Offset within the extent */
- hsize_t num_elem; /* Number of elements in selection */
+
+ hsize_t num_elem; /* Number of elements in selection */
+
union {
- H5S_pnt_list_t *pnt_lst; /* List of selected points (order is important) */
- H5S_hyper_sel_t *hslab; /* Info about hyperslab selections */
+ H5S_pnt_list_t *pnt_lst; /* Info about list of selected points (order is important) */
+ H5S_hyper_sel_t *hslab; /* Info about hyperslab selection */
} sel_info;
} H5S_select_t;
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index d13dd0a..ab40e44 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -15,7 +15,7 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Tuesday, June 16, 1998
*
- * Purpose: Point selection data space I/O functions.
+ * Purpose: Point selection dataspace I/O functions.
*/
#include "H5Smodule.h" /* This source code file is part of the H5S module */
@@ -48,7 +48,7 @@ static int H5S__point_unlim_dim(const H5S_t *space);
static htri_t H5S_point_is_contiguous(const H5S_t *space);
static htri_t H5S_point_is_single(const H5S_t *space);
static htri_t H5S_point_is_regular(const H5S_t *space);
-static herr_t H5S_point_adjust_u(H5S_t *space, const hsize_t *offset);
+static void H5S_point_adjust_u(H5S_t *space, const hsize_t *offset);
static herr_t H5S_point_project_scalar(const H5S_t *space, hsize_t *offset);
static herr_t H5S_point_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
static herr_t H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
@@ -426,7 +426,7 @@ H5S_point_add(H5S_t *space, H5S_seloper_t op, hsize_t num_elem, const hsize_t *c
/* Insert the list of points selected in the proper place */
if(op == H5S_SELECT_SET || op == H5S_SELECT_PREPEND) {
/* Append current list, if there is one */
- if(space->select.sel_info.pnt_lst->head != NULL)
+ if(NULL != space->select.sel_info.pnt_lst->head)
curr->next = space->select.sel_info.pnt_lst->head;
/* Put new list in point selection */
@@ -687,8 +687,8 @@ static htri_t
H5S_point_is_valid (const H5S_t *space)
{
H5S_pnt_node_t *curr; /* Point information nodes */
- unsigned u; /* Counter */
- htri_t ret_value=TRUE; /* return value */
+ unsigned u; /* Counter */
+ htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -742,7 +742,7 @@ H5Sget_select_elem_npoints(hid_t spaceid)
/* Check args */
if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(H5S_GET_SELECT_TYPE(space) != H5S_SEL_POINTS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an element selection")
@@ -1192,7 +1192,7 @@ H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint,
if(NULL == buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer")
if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
if(H5S_GET_SELECT_TYPE(space) != H5S_SEL_POINTS)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a point selection")
@@ -1234,11 +1234,12 @@ H5S_point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
H5S_pnt_node_t *node; /* Point node */
unsigned rank; /* Dataspace rank */
- unsigned u; /* index variable */
- herr_t ret_value = SUCCEED; /* Return value */
+ unsigned u; /* Local index variable */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
+ /* Sanity check */
HDassert(space);
HDassert(start);
HDassert(end);
@@ -1490,11 +1491,11 @@ H5S_point_is_regular(const H5S_t *space)
PURPOSE
Adjust a "point" selection by subtracting an offset
USAGE
- herr_t H5S_point_adjust_u(space, offset)
+ void H5S_point_adjust_u(space, offset)
H5S_t *space; IN/OUT: Pointer to dataspace to adjust
const hsize_t *offset; IN: Offset to subtract
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Moves a point selection by subtracting an offset from it.
GLOBAL VARIABLES
@@ -1502,7 +1503,7 @@ H5S_point_is_regular(const H5S_t *space)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static herr_t
+static void
H5S_point_adjust_u(H5S_t *space, const hsize_t *offset)
{
H5S_pnt_node_t *node; /* Point node */
@@ -1532,7 +1533,7 @@ H5S_point_adjust_u(H5S_t *space, const hsize_t *offset)
node = node->next;
} /* end while */
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI_VOID
} /* H5S_point_adjust_u() */
@@ -1829,7 +1830,7 @@ H5S_point_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter,
/* Get the dataspace dimensions */
if((ndims = H5S_get_simple_extent_dims (space, dims, NULL)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to retrieve data space dimensions")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to retrieve dataspace dimensions")
/* Walk through the points in the selection, starting at the current */
/* location in the iterator */
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index e8a42e8..f387fe3 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -193,7 +193,7 @@ typedef struct H5S_sel_iter_op_t {
#define H5S_SELECT_ITER_NEXT_BLOCK(ITER) (H5S_select_iter_next_block(ITER))
#define H5S_SELECT_ITER_RELEASE(ITER) (H5S_select_iter_release(ITER))
#endif /* H5S_MODULE */
-/* Handle these two callbacks in a special way, since they have prologs that need to be executed */
+/* Handle these callbacks in a special way, since they have prologs that need to be executed */
#define H5S_SELECT_COPY(DST,SRC,SHARE) (H5S_select_copy(DST,SRC,SHARE))
#define H5S_SELECT_DESERIALIZE(S,BUF) (H5S_select_deserialize(S,BUF))
@@ -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_version(H5F_t *f, H5S_t *ds);
H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc, hid_t fapl_id);
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);
@@ -263,7 +259,7 @@ H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t **p, H5F_t *f);
H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space);
H5_DLL htri_t H5S_select_is_single(const H5S_t *space);
H5_DLL htri_t H5S_select_is_regular(const H5S_t *space);
-H5_DLL herr_t H5S_select_adjust_u(H5S_t *space, const hsize_t *offset);
+H5_DLL void H5S_select_adjust_u(H5S_t *space, const hsize_t *offset);
H5_DLL herr_t H5S_select_project_scalar(const H5S_t *space, hsize_t *offset);
H5_DLL herr_t H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset);
H5_DLL herr_t H5S_select_project_intersection(const H5S_t *src_space,
@@ -282,16 +278,16 @@ H5_DLL herr_t H5S_select_elements(H5S_t *space, H5S_seloper_t op,
hsize_t num_elem, const hsize_t *coord);
/* Operations on hyperslab selections */
-H5_DLL herr_t H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, const hsize_t start[],
+H5_DLL herr_t H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[],
const hsize_t *stride, const hsize_t count[], const hsize_t *block);
H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank,
- hsize_t *coords);
+ const hsize_t *coords);
H5_DLL herr_t H5S_hyper_reset_scratch(H5S_t *space);
H5_DLL herr_t H5S_hyper_convert(H5S_t *space);
#ifdef LATER
H5_DLL htri_t H5S_hyper_intersect (H5S_t *space1, H5S_t *space2);
#endif /* LATER */
-H5_DLL htri_t H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end);
+H5_DLL htri_t H5S_hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end);
H5_DLL herr_t H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset);
H5_DLL htri_t H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset);
H5_DLL herr_t H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset);
diff --git a/src/H5Spublic.h b/src/H5Spublic.h
index 5ed6249..09b474a 100644
--- a/src/H5Spublic.h
+++ b/src/H5Spublic.h
@@ -32,8 +32,8 @@
typedef enum H5S_class_t {
H5S_NO_CLASS = -1, /*error */
H5S_SCALAR = 0, /*scalar variable */
- H5S_SIMPLE = 1, /*simple data space */
- H5S_NULL = 2 /*null data space */
+ H5S_SIMPLE = 1, /*simple dataspace */
+ H5S_NULL = 2 /*null dataspace */
} H5S_class_t;
/* Different ways of combining selections */
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index dbbc927..873f555 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -112,7 +112,7 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset)
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
+H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection)
{
herr_t ret_value = FAIL; /* Return value */
@@ -123,10 +123,10 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection)
HDassert(src);
/* Copy regular fields */
- dst->select=src->select;
+ dst->select = src->select;
/* Perform correct type of copy based on the type of selection */
- if((ret_value=(*src->select.type->copy)(dst,src,share_selection))<0)
+ if((ret_value = (*src->select.type->copy)(dst,src,share_selection)) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy selection specific information")
done:
@@ -148,8 +148,6 @@ done:
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -157,13 +155,15 @@ H5S_select_release(H5S_t *ds)
{
herr_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_NOAPI_NOINIT
HDassert(ds);
/* Call the selection type's release function */
- ret_value=(*ds->select.type->release)(ds);
+ if((ret_value = (*ds->select.type->release)(ds)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection")
+done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_release() */
@@ -183,8 +183,6 @@ H5S_select_release(H5S_t *ds)
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -194,13 +192,15 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags,
{
herr_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_NOAPI_NOINIT
HDassert(space);
/* Call the selection type's get_seq_list function */
- ret_value = (*space->select.type->get_seq_list)(space, flags, iter, maxseq, maxbytes, nseq, nbytes, off, len);
+ if((ret_value = (*space->select.type->get_seq_list)(space, flags, iter, maxseq, maxbytes, nseq, nbytes, off, len)) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get selection sequence list")
+done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_select_get_seq_list() */
@@ -220,8 +220,6 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags,
* pattern, don't call it directly, use the appropriate macro
* defined in H5Sprivate.h.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
hssize_t
@@ -896,11 +894,11 @@ H5S_select_is_regular(const H5S_t *space)
PURPOSE
Adjust a selection by subtracting an offset
USAGE
- herr_t H5S_select_adjust_u(space, offset)
+ void H5S_select_adjust_u(space, offset)
H5S_t *space; IN/OUT: Pointer to dataspace to adjust
const hsize_t *offset; IN: Offset to subtract
RETURNS
- Non-negative on success, negative on failure
+ None
DESCRIPTION
Moves a selection by subtracting an offset from it.
GLOBAL VARIABLES
@@ -911,19 +909,18 @@ H5S_select_is_regular(const H5S_t *space)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+void
H5S_select_adjust_u(H5S_t *space, const hsize_t *offset)
{
- herr_t ret_value = FAIL; /* Return value */
-
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
HDassert(space);
+ HDassert(offset);
- ret_value = (*space->select.type->adjust_u)(space, offset);
+ (*space->select.type->adjust_u)(space, offset);
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI_VOID
} /* H5S_select_adjust_u() */
@@ -1611,8 +1608,8 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
{
H5S_sel_iter_t *iter_a = NULL; /* Selection a iteration info */
H5S_sel_iter_t *iter_b = NULL; /* Selection b iteration info */
- hbool_t iter_a_init = 0; /* Selection a iteration info has been initialized */
- hbool_t iter_b_init = 0; /* Selection b iteration info has been initialized */
+ hbool_t iter_a_init = FALSE; /* Selection a iteration info has been initialized */
+ hbool_t iter_b_init = FALSE; /* Selection b iteration info has been initialized */
htri_t ret_value = TRUE; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1621,13 +1618,13 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
HDassert(space1);
HDassert(space2);
- /* Special case for one or both dataspaces being scalar */
- if(space1->extent.rank == 0 || space2->extent.rank == 0) {
- /* Check for different number of elements selected */
- if(H5S_GET_SELECT_NPOINTS(space1) != H5S_GET_SELECT_NPOINTS(space2))
- HGOTO_DONE(FALSE)
- } /* end if */
- else {
+ /* Check for different number of elements selected */
+ if(H5S_GET_SELECT_NPOINTS(space1) != H5S_GET_SELECT_NPOINTS(space2))
+ HGOTO_DONE(FALSE)
+
+ /* Check special cases if both dataspaces aren't scalar */
+ /* (If only one is, the number of selected points check is sufficient) */
+ if(space1->extent.rank > 0 && space2->extent.rank > 0) {
const H5S_t *space_a; /* Dataspace with larger rank */
const H5S_t *space_b; /* Dataspace with smaller rank */
unsigned space_a_rank; /* Number of dimensions of dataspace A */
@@ -1697,7 +1694,7 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
space_b_dim--;
} /* end while */
- /* Since we are selecting the entire spaces, we must also verify that space_a
+ /* Since we are selecting the entire space, we must also verify that space_a
* has size 1 in all dimensions that it does not share with space_b.
*/
while(space_a_dim >= 0) {
@@ -1708,6 +1705,7 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
} /* end while */
} /* end if */
else if((H5S_GET_SELECT_TYPE(space1) == H5S_SEL_NONE) || (H5S_GET_SELECT_TYPE(space2) == H5S_SEL_NONE)) {
+ /* (Both must be, at this point, if one is) */
HGOTO_DONE(TRUE)
} /* end if */
else if((H5S_GET_SELECT_TYPE(space_a) == H5S_SEL_HYPERSLABS && space_a->select.sel_info.hslab->diminfo_valid)
@@ -1747,13 +1745,13 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
} /* end if */
/* Iterate through all the blocks in the selection */
else {
- hsize_t start_a[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace a */
- hsize_t start_b[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace b */
- hsize_t end_a[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace a */
- hsize_t end_b[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace b */
- hsize_t off_a[H5O_LAYOUT_NDIMS]; /* Offset of selection a blocks */
- hsize_t off_b[H5O_LAYOUT_NDIMS]; /* Offset of selection b blocks */
- hbool_t first_block = TRUE; /* Flag to indicate the first block */
+ hsize_t start_a[H5S_MAX_RANK]; /* Start point of selection block in dataspace a */
+ hsize_t start_b[H5S_MAX_RANK]; /* Start point of selection block in dataspace b */
+ hsize_t end_a[H5S_MAX_RANK]; /* End point of selection block in dataspace a */
+ hsize_t end_b[H5S_MAX_RANK]; /* End point of selection block in dataspace b */
+ hsize_t off_a[H5S_MAX_RANK]; /* Offset of selection a blocks */
+ hsize_t off_b[H5S_MAX_RANK]; /* Offset of selection b blocks */
+ hbool_t first_block = TRUE; /* Flag to indicate the first block */
/* Allocate the selection iterators */
if(NULL == (iter_a = H5FL_MALLOC(H5S_sel_iter_t)))
@@ -1768,10 +1766,10 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
*/
if(H5S_select_iter_init(iter_a, space_a, (size_t)0) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator a")
- iter_a_init = 1;
+ iter_a_init = TRUE;
if(H5S_select_iter_init(iter_b, space_b, (size_t)0) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator b")
- iter_b_init = 1;
+ iter_b_init = TRUE;
/* Iterate over all the blocks in each selection */
while(1) {
@@ -1874,7 +1872,7 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
} /* end else */
} /* end while */
} /* end else */
- } /* end else */
+ } /* end if */
done:
if(iter_a_init && H5S_SELECT_ITER_RELEASE(iter_a) < 0)
@@ -1900,7 +1898,7 @@ done:
topologically identical to that in b (as verified by
H5S_select_shape_same().
- This function exists, as some I/O code chokes of topologically
+ This function exists, as some I/O code chokes on topologically
identical selections with different ranks. At least to begin
with, we will deal with the issue by constructing projections
of the memory dataspace with ranks equaling those of the file
@@ -2150,10 +2148,9 @@ H5S_select_construct_projection(const H5S_t *base_space, H5S_t **new_space_ptr,
done:
/* Cleanup on error */
- if(ret_value < 0) {
+ if(ret_value < 0)
if(new_space && H5S_close(new_space) < 0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace")
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_select_construct_projection() */
@@ -2281,7 +2278,7 @@ done:
H5S_t *src_space; IN: Selection that is mapped to dst_space, and intersected with src_intersect_space
H5S_t *dst_space; IN: Selection that is mapped to src_space, and which contains the result
H5S_t *src_intersect_space; IN: Selection whose intersection with src_space is projected to dst_space to obtain the result
- H5S_t *proj_space; OUT: Will contain the result (intersection of src_intersect_space and src_space projected from src_space to dst_space) after the operation
+ H5S_t **new_space_ptr; OUT: Will contain the result (intersection of src_intersect_space and src_space projected from src_space to dst_space) after the operation
RETURNS
Non-negative on success/Negative on failure.
@@ -2290,7 +2287,7 @@ done:
Projects the intersection of of the selections of src_space and
src_intersect_space within the selection of src_space as a selection
within the selection of dst_space. The result is placed in the
- selection of proj_space.
+ selection of new_space_ptr.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
@@ -2352,10 +2349,9 @@ H5S_select_project_intersection(const H5S_t *src_space, const H5S_t *dst_space,
done:
/* Cleanup on error */
- if(ret_value < 0) {
+ if(ret_value < 0)
if(new_space && H5S_close(new_space) < 0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace")
- } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_select_project_intersection() */
@@ -2408,28 +2404,26 @@ H5S_select_subtract(H5S_t *space, H5S_t *subtract_space)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
} /* end if */
else {
- /* Check for point selection in subtract_space, convert to
- * hyperslab */
+ /* Check for point selection in subtract_space, convert to hyperslab */
if(subtract_space->select.type->type == H5S_SEL_POINTS)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "point selections not currently supported")
- /* Check for point or all selection in space, convert to hyperslab
- */
+ /* Check for point or all selection in space, convert to hyperslab */
if(space->select.type->type == H5S_SEL_ALL) {
/* Convert current "all" selection to "real" hyperslab selection */
/* Then allow operation to proceed */
- hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
- hsize_t tmp_stride[H5O_LAYOUT_NDIMS]; /* Temporary stride information */
- hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary count information */
- hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
- unsigned i; /* Local index variable */
+ hsize_t tmp_start[H5S_MAX_RANK]; /* Temporary start information */
+ hsize_t tmp_stride[H5S_MAX_RANK]; /* Temporary stride information */
+ hsize_t tmp_count[H5S_MAX_RANK]; /* Temporary count information */
+ hsize_t tmp_block[H5S_MAX_RANK]; /* Temporary block information */
+ unsigned u; /* Local index variable */
/* Fill in temporary information for the dimensions */
- for(i = 0; i < space->extent.rank; i++) {
- tmp_start[i] = 0;
- tmp_stride[i] = 1;
- tmp_count[i] = 1;
- tmp_block[i] = space->extent.size[i];
+ for(u = 0; u < space->extent.rank; u++) {
+ tmp_start[u] = 0;
+ tmp_stride[u] = 1;
+ tmp_count[u] = 1;
+ tmp_block[u] = space->extent.size[u];
} /* end for */
/* Convert to hyperslab selection */
diff --git a/src/H5T.c b/src/H5T.c
index d85d20f..f848ceb 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);
/*****************************/
@@ -539,10 +545,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 */
}};
@@ -739,7 +745,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
@@ -1011,24 +1017,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
@@ -1039,221 +1045,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 */
/*
@@ -1261,7 +1267,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();
@@ -1289,20 +1295,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);
@@ -1378,27 +1384,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 */
@@ -1652,14 +1672,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:
@@ -1668,9 +1688,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;
@@ -1689,21 +1709,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() */
@@ -1784,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.
*
@@ -2166,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:
@@ -2195,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() */
@@ -2249,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
@@ -2267,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 */
@@ -2278,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);
@@ -2291,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")
/*
@@ -2321,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++;
/*
@@ -2329,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; i<H5T_g.npaths; i++) {
+ for(i = 1; i < H5T_g.npaths; i++) {
old_path = H5T_g.path[i];
HDassert(old_path);
/* Does the new soft conversion function apply to this path? */
- if (old_path->is_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)))
@@ -2361,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;
@@ -2372,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 */
@@ -2400,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)
@@ -2412,7 +2490,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_register() */
+} /* end H5T__register() */
/*-------------------------------------------------------------------------
@@ -2436,10 +2514,11 @@ 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 */
herr_t ret_value = SUCCEED; /*return value */
FUNC_ENTER_API(FAIL)
@@ -2457,8 +2536,12 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id,
if(!func)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified")
+ /* 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:
@@ -2467,34 +2550,30 @@ done:
/*-------------------------------------------------------------------------
- * 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) {
@@ -2507,7 +2586,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));
@@ -2526,7 +2605,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
@@ -2544,25 +2623,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() */
/*-------------------------------------------------------------------------
@@ -2583,7 +2671,7 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2597,7 +2685,7 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id,
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")
- 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:
@@ -2641,14 +2729,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)
@@ -2687,7 +2775,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:
@@ -2739,11 +2827,14 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf,
if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list")
+ /* 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:
@@ -2937,7 +3028,7 @@ H5T_decode(size_t buf_size, 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_size, buf)))
+ if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, NULL, H5O_DTYPE_ID, buf_size, buf)))
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object")
/* Mark datatype as being in memory now */
@@ -2997,7 +3088,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;
@@ -3488,7 +3579,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
*
@@ -3507,25 +3598,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));
@@ -3540,7 +3612,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;
@@ -3575,7 +3647,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;
@@ -3585,15 +3657,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
*
*-------------------------------------------------------------------------
*/
@@ -3604,40 +3748,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 */
@@ -3645,18 +3798,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)
@@ -3664,7 +3814,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
@@ -3687,19 +3837,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);
@@ -3707,8 +3853,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 */
@@ -3716,7 +3862,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;
@@ -3730,12 +3876,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:
@@ -3760,20 +3905,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;
@@ -3813,8 +3958,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;
@@ -3826,11 +3970,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:
@@ -3839,14 +3983,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) {
@@ -3854,17 +4000,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() */
/*-------------------------------------------------------------------------
@@ -4360,6 +4506,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
@@ -4373,30 +4566,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 */
@@ -4409,7 +4591,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);
@@ -4427,12 +4609,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 */
@@ -4486,7 +4669,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) {
@@ -4509,22 +4692,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 */
@@ -4534,8 +4722,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)
@@ -4543,21 +4733,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
@@ -4588,24 +4789,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) {
@@ -4636,9 +4846,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)
@@ -4647,7 +4857,7 @@ done:
H5I_dec_ref(dst_id);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5T_path_find() */
+} /* end H5T__path_find_real() */
/*-------------------------------------------------------------------------
@@ -4742,7 +4952,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
@@ -4757,22 +4967,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() */
/*-------------------------------------------------------------------------
@@ -4788,64 +4998,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() */
/*-------------------------------------------------------------------------
@@ -5025,7 +5213,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)
@@ -5524,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..d239e09 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);
}
@@ -262,8 +266,7 @@ H5TS_cancel_count_inc(void)
cancel_counter = (H5TS_cancel_t *)HDcalloc(1, sizeof(H5TS_cancel_t));
if (!cancel_counter) {
- H5E_push_stack(NULL, "H5TS_cancel_count_inc", __FILE__, __LINE__,
- H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
+ HERROR(H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
return FAIL;
}
@@ -356,6 +359,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 +433,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 +479,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 cd0597c..4e4a551 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,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -126,12 +130,12 @@ 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")
+ /* 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:
@@ -154,14 +158,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 +173,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 +187,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 +200,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 +208,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 +219,7 @@ done:
} /* end if */
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI_VOL(ret_value)
} /* end H5T__commit_named() */
@@ -245,7 +247,6 @@ 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 */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -264,30 +265,61 @@ 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")
+ /* 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:
+ 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 +336,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 */
@@ -361,10 +393,10 @@ 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)
- 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)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message")
+ 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) < 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 */
if(H5O_loc_copy(&(type->oloc), &temp_oloc, H5_COPY_SHALLOW) < 0)
@@ -397,11 +429,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 */
@@ -485,7 +517,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 */
@@ -495,7 +527,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:
@@ -520,65 +552,36 @@ 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 */
+ 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")
+ /* 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);
FUNC_LEAVE_API(ret_value)
} /* end H5Topen2() */
@@ -589,6 +592,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().
@@ -603,11 +609,9 @@ 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 */
+ hid_t ret_value = FAIL; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("i", "i", dtype_id);
@@ -616,28 +620,146 @@ 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 */
+ if(status > 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")
- /* 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")
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Tget_create_plist() */
- /* Retrieve any object creation properties */
- if(H5O_get_create_plist(&type->oloc, H5AC_ind_read_dxpl_id, new_plist) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info")
- } /* end if */
+
+/*-------------------------------------------------------------------------
+ * 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")
+
+ /* Set up collective metadata if appropriate */
+ if(H5CX_set_loc(type_id) < 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:
+ 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 */
+ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(type_id) < 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:
+ 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;
@@ -648,8 +770,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() */
/*-------------------------------------------------------------------------
@@ -667,7 +855,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;
@@ -683,7 +871,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 */
@@ -770,7 +958,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5T_open_oid
+ * Function: H5T__open_oid
*
* Purpose: Open a named datatype.
*
@@ -784,12 +972,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);
@@ -798,7 +986,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 */
@@ -823,8 +1011,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() */
/*-------------------------------------------------------------------------
@@ -852,3 +1040,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..feece57 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 */
@@ -215,23 +216,27 @@ H5Tget_member_type(hid_t type_id, unsigned membno)
H5T_t *memb_dt = NULL; /* Member datatype */
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")
+
+ /* 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")
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..13d2f5f 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 */
@@ -114,9 +115,12 @@ 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 up collective metadata if appropriate */
+ if(H5CX_set_loc(loc_id) < 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:
@@ -144,60 +148,31 @@ 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;
+ 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")
/* 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")
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..c9ad01a 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,40 @@ 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 */
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")
+ /* 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")
- if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND
- && direction!=H5T_DIR_DESCEND)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value")
+ /* 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")
- 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")
+ /* 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")
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 +123,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 +146,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 +166,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 +183,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 +202,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 +212,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 +240,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 +269,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 +307,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 +338,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 +357,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 +371,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 +413,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 +426,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 +452,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 +464,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 +488,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 +513,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 +531,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 +548,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 +649,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 +672,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 +689,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 +774,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 +798,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 +807,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 +860,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 +885,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 f05c021..96132b0 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 */
@@ -427,856 +440,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 61e7c79..8051b6d 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..f68fbce 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 <H5Z_FILTER_RESERVED
@@ -377,13 +381,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Z_unregister(H5Z_filter_t filter_id)
+H5Z__unregister(H5Z_filter_t filter_id)
{
size_t filter_index; /* Local index variable for filter */
- H5Z_object_t object;
+ H5Z_object_t object; /* Object to pass to callbacks */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_PACKAGE_VOL
HDassert(filter_id>=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,18 +577,58 @@ 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;
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)) {
+
+/* 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")
} /* end if */
@@ -791,10 +838,10 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type
size_t u; /* Local index variable */
/* Create a dataspace for a chunk & set the extent */
- for (u = 0; u < dcpl_layout->u.chunk.ndims; u++)
+ for(u = 0; u < dcpl_layout->u.chunk.ndims; u++)
chunk_dims[u] = dcpl_layout->u.chunk.dim[u];
- if (NULL == (space = H5S_create_simple(dcpl_layout->u.chunk.ndims, chunk_dims, NULL)))
- HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
+ if(NULL == (space = H5S_create_simple(dcpl_layout->u.chunk.ndims, chunk_dims, NULL)))
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
/* Get ID for dataspace to pass to filter routines */
if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) {
@@ -1448,7 +1495,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_all_filters_avail() */
-
/*-------------------------------------------------------------------------
* Function: H5Z_delete
@@ -1479,7 +1525,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..c0afc38 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)
@@ -888,7 +888,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get dataspace */
if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Get total number of elements in the chunk */
if((npoints = H5S_GET_EXTENT_NPOINTS(ds)) < 0)
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 58bcf8b..d139696 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)
@@ -890,7 +890,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get dataspace */
if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Get total number of elements in the chunk */
if((npoints = H5S_GET_EXTENT_NPOINTS(ds)) < 0)
@@ -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/H5Zszip.c b/src/H5Zszip.c
index 0c60239..8ed173e 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -186,7 +186,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get dataspace */
if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Get dimensions for dataspace */
if((ndims = H5S_get_simple_extent_dims(ds, dims, NULL)) < 0)
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..6334f39 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1987,6 +1987,11 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
#define H5_PACKAGE_INIT(pkg_init, err)
#endif /* H5_MY_PKG */
+/* Forward declaration of H5CXpush() / H5CXpop() */
+/* (Including H5CXprivate.h creates bad circular dependencies - QAK, 3/18/2018) */
+H5_DLL herr_t H5CX_push(void);
+H5_DLL herr_t H5CX_pop(void);
+
#ifndef NDEBUG
#define FUNC_ENTER_CHECK_NAME(asrt) \
@@ -2026,7 +2031,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/* Local variables for API routines */
#define FUNC_ENTER_API_VARS \
MPE_LOG_VARS \
- H5TRACE_DECL
+ H5TRACE_DECL \
#define FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_VARS \
@@ -2047,6 +2052,10 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/* Push the name of this function on the function stack */ \
H5_PUSH_FUNC \
\
+ /* Push the API context */ \
+ if(H5CX_push() < 0) \
+ HGOTO_ERROR(H5E_FUNC, H5E_CANTSET, err, "can't set API context") \
+ \
BEGIN_MPE_LOG
/* Use this macro for all "normal" API functions */
@@ -2069,7 +2078,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/*
* Use this macro for API functions that shouldn't perform _any_ initialization
* of the library or an interface, just perform tracing, etc. Examples
- * are: H5check_version, etc.
+ * are: H5allocate_memory, H5is_library_threadsafe, etc.
*
*/
#define FUNC_ENTER_API_NOINIT {{ \
@@ -2168,23 +2177,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 +2199,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 +2213,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 +2238,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 +2258,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) {
@@ -2256,11 +2291,15 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
H5_API_UNLOCK \
H5_API_SET_CANCEL
-#define FUNC_LEAVE_API(ret_value) \
+#define FUNC_LEAVE_API_COMMON(ret_value) \
; \
} /*end scope from end of FUNC_ENTER*/ \
FINISH_MPE_LOG \
- H5TRACE_RETURN(ret_value); \
+ H5TRACE_RETURN(ret_value);
+
+#define FUNC_LEAVE_API(ret_value) \
+ FUNC_LEAVE_API_COMMON(ret_value); \
+ (void)H5CX_pop(); \
H5_POP_FUNC \
if(err_occurred) \
(void)H5E_dump_api_stack(TRUE); \
@@ -2268,12 +2307,19 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
return(ret_value); \
}} /*end scope from beginning of FUNC_ENTER*/
-/* Use this macro to match the FUNC_ENTER_API_NOFS macro */
+/* Use this macro to match the FUNC_ENTER_API_NOINIT macro */
+#define FUNC_LEAVE_API_NOINIT(ret_value) \
+ FUNC_LEAVE_API_COMMON(ret_value); \
+ H5_POP_FUNC \
+ if(err_occurred) \
+ (void)H5E_dump_api_stack(TRUE); \
+ FUNC_LEAVE_API_THREADSAFE \
+ return(ret_value); \
+}} /*end scope from beginning of FUNC_ENTER*/
+
+/* Use this macro to match the FUNC_ENTER_API_NOINIT_NOERR_NOFS macro */
#define FUNC_LEAVE_API_NOFS(ret_value) \
- ; \
- } /*end scope from end of FUNC_ENTER*/ \
- FINISH_MPE_LOG \
- H5TRACE_RETURN(ret_value); \
+ FUNC_LEAVE_API_COMMON(ret_value); \
FUNC_LEAVE_API_THREADSAFE \
return(ret_value); \
}} /*end scope from beginning of FUNC_ENTER*/
@@ -2285,6 +2331,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 +2357,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*/ \
- 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*/
+
+/* 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*/ \
+ H5AC_tag(prev_tag, NULL); \
H5_POP_FUNC \
return(ret_value); \
} /*end scope from beginning of FUNC_ENTER*/
@@ -2566,15 +2627,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 +2650,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/H5trace.c b/src/H5trace.c
index 32e05a7..eef268c 100644
--- a/src/H5trace.c
+++ b/src/H5trace.c
@@ -1304,7 +1304,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case H5I_DATASPACE:
HDfprintf(out, "%ld (dspace)", (long)obj);
- /* Save the rank of simple data spaces for arrays */
+ /* Save the rank of simple dataspaces for arrays */
/* This may generate recursive call to the library... -QAK */
{
H5S_t *space;
diff --git a/src/Makefile.am b/src/Makefile.am
index d8d2cc2..21f3966 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 \