[svn-r27222] Merge of r27035-27221 from the trunk.

Tested on 64-bit linux VM:
    Serial: C++ and Fortran 2003
    Parallel: Fortran
This commit is contained in:
Dana Robinson 2015-06-17 06:48:34 -05:00
commit fb27787c2a
329 changed files with 8995 additions and 10790 deletions

View File

@ -412,24 +412,6 @@ else (CMAKE_BUILD_TYPE MATCHES Debug)
endif (HDF5_ENABLE_TRACE)
endif (CMAKE_BUILD_TYPE MATCHES Debug)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common")
else (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif (CMAKE_BUILD_TYPE MATCHES Debug)
endif (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common")
else (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif (CMAKE_BUILD_TYPE MATCHES Debug)
endif (CMAKE_COMPILER_IS_GNUCXX)
#-----------------------------------------------------------------------------
# Option to embed library info into executables
#-----------------------------------------------------------------------------
@ -438,210 +420,7 @@ if (HDF5_ENABLE_EMBEDDED_LIBINFO)
set (H5_HAVE_EMBEDDED_LIBINFO 1)
endif (HDF5_ENABLE_EMBEDDED_LIBINFO)
#-----------------------------------------------------------------------------
# Option to allow the user to disable compiler warnings
#-----------------------------------------------------------------------------
option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
if (HDF5_DISABLE_COMPILER_WARNINGS)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
if (MSVC)
set (HDF5_WARNINGS_BLOCKED 1)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
endif (MSVC)
if (WIN32)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
endif (WIN32)
# Borland uses -w- to suppress warnings.
if (BORLAND)
set (HDF5_WARNINGS_BLOCKED 1)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
endif (BORLAND)
# Most compilers use -w to suppress warnings.
if (NOT HDF5_WARNINGS_BLOCKED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif (NOT HDF5_WARNINGS_BLOCKED)
endif (HDF5_DISABLE_COMPILER_WARNINGS)
#-----------------------------------------------------------------------------
# CDash is configured to only allow 3000 warnings, so
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
if (NOT MSVC)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline")
else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP")
endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# Append warning flags
# Don't use the '-Wtraditional' flag, we're way past having K&R C code
# set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional")
# Don't use the '-Wtraditional-conversion' flag, there's too many warnings
# from GCC's assert macro
# set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion")
# Append warning flags from gcc-3* case
# (don't use -Wpadded flag for normal builds, many of the warnings its
# issuing can't be fixed and they are making it hard to detect other,
# more important warnings)
#set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded")
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute")
# Append warning flags from gcc-3.2* case
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization")
# Enable more format checking flags, beyond the basic -Wformat included
# in -Wall
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2")
# The "unreachable code" warning appears to be reliable now...
# (this warning was removed in gcc 4.5+)
#set (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code")
# Append warning flags from gcc-3.3* case
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels")
# Append warning flags from gcc-3.4* case
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch")
# Append more extra warning flags that only gcc4.0+ know about
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros")
# Append more extra warning flags that only gcc 4.1+ know about
set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat")
# Append more extra warning flags that only gcc 4.2+ know about
set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow")
# Append more extra warning flags that only gcc 4.3+ know about
#
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... -QAK
set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla")
# Append more extra warning flags that only gcc 4.4+ know about
set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
# Append more extra warning flags that only gcc 4.5+ know about
set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
# Append more extra warning flags that only gcc 4.6+ know about
set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines")
# Append more extra warning flags that only gcc 4.7+ know about
set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn")
endif (NOT MSVC)
#-----------------------------------------------------------------------------
# Option to allow the user to enable all warnings
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF)
if (HDF5_ENABLE_ALL_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}")
endif (MSVC)
endif (HDF5_ENABLE_ALL_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF)
if (HDF5_ENABLE_GROUPZERO_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic")
endif (MSVC)
endif (HDF5_ENABLE_GROUPZERO_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF)
if (HDF5_ENABLE_GROUPONE_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}")
endif (MSVC)
endif (HDF5_ENABLE_GROUPONE_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF)
if (HDF5_ENABLE_GROUPTWO_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}")
endif (MSVC)
endif (HDF5_ENABLE_GROUPTWO_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF)
if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}")
endif (MSVC)
endif (HDF5_ENABLE_GROUPTHREE_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
if (NOT MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}")
endif (NOT MSVC)
endif (HDF5_ENABLE_GROUPFOUR_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF)
if (HDF5_ENABLE_GROUPFIVE_WARNINGS)
if (NOT MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}")
endif (NOT MSVC)
endif (HDF5_ENABLE_GROUPFIVE_WARNINGS)
#-----------------------------------------------------------------------------
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif (CMAKE_COMPILER_IS_GNUCXX)
include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake)
#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories

108
MANIFEST
View File

@ -1108,6 +1108,7 @@
./testpar/t_pshutdown.c
./testpar/t_prestart.c
./testpar/t_span_tree.c
./testpar/t_init_term.c
./testpar/testpar.h
./testpar/testphdf5.c
./testpar/testphdf5.h
@ -1631,60 +1632,60 @@
./tools/h5dump/errfiles/tslink-D.err
# h5dump packed bits validation
./tools/testfiles/tnofilename-with-packed-bits.ddl
./tools/testfiles/tpbitsLengthPositive.ddl
./tools/testfiles/tpbitsMaxExceeded.ddl
./tools/testfiles/tpbitsSigned.ddl
./tools/testfiles/tpbitsSigned2.ddl
./tools/testfiles/tpbitsSigned4.ddl
./tools/testfiles/tpbitsSignedWhole.ddl
./tools/testfiles/tpbitsSignedInt.ddl
./tools/testfiles/tpbitsSignedInt4.ddl
./tools/testfiles/tpbitsSignedInt8.ddl
./tools/testfiles/tpbitsSignedIntWhole.ddl
./tools/testfiles/tpbitsSignedLong.ddl
./tools/testfiles/tpbitsSignedLong8.ddl
./tools/testfiles/tpbitsSignedLong16.ddl
./tools/testfiles/tpbitsSignedLongWhole.ddl
./tools/testfiles/tpbitsSignedLongLong.ddl
./tools/testfiles/tpbitsSignedLongLong16.ddl
./tools/testfiles/tpbitsSignedLongLong32.ddl
./tools/testfiles/tpbitsSignedLongLongWhole.ddl
./tools/testfiles/tpbitsSignedLongLongWhole1.ddl
./tools/testfiles/tpbitsSignedLongLongWhole63.ddl
./tools/testfiles/tpbitsOffsetNegative.ddl
./tools/testfiles/tpbitsUnsigned.ddl
./tools/testfiles/tpbitsUnsigned2.ddl
./tools/testfiles/tpbitsUnsigned4.ddl
./tools/testfiles/tpbitsUnsignedWhole.ddl
./tools/testfiles/tpbitsUnsignedInt.ddl
./tools/testfiles/tpbitsUnsignedInt4.ddl
./tools/testfiles/tpbitsUnsignedInt8.ddl
./tools/testfiles/tpbitsUnsignedIntWhole.ddl
./tools/testfiles/tpbitsUnsignedLong.ddl
./tools/testfiles/tpbitsUnsignedLong8.ddl
./tools/testfiles/tpbitsUnsignedLong16.ddl
./tools/testfiles/tpbitsUnsignedLongWhole.ddl
./tools/testfiles/tpbitsUnsignedLongLong.ddl
./tools/testfiles/tpbitsUnsignedLongLong16.ddl
./tools/testfiles/tpbitsUnsignedLongLong32.ddl
./tools/testfiles/tpbitsUnsignedLongLongWhole.ddl
./tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl
./tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl
./tools/testfiles/tpbitsMax.ddl
./tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
./tools/testfiles/pbits/tpbitsLengthPositive.ddl
./tools/testfiles/pbits/tpbitsMaxExceeded.ddl
./tools/testfiles/pbits/tpbitsSigned.ddl
./tools/testfiles/pbits/tpbitsSigned2.ddl
./tools/testfiles/pbits/tpbitsSigned4.ddl
./tools/testfiles/pbits/tpbitsSignedWhole.ddl
./tools/testfiles/pbits/tpbitsSignedInt.ddl
./tools/testfiles/pbits/tpbitsSignedInt4.ddl
./tools/testfiles/pbits/tpbitsSignedInt8.ddl
./tools/testfiles/pbits/tpbitsSignedIntWhole.ddl
./tools/testfiles/pbits/tpbitsSignedLong.ddl
./tools/testfiles/pbits/tpbitsSignedLong8.ddl
./tools/testfiles/pbits/tpbitsSignedLong16.ddl
./tools/testfiles/pbits/tpbitsSignedLongWhole.ddl
./tools/testfiles/pbits/tpbitsSignedLongLong.ddl
./tools/testfiles/pbits/tpbitsSignedLongLong16.ddl
./tools/testfiles/pbits/tpbitsSignedLongLong32.ddl
./tools/testfiles/pbits/tpbitsSignedLongLongWhole.ddl
./tools/testfiles/pbits/tpbitsSignedLongLongWhole1.ddl
./tools/testfiles/pbits/tpbitsSignedLongLongWhole63.ddl
./tools/testfiles/pbits/tpbitsOffsetNegative.ddl
./tools/testfiles/pbits/tpbitsUnsigned.ddl
./tools/testfiles/pbits/tpbitsUnsigned2.ddl
./tools/testfiles/pbits/tpbitsUnsigned4.ddl
./tools/testfiles/pbits/tpbitsUnsignedWhole.ddl
./tools/testfiles/pbits/tpbitsUnsignedInt.ddl
./tools/testfiles/pbits/tpbitsUnsignedInt4.ddl
./tools/testfiles/pbits/tpbitsUnsignedInt8.ddl
./tools/testfiles/pbits/tpbitsUnsignedIntWhole.ddl
./tools/testfiles/pbits/tpbitsUnsignedLong.ddl
./tools/testfiles/pbits/tpbitsUnsignedLong8.ddl
./tools/testfiles/pbits/tpbitsUnsignedLong16.ddl
./tools/testfiles/pbits/tpbitsUnsignedLongWhole.ddl
./tools/testfiles/pbits/tpbitsUnsignedLongLong.ddl
./tools/testfiles/pbits/tpbitsUnsignedLongLong16.ddl
./tools/testfiles/pbits/tpbitsUnsignedLongLong32.ddl
./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole.ddl
./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole1.ddl
./tools/testfiles/pbits/tpbitsUnsignedLongLongWhole63.ddl
./tools/testfiles/pbits/tpbitsMax.ddl
./tools/testfiles/pbits/tpbitsArray.ddl
./tools/testfiles/pbits/tpbitsCompound.ddl
./tools/testfiles/pbits/tpbitsIncomplete.ddl
./tools/testfiles/pbits/tpbitsLengthExceeded.ddl
./tools/testfiles/pbits/tpbitsCharLengthExceeded.ddl
./tools/testfiles/pbits/tpbitsIntLengthExceeded.ddl
./tools/testfiles/pbits/tpbitsLongLengthExceeded.ddl
./tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
./tools/testfiles/pbits/tpbitsCharOffsetExceeded.ddl
./tools/testfiles/pbits/tpbitsIntOffsetExceeded.ddl
./tools/testfiles/pbits/tpbitsLongOffsetExceeded.ddl
./tools/testfiles/pbits/tpbitsOverlapped.ddl
./tools/testfiles/packedbits.h5
./tools/testfiles/tpbitsArray.ddl
./tools/testfiles/tpbitsCompound.ddl
./tools/testfiles/tpbitsIncomplete.ddl
./tools/testfiles/tpbitsLengthExceeded.ddl
./tools/testfiles/tpbitsCharLengthExceeded.ddl
./tools/testfiles/tpbitsIntLengthExceeded.ddl
./tools/testfiles/tpbitsLongLengthExceeded.ddl
./tools/testfiles/tpbitsOffsetExceeded.ddl
./tools/testfiles/tpbitsCharOffsetExceeded.ddl
./tools/testfiles/tpbitsIntOffsetExceeded.ddl
./tools/testfiles/tpbitsLongOffsetExceeded.ddl
./tools/testfiles/tpbitsOverlapped.ddl
# h5dump h5import validation
./tools/testfiles/out3.h5import
@ -2332,6 +2333,7 @@
./config/cmake/H5pubconf.h.in
./config/cmake/hdf5-config.cmake.in
./config/cmake/hdf5-config-version.cmake.in
./config/cmake/HDFCompilerFlags.cmake
./config/cmake/HDF5Macros.cmake
./config/cmake/libhdf5.settings.cmake.in
./config/cmake/mccacheinit.cmake

View File

@ -1,4 +1,4 @@
HDF5 version 1.9.218 currently under development
HDF5 version 1.9.222 currently under development
Please refer to the release_docs/INSTALL file for installation instructions.
------------------------------------------------------------------------------

View File

@ -179,7 +179,7 @@ sub argstring ($$$) {
# Normalize the data type by removing redundant white space,
# certain type qualifiers, and indirection.
$atype =~ s/^\bconst\b//;
$atype =~ s/\bUNUSED\b//g;
$atype =~ s/\bH5_ATTR_UNUSED\b//g;
$atype =~ s/\s+/ /g;
$ptr = length $1 if $atype =~ s/(\*+)//;
$atype =~ s/^\s+//;

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = HDF5 version 1.9.218 currently under development
PROJECT_NUMBER = HDF5 version 1.9.222 currently under development
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -61,7 +61,7 @@ const int H5Z_FILTER_BOGUS = 305;
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
// UNUSED variables caused warning, but taking them out caused failure.
// H5_ATTR_UNUSED variables caused warning, but taking them out caused failure.
/*-------------------------------------------------------------------------
* Function: test_create
@ -462,7 +462,7 @@ static size_t
filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int cd_values[], size_t nbytes,
size_t *buf_size, void **buf)
// UNUSED variables caused warning, but taking them out caused failure.
// H5_ATTR_UNUSED variables caused warning, but taking them out caused failure.
{
return nbytes;
}

View File

@ -59,7 +59,7 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl,
/* Temporary filter IDs used for testing */
const int H5Z_FILTER_BOGUS = 305;
#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
#endif
@ -92,10 +92,10 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{
*-------------------------------------------------------------------------
*/
static size_t
#if 0 // UNUSED variables caused warning, so duplicated below with NULL instead
filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts,
const unsigned int UNUSED *cd_values, size_t nbytes,
size_t UNUSED *buf_size, void UNUSED **buf)
#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead
filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
#endif
filter_bogus(size_t nbytes)
{

View File

@ -0,0 +1,274 @@
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99")
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftrapv -fno-common")
endif ()
else (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99")
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt")
endif ()
endif (CMAKE_BUILD_TYPE MATCHES Debug)
endif (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrapv -fno-common")
endif ()
else (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt")
endif ()
endif (CMAKE_BUILD_TYPE MATCHES Debug)
endif (CMAKE_COMPILER_IS_GNUCXX)
#-----------------------------------------------------------------------------
# Option to allow the user to disable compiler warnings
#-----------------------------------------------------------------------------
option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
if (HDF5_DISABLE_COMPILER_WARNINGS)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
if (MSVC)
set (HDF5_WARNINGS_BLOCKED 1)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
endif (MSVC)
if (WIN32)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
endif (WIN32)
# Borland uses -w- to suppress warnings.
if (BORLAND)
set (HDF5_WARNINGS_BLOCKED 1)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
endif (BORLAND)
# Most compilers use -w to suppress warnings.
if (NOT HDF5_WARNINGS_BLOCKED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif (NOT HDF5_WARNINGS_BLOCKED)
endif (HDF5_DISABLE_COMPILER_WARNINGS)
#-----------------------------------------------------------------------------
# CDash is configured to only allow 3000 warnings, so
# break into groups (from the config/gnu-flags file)
#-----------------------------------------------------------------------------
if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline")
else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP")
endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
# Append warning flags
# Don't use the '-Wtraditional' flag, we're way past having K&R C code
# set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional")
# Don't use the '-Wtraditional-conversion' flag, there's too many warnings
# from GCC's assert macro
# set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion")
# Append warning flags from gcc-3* case
# (don't use -Wpadded flag for normal builds, many of the warnings its
# issuing can't be fixed and they are making it hard to detect other,
# more important warnings)
#set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded")
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute")
# Append warning flags from gcc-3.2* case
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization")
# Enable more format checking flags, beyond the basic -Wformat included
# in -Wall
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2")
# The "unreachable code" warning appears to be reliable now...
# (this warning was removed in gcc 4.5+)
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wunreachable-code")
endif()
# Append warning flags from gcc-3.3* case
set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels")
# Append warning flags from gcc-3.4* case
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch")
# Append more extra warning flags that only gcc4.0+ know about
set (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros")
# Append more extra warning flags that only gcc 4.1+ know about
set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat")
# Append more extra warning flags that only gcc 4.2+ know about
set (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow")
# Append more extra warning flags that only gcc 4.3+ know about
#
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... -QAK
set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla")
# Append more extra warning flags that only gcc 4.4+ know about
set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat")
# Append more extra warning flags that only gcc 4.5+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants")
endif()
# Append more extra warning flags that only gcc 4.6+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines")
endif()
# Append more extra warning flags that only gcc 4.7+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn")
endif()
# Append more extra warning flags that only gcc 4.8+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
set (H5_CFLAGS5 "${H5_CFLAGS5} -Wsuggest-attribute=format")
endif()
# Append more extra warning flags that only gcc 4.9+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdate-time -Wopenmp-simd")
endif()
# (There was no release of gcc 5.0)
# Append more extra warning flags that only gcc 5.1+ know about
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1)
set (H5_CFLAGS6 "${H5_CFLAGS6} -Warray-bounds=2 -Wc99-c11-compat")
endif()
endif (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC)
#-----------------------------------------------------------------------------
# Option to allow the user to enable all warnings
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF)
if (HDF5_ENABLE_ALL_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall")
else (MSVC)
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}")
endif (CMAKE_COMPILER_IS_GNUCC)
endif (MSVC)
endif (HDF5_ENABLE_ALL_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF)
if (HDF5_ENABLE_GROUPZERO_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1")
else (MSVC)
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic")
endif (CMAKE_COMPILER_IS_GNUCC)
endif (MSVC)
endif (HDF5_ENABLE_GROUPZERO_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF)
if (HDF5_ENABLE_GROUPONE_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}")
endif (MSVC)
endif (HDF5_ENABLE_GROUPONE_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF)
if (HDF5_ENABLE_GROUPTWO_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}")
endif (MSVC)
endif (HDF5_ENABLE_GROUPTWO_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF)
if (HDF5_ENABLE_GROUPTHREE_WARNINGS)
if (MSVC)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}")
endif (MSVC)
endif (HDF5_ENABLE_GROUPTHREE_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF)
if (HDF5_ENABLE_GROUPFOUR_WARNINGS)
if (NOT MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}")
endif (NOT MSVC)
endif (HDF5_ENABLE_GROUPFOUR_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF)
if (HDF5_ENABLE_GROUPFIVE_WARNINGS)
if (NOT MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}")
endif (NOT MSVC)
endif (HDF5_ENABLE_GROUPFIVE_WARNINGS)
#-----------------------------------------------------------------------------
# Option to allow the user to enable warnings by groups
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_GROUPSIX_WARNINGS "Enable group six warnings" OFF)
if (HDF5_ENABLE_GROUPSIX_WARNINGS)
if (NOT MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS6}")
endif (NOT MSVC)
endif (HDF5_ENABLE_GROUPSIX_WARNINGS)
#-----------------------------------------------------------------------------
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif (CMAKE_COMPILER_IS_GNUCXX)

View File

@ -1,12 +1,16 @@
#########################################################################
### For Windows ${CTEST_SCRIPT_ARG} is one of ###
### [64-VS2013, 32-VS2013, 64-VS2012, 32-VS2012] ###
### ctest -S HDF518config.cmake,32-VS2012 -C Release -V -O hdf518.log ###
#########################################################################
##########################################################################
### For Windows ${CTEST_SCRIPT_ARG} is one of ###
### [64-VS2013, 32-VS2013, 64-VS2012, 32-VS2012] ###
### ctest -S HDF518config.cmake,32-VS2012 -C Release -VV -O hdf518.log ###
### ###
### Other platforms do not use ${CTEST_SCRIPT_ARG} ###
### ctest -S HDF518config.cmake -C Release -VV -O hdf518.log ###
##########################################################################
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CTEST_SOURCE_VERSION 1.8.15)
set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION})
set(CTEST_SOURCE_VERSEXT "")
set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT})
set(CTEST_BINARY_NAME "build")
set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
if(WIN32)
@ -83,14 +87,14 @@ set(SITE_BUILDNAME_SUFFIX "STATIC")
#set(LOCAL_UPDATE "TRUE")
set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8")
#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
###################################################################
###################################################################
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ")
### uncomment/comment and change the following lines for configuration options
### uncomment/comment or change the following lines for configuration options
### comment the following line or change OFF to ON in order to build shared libraries
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
@ -128,41 +132,41 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
if(WIN32)
include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip")
file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake)
if(APPLE)
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
if(CYGWIN)
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
else()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz")
file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY})
endif()
endif()
endif()

View File

@ -19,10 +19,10 @@
# if the compiler is not GNU; otherwise `cc_flags_set' is set to `yes'
#
# Get the compiler version in a way that works for gcc, egcs, and
# pgcc unless a compiler version is already known
# Get the compiler version in a way that works for gcc
# unless a compiler version is already known
#
# cc_vendor: The compiler name: gcc, egcs, or pgcc
# cc_vendor: The compiler name: gcc
# cc_version: Version number: 2.91.60, 2.7.2.1
#
if test X = "X$cc_flags_set"; then
@ -55,61 +55,9 @@ if test X = "X$cc_flags_set"; then
cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch`
fi
# GCC compilers before gcc-2.8.1 have problems with `long long'.
if test gcc = "$cc_vendor" -a "$cc_vers_all" -lt 2008001; then
cat <<EOF
**
** This compiler may be unable to properly compile the long long
** data type used extensively by hdf5. There may be other code
** generation problems also, especially when optimizations are
** enabled. Please upgrade to at least GNU gcc version 2.8.1
** before reporting bugs to the HDF5 team.
**
EOF
sleep 5
# GCC v2.96 (shipped with RH7.x) has problems with `float'-> `double' conversions.
elif test gcc = "$cc_vendor" -a "$cc_vers_all" -eq 2096000; then
cat <<EOF
**
** This compiler may have problems converting 'float' values to
** 'double' values. There may be other code generation problems
** as well.
**
** Please use a different version of gcc before reporting bugs.
**
EOF
sleep 5
# Current EGCS compilers have problems with `long long' and register
# allocation when optimizations are turned on for x86 systems.
elif test egcs = "$cc_vendor" -a "$cc_vers_all" -le 2091066; then
cat <<EOF
**
** This compiler may have problems allocating registers when
** optimizations are enabled on some platforms.
**
EOF
sleep 5
# All current versions of PGCC have problems also.
elif test pgcc = "$cc_vendor" -a "$cc_vers_all" -le 2091066; then
cat <<EOF
**
** This compiler may have problems allocating registers for long
** long data types when optimizations are enabled. There may be
** other code generation problems as well. We know of no version
** of pgcc which is capable of compiling HDF5 in production mode.
** Please use gcc-2.8 or egcs-1.1.1 before reporting bugs.
**
EOF
sleep 5
fi
# Common GCC flags for various situations
case "$cc_vendor-$cc_version" in
gcc*|egcs*|pgcc*)
gcc*)
# Architecture-specific flags
arch=
case "$host_os-$host_cpu" in
@ -146,33 +94,40 @@ case "$cc_vendor-$cc_version" in
esac
# General
H5_CFLAGS="$H5_CFLAGS $arch -ansi -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline"
H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline"
# Production
case "$cc_vendor-$cc_version" in
gcc-2.95.[34])
gcc-[34].*)
PROD_CFLAGS="-O3"
;;
gcc-3.*)
PROD_CFLAGS="-O3"
;;
gcc-4.*)
PROD_CFLAGS="-O3"
gcc-5.*)
PROD_CFLAGS="-O3 -fstdarg-opt"
;;
*)
PROD_CFLAGS="-O"
PROD_CFLAGS="-O -finline-functions"
;;
esac
PROD_CFLAGS="$PROD_CFLAGS -fomit-frame-pointer -finline-functions"
PROD_CPPFLAGS=
# Debug
DEBUG_CFLAGS="-g -fverbose-asm"
case "$cc_vendor-$cc_version" in
gcc-5.*)
DEBUG_CFLAGS="-Og -g -ftrapv -fno-common"
;;
*)
DEBUG_CFLAGS="-g"
;;
esac
#DEBUG_CFLAGS="$DEBUG_CFLAGS -fsanitize=undefined"
DEBUG_CPPFLAGS=
# Try out the new "stack protector" feature introduced in gcc 4.1
# (We should also think about adding some of the other memory protection options)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
# Profile
PROFILE_CFLAGS="-g -pg"
PROFILE_CFLAGS="-Og -g -pg"
PROFILE_CPPFLAGS=
# Flags are set
@ -186,13 +141,10 @@ esac
# the information from the previous version and adding modifications to that.
case "$cc_vendor-$cc_version" in
# Closer to the gcc 4.10 release, we should check for additional flags to
# Closer to the gcc 5.2 release, we should check for additional flags to
# include and break it out into it's own section, like the other versions
# below. -QAK
gcc-4.9*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
gcc-5.1*)
# Append warning flags
# Don't use the '-Wtraditional' flag, we're way past having K&R C code
# H5_CFLAGS="$H5_CFLAGS -Wtraditional"
@ -259,16 +211,81 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.9+ know about
H5_CFLAGS="$H5_CFLAGS -Wdate-time -Wopenmp-simd"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
# (There was no release of gcc 5.0)
# Append more extra warning flags that only gcc 5.1+ know about
H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat"
;;
gcc-4.9*)
# Append warning flags
# Don't use the '-Wtraditional' flag, we're way past having K&R C code
# H5_CFLAGS="$H5_CFLAGS -Wtraditional"
# Don't use the '-Wtraditional-conversion' flag, there's too many warnings
# from GCC's assert macro
# H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion"
# Append warning flags from gcc-3* case
# (don't use -Wpadded flag for normal builds, many of the warnings its
# issuing can't be fixed and they are making it hard to detect other,
# more important warnings)
#H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute"
# Append warning flags from gcc-3.2* case
H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization"
# Enable more format checking flags, beyond the basic -Wformat included
# in -Wall
H5_CFLAGS="$H5_CFLAGS -Wformat=2"
# The "unreachable code" warning appears to be reliable now...
H5_CFLAGS="$H5_CFLAGS -Wunreachable-code"
# Append warning flags from gcc-3.3* case
H5_CFLAGS="$H5_CFLAGS -Wendif-labels"
# Append warning flags from gcc-3.4* case
H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch"
# Replace old -W flag with new -Wextra flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`"
# Append more extra warning flags that only gcc4.0+ know about
H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros"
# Append more extra warning flags that only gcc 4.1+ know about
H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat"
# Append more extra warning flags that only gcc 4.2+ know about
H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
# Append more extra warning flags that only gcc 4.3+ know about
#
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... -QAK
H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla"
# Append more extra warning flags that only gcc 4.4+ know about
H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
# Append more extra warning flags that only gcc 4.5+ know about
H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
# Append more extra warning flags that only gcc 4.6+ know about
H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
# Append more extra warning flags that only gcc 4.7+ know about
H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
# Append more extra warning flags that only gcc 4.8+ know about
H5_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format"
# Append more extra warning flags that only gcc 4.9+ know about
H5_CFLAGS="$H5_CFLAGS -Wdate-time -Wopenmp-simd"
;;
gcc-4.8*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Append warning flags
# Don't use the '-Wtraditional' flag, we're way past having K&R C code
# H5_CFLAGS="$H5_CFLAGS -Wtraditional"
@ -331,17 +348,9 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.8+ know about
H5_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.7*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Append warning flags
# Don't use the '-Wtraditional' flag, we're way past having K&R C code
# H5_CFLAGS="$H5_CFLAGS -Wtraditional"
@ -402,17 +411,9 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.7+ know about
H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.6*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -466,17 +467,9 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.6+ know about
H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.5*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -527,17 +520,9 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.5+ know about
H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.4*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -584,17 +569,9 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.4+ know about
H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.3*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -638,17 +615,9 @@ case "$cc_vendor-$cc_version" in
# Technically, variable-length arrays are part of the C99 standard, but
# we should approach them a bit cautiously... -QAK
H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wvla"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.2*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -686,17 +655,9 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.2+ know about
H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.1.*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -731,17 +692,9 @@ case "$cc_vendor-$cc_version" in
# Append more extra warning flags that only gcc 4.1+ know about
H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var"
# Try out the new "stack protector" feature in gcc 4.1
# (Strictly speaking this isn't really a "warning" flag, so it's added to
# the debugging flags)
#DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all"
;;
gcc-4.0*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -776,9 +729,6 @@ case "$cc_vendor-$cc_version" in
;;
gcc-3.4*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -810,9 +760,6 @@ case "$cc_vendor-$cc_version" in
;;
gcc-3.3*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -838,9 +785,6 @@ case "$cc_vendor-$cc_version" in
;;
gcc-3.2*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -863,9 +807,6 @@ case "$cc_vendor-$cc_version" in
;;
gcc-3*)
# Replace -ansi flag with -std=c99 flag
H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`"
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
@ -876,11 +817,6 @@ case "$cc_vendor-$cc_version" in
#H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded"
H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute"
;;
gcc-2.9[56]*)
# Disable warnings about using 'long long' type
H5_CFLAGS="$H5_CFLAGS -Wno-long-long"
;;
esac
# Clear cc info if no flags set

View File

@ -19,7 +19,7 @@
# After making changes, run bin/reconfigure to update other configure related
# files like Makefile.in.
LT_VERS_INTERFACE = 6
LT_VERS_REVISION = 208
LT_VERS_REVISION = 212
LT_VERS_AGE = 0
## If the API changes *at all*, increment LT_VERS_INTERFACE and

View File

@ -26,7 +26,7 @@ AC_PREREQ([2.69])
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
AC_INIT([HDF5], [1.9.218], [help@hdfgroup.org])
AC_INIT([HDF5], [1.9.222], [help@hdfgroup.org])
AC_CONFIG_SRCDIR([src/H5.c])
AC_CONFIG_HEADER([src/H5config.h])

View File

@ -165,9 +165,9 @@ main (void)
/*
* Resulting dataset
*
* 3 3 3 2 2
* 3 3 3 2 2
* 3 3 3 0 0
* 1 1 1 3 3
* 1 1 1 3 3
* 1 1 1 0 0
* 2 0 0 0 0
* 2 0 0 0 0
* 2 0 0 0 0

View File

@ -256,7 +256,7 @@ nh5awritec_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims)
* SOURCE
*/
int_f
nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -266,7 +266,7 @@ nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -276,7 +276,7 @@ nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -286,7 +286,7 @@ nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -296,7 +296,7 @@ nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -306,7 +306,7 @@ nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -316,7 +316,7 @@ nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -326,7 +326,7 @@ nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -336,7 +336,7 @@ nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U
}
int_f
nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -346,7 +346,7 @@ nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -356,7 +356,7 @@ nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -366,7 +366,7 @@ nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -376,7 +376,7 @@ nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -386,7 +386,7 @@ nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -396,7 +396,7 @@ nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -406,7 +406,7 @@ nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -416,7 +416,7 @@ nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS
}
int_f
nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -426,7 +426,7 @@ nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -436,7 +436,7 @@ nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -446,7 +446,7 @@ nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -456,7 +456,7 @@ nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -466,7 +466,7 @@ nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -476,7 +476,7 @@ nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -486,7 +486,7 @@ nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
/*
@ -496,7 +496,7 @@ nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED *dims)
/******/
{
int_f ret_value=0; /* Return value */
@ -655,7 +655,7 @@ nh5areadc_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims)
* SOURCE
*/
int_f
nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
int_f ret_value=0; /* Return value */
@ -671,7 +671,7 @@ done:
}
int_f
nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -681,7 +681,7 @@ nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -691,7 +691,7 @@ nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -701,7 +701,7 @@ nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -711,7 +711,7 @@ nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -721,7 +721,7 @@ nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -731,7 +731,7 @@ nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -741,7 +741,7 @@ nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -751,7 +751,7 @@ nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN
}
int_f
nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -761,7 +761,7 @@ nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -771,7 +771,7 @@ nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -781,7 +781,7 @@ nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -791,7 +791,7 @@ nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -801,7 +801,7 @@ nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -811,7 +811,7 @@ nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -821,7 +821,7 @@ nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -831,7 +831,7 @@ nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE
}
int_f
nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -841,7 +841,7 @@ nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU
}
int_f
nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -851,7 +851,7 @@ nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU
}
int_f
nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -861,7 +861,7 @@ nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU
}
int_f
nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -871,7 +871,7 @@ nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU
}
int_f
nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -881,7 +881,7 @@ nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU
}
int_f
nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -891,7 +891,7 @@ nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU
}
int_f
nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*
@ -901,7 +901,7 @@ nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU
}
int_f
nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void H5_ATTR_UNUSED * dims)
/******/
{
/*

View File

@ -307,7 +307,7 @@ nh5dwritec_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h
* SOURCE
*/
int_f
nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f UNUSED *dims)
nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f H5_ATTR_UNUSED *dims)
/******/
{
int ret_value = -1;
@ -904,7 +904,7 @@ nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi
* SOURCE
*/
int_f
nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f UNUSED *dims)
nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, void *buf, hsize_t_f H5_ATTR_UNUSED *dims)
/******/
{
int ret_value = -1;

View File

@ -2836,7 +2836,7 @@ DONE:
* SOURCE
*/
int_f
nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len)
nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f H5_ATTR_UNUSED *value_len)
/******/
{
int ret_value = -1;
@ -2869,7 +2869,7 @@ nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd v
* SOURCE
*/
int_f
h5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value)
h5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void H5_ATTR_UNUSED *value)
/******/
{
char* c_name = NULL;
@ -2939,7 +2939,7 @@ nh5pregister_double_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size,
* SOURCE
*/
int_f
nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len)
nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f H5_ATTR_UNUSED *value_len)
/******/
{
int_f ret_value = -1;
@ -2972,7 +2972,7 @@ nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd v
* SOURCE
*/
int_f
h5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value)
h5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void H5_ATTR_UNUSED *value)
/******/
{
char* c_name = NULL;
@ -3437,7 +3437,7 @@ DONE:
* SOURCE
*/
int_f
nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED *value_len)
nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f H5_ATTR_UNUSED *value_len)
/******/
{
int_f ret_value = -1;
@ -3535,7 +3535,7 @@ nh5pset_double_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value)
* SOURCE
*/
int_f
nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED *value_len)
nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f H5_ATTR_UNUSED *value_len)
/******/
{
int_f ret_value = -1;
@ -5215,7 +5215,7 @@ nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_den
* SOURCE
*/
int_f
nh5pset_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size)
nh5pset_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size)
/******/
{
int ret_value = -1;
@ -5258,7 +5258,7 @@ nh5pset_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_
* SOURCE
*/
int_f
nh5pget_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size)
nh5pget_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *alignment, size_t_f H5_ATTR_UNUSED *block_size, size_t_f H5_ATTR_UNUSED *cbuf_size)
/******/
{
int ret_value = -1;

View File

@ -34,7 +34,7 @@ H5_FCTESTDLL int_f nh5_fixname_c
H5_FCTESTDLL int_f nh5_cleanup_c
(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl);
H5_FCTESTDLL NORETURN void nh5_exit_c
H5_FCTESTDLL H5_ATTR_NORETURN void nh5_exit_c
(int_f *status);
H5_FCTESTDLL void nh5_env_nocleanup_c

View File

@ -496,8 +496,8 @@ error:
*-------------------------------------------------------------------------
*/
static size_t
filter_bogus1(unsigned int flags, size_t UNUSED cd_nelmts,
const unsigned int UNUSED *cd_values, size_t nbytes,
filter_bogus1(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
size_t *buf_size, void **buf)
{
int *int_ptr=(int *)*buf; /* Pointer to the data values */
@ -533,8 +533,8 @@ filter_bogus1(unsigned int flags, size_t UNUSED cd_nelmts,
*-------------------------------------------------------------------------
*/
static size_t
filter_bogus2(unsigned int flags, size_t UNUSED cd_nelmts,
const unsigned int UNUSED *cd_values, size_t nbytes,
filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
size_t *buf_size, void **buf)
{
int *int_ptr=(int *)*buf; /* Pointer to the data values */

View File

@ -300,7 +300,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@ -311,7 +311,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@ -336,7 +336,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@ -347,7 +347,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@ -959,7 +959,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@ -970,7 +970,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@ -1003,7 +1003,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
@ -1014,7 +1014,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}

View File

@ -75,8 +75,8 @@ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) {
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) {
return -1;
}
return 0;

View File

@ -166,8 +166,8 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
@ -1140,7 +1140,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
@ -1202,7 +1202,7 @@ static int test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for ( i = 0; i < NRECORDS; i++ )
{
if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@ -1265,7 +1265,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@ -1294,7 +1294,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@ -1353,7 +1353,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@ -1406,7 +1406,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@ -1472,7 +1472,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@ -1503,7 +1503,7 @@ static int test_table(hid_t fid, int do_write)
{
int iistart = (int) start;
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@ -1546,8 +1546,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
!FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
!DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
!H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@ -1587,7 +1587,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
!DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
!H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}

View File

@ -1,4 +1,4 @@
HDF5 version 1.9.218 currently under development
HDF5 version 1.9.222 currently under development
================================================================================

View File

@ -115,26 +115,27 @@ H5_init_library(void)
#ifdef H5_HAVE_PARALLEL
{
int mpi_initialized;
int mpi_finalized;
int mpi_code;
MPI_Initialized(&mpi_initialized);
MPI_Finalized(&mpi_finalized);
#ifdef H5_HAVE_MPE
/* Initialize MPE instrumentation library. */
if (!H5_MPEinit_g)
{
int mpe_code;
if (mpi_initialized){
mpe_code = MPE_Init_log();
HDassert(mpe_code >=0);
H5_MPEinit_g = TRUE;
}
if (!H5_MPEinit_g) {
int mpe_code;
if (mpi_initialized && !mpi_finalized) {
mpe_code = MPE_Init_log();
HDassert(mpe_code >=0);
H5_MPEinit_g = TRUE;
}
}
#endif /*H5_HAVE_MPE*/
/* add an attribute on MPI_COMM_SELF to call H5_term_library
when it is destroyed, i.e. on MPI_Finalize */
if (mpi_initialized) {
if (mpi_initialized && !mpi_finalized) {
int key_val;
if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_NULL_COPY_FN,
@ -334,11 +335,14 @@ H5_term_library(void)
* down if any of the below code involves using the instrumentation code.
*/
if(H5_MPEinit_g) {
int mpe_code;
int mpi_initialized;
int mpi_finalized;
int mpe_code;
MPI_Initialized(&mpi_initialized);
if(mpi_initialized) {
MPI_Finalized(&mpi_finalized);
if (mpi_initialized && !mpi_finalized) {
mpe_code = MPE_Finish_log("h5log");
HDassert(mpe_code >=0);
} /* end if */
@ -615,7 +619,7 @@ H5_debug_mask(const char *s)
*
*-------------------------------------------------------------------------
*/
static int H5_mpi_delete_cb(MPI_Comm UNUSED comm, int UNUSED keyval, void UNUSED *attr_val, int UNUSED *flag)
static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag)
{
H5_term_library();
return MPI_SUCCESS;

View File

@ -21,7 +21,7 @@
#define H5O_PACKAGE /*suppress error about including H5Opkg */
/* Interface initialization */
#define H5_INTERFACE_INIT_FUNC H5A_init_interface
#define H5_INTERFACE_INIT_FUNC H5A__init_interface
/***********/
@ -125,9 +125,9 @@ done:
/*--------------------------------------------------------------------------
NAME
H5A_init_interface -- Initialize interface-specific information
H5A__init_interface -- Initialize interface-specific information
USAGE
herr_t H5A_init_interface()
herr_t H5A__init_interface()
RETURNS
Non-negative on success/Negative on failure
@ -136,11 +136,11 @@ DESCRIPTION
--------------------------------------------------------------------------*/
static herr_t
H5A_init_interface(void)
H5A__init_interface(void)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/*
* Create attribute ID type.
@ -150,7 +150,7 @@ H5A_init_interface(void)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5A_init_interface() */
} /* end H5A__init_interface() */
/*--------------------------------------------------------------------------
@ -229,7 +229,7 @@ H5A_term_interface(void)
/* ARGSUSED */
hid_t
H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id,
hid_t acpl_id, hid_t UNUSED aapl_id)
hid_t acpl_id, hid_t H5_ATTR_UNUSED aapl_id)
{
H5A_t *attr = NULL; /* Attribute created */
H5G_loc_t loc; /* Object location */
@ -304,7 +304,7 @@ done:
/* ARGSUSED */
hid_t
H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t UNUSED aapl_id,
hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t H5_ATTR_UNUSED aapl_id,
hid_t lapl_id)
{
H5A_t *attr = NULL; /* Attribute created */
@ -385,7 +385,7 @@ done:
H5Aclose or resource leaks will develop.
--------------------------------------------------------------------------*/
hid_t
H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_id)
H5Aopen(hid_t loc_id, const char *attr_name, hid_t H5_ATTR_UNUSED aapl_id)
{
H5G_loc_t loc; /* Object location */
H5A_t *attr = NULL; /* Attribute opened */
@ -407,7 +407,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_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)
if(H5A__open_common(&loc, attr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize attribute")
/* Register the attribute and get an ID for it */
@ -447,7 +447,7 @@ done:
--------------------------------------------------------------------------*/
hid_t
H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
hid_t UNUSED aapl_id, hid_t lapl_id)
hid_t H5_ATTR_UNUSED aapl_id, hid_t lapl_id)
{
H5G_loc_t loc; /* Object location */
H5A_t *attr = NULL; /* Attribute opened */
@ -515,7 +515,7 @@ done:
--------------------------------------------------------------------------*/
hid_t
H5Aopen_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 UNUSED aapl_id, hid_t lapl_id)
H5_iter_order_t order, hsize_t n, hid_t H5_ATTR_UNUSED aapl_id, hid_t lapl_id)
{
H5A_t *attr = NULL; /* Attribute opened */
H5G_loc_t loc; /* Object location */
@ -595,7 +595,7 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer")
/* Go write the actual data to the attribute */
if((ret_value = H5A_write(attr, mem_type, buf, H5AC_dxpl_id)) < 0)
if((ret_value = H5A__write(attr, mem_type, buf, H5AC_dxpl_id)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute")
done:
@ -638,7 +638,7 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer")
/* Go write the actual data to the attribute */
if((ret_value = H5A_read(attr, mem_type, buf, H5AC_ind_dxpl_id)) < 0)
if((ret_value = H5A__read(attr, mem_type, buf, H5AC_ind_dxpl_id)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute")
done:
@ -799,7 +799,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer")
/* Call private function in turn */
if(0 > (ret_value = H5A_get_name(my_attr, buf_size, buf)))
if(0 > (ret_value = H5A__get_name(my_attr, buf_size, buf)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get attribute name")
done:
@ -942,7 +942,7 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
/* Get the attribute information */
if(H5A_get_info(attr, ainfo) < 0)
if(H5A__get_info(attr, ainfo) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
done:
@ -996,7 +996,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute")
/* Get the attribute information */
if(H5A_get_info(attr, ainfo) < 0)
if(H5A__get_info(attr, ainfo) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
done:
@ -1058,7 +1058,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute")
/* Get the attribute information */
if(H5A_get_info(attr, ainfo) < 0)
if(H5A__get_info(attr, ainfo) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
done:

3059
src/H5AC.c

File diff suppressed because it is too large Load Diff

View File

@ -64,10 +64,10 @@
*-------------------------------------------------------------------------
*/
#define H5AC__MIN_DIRTY_BYTES_THRESHOLD (int32_t) \
#define H5AC__MIN_DIRTY_BYTES_THRESHOLD (size_t) \
(H5C__MIN_MAX_CACHE_SIZE / 2)
#define H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD (256 * 1024)
#define H5AC__MAX_DIRTY_BYTES_THRESHOLD (int32_t) \
#define H5AC__MAX_DIRTY_BYTES_THRESHOLD (size_t) \
(H5C__MAX_MAX_CACHE_SIZE / 4)
@ -142,6 +142,29 @@
*
* JRM - 6/27/05
*
* Update: When the above was written, I planned to allow the process
* 0 metadata cache to write dirty metadata between sync points.
* However, testing indicated that this allowed occasional
* messages from the future to reach the caches on other processes.
*
* To resolve this, the code was altered to require that all metadata
* writes take place during sync points -- which solved the problem.
* Initially all writes were performed by the process 0 cache. This
* approach was later replaced with a distributed write approach
* in which each process writes a subset of the metadata to be
* written.
*
* After thinking on the matter for a while, I arrived at the
* conclusion that the process 0 cache could be allowed to write
* dirty metadata between sync points if it restricted itself to
* entries that had been dirty at the time of the previous sync point.
*
* To date, there has been no attempt to implement this optimization.
* However, should it be attempted, much of the supporting code
* should still be around.
*
* JRM -- 1/6/15
*
* magic: Unsigned 32 bit integer always set to
* H5AC__H5AC_AUX_T_MAGIC. This field is used to validate
* pointers to instances of H5AC_aux_t.
@ -180,6 +203,10 @@
* field exists to facilitate experiments with other
* strategies.
*
* At present, this field must be set to either
* H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY or
* H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
*
* dirty_bytes_propagations: This field only exists when the
* H5AC_DEBUG_DIRTY_BYTES_CREATION #define is TRUE.
*
@ -270,11 +297,6 @@
* To reitterate, this field is only used on process 0 -- it
* should be NULL on all other processes.
*
* d_slist_len: Integer field containing the number of entries in the
* dirty entry list. This field should always contain the
* value 0 on all processes other than process 0. It exists
* primarily for sanity checking.
*
* c_slist_ptr: Pointer to an instance of H5SL_t used to maintain a list
* of entries that were dirty, have been flushed
* to disk since the last clean entries broadcast, and are
@ -285,11 +307,6 @@
* the next clean entries broadcast. The list emptied after
* each broadcast.
*
* c_slist_len: Integer field containing the number of entries in the clean
* entries list (*c_slist_ptr). This field should always
* contain the value 0 on all processes other than process 0.
* It exists primarily for sanity checking.
*
* The following two fields are used only when metadata_write_strategy
* is H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED.
*
@ -298,9 +315,6 @@
* point. This list is then broadcast to the other processes,
* which then either flush or mark clean all entries on it.
*
* candidate_slist_len: Integer field containing the number of entries on the
* candidate list. It exists primarily for sanity checking.
*
* write_done: In the parallel test bed, it is necessary to ensure that
* all writes to the server process from cache 0 complete
* before it enters the barrier call with the other caches.
@ -344,39 +358,33 @@ typedef struct H5AC_aux_t
hbool_t write_permitted;
int32_t dirty_bytes_threshold;
size_t dirty_bytes_threshold;
int32_t dirty_bytes;
size_t dirty_bytes;
int32_t metadata_write_strategy;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
int32_t dirty_bytes_propagations;
unsigned dirty_bytes_propagations;
int32_t unprotect_dirty_bytes;
int32_t unprotect_dirty_bytes_updates;
size_t unprotect_dirty_bytes;
unsigned unprotect_dirty_bytes_updates;
int32_t insert_dirty_bytes;
int32_t insert_dirty_bytes_updates;
size_t insert_dirty_bytes;
unsigned insert_dirty_bytes_updates;
int32_t move_dirty_bytes;
int32_t move_dirty_bytes_updates;
size_t move_dirty_bytes;
unsigned move_dirty_bytes_updates;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
H5SL_t * d_slist_ptr;
int32_t d_slist_len;
H5SL_t * c_slist_ptr;
int32_t c_slist_len;
H5SL_t * candidate_slist_ptr;
int32_t candidate_slist_len;
void (* write_done)(void);
void (* sync_point_done)(int num_writes,

View File

@ -255,7 +255,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
/* double empty_reserve = */ 0.1f, \
/* int dirty_bytes_threshold = */ (256 * 1024), \
/* size_t dirty_bytes_threshold = */ (256 * 1024), \
/* int metadata_write_strategy = */ \
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
@ -291,7 +291,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
/* int epochs_before_eviction = */ 3, \
/* hbool_t apply_empty_reserve = */ TRUE, \
/* double empty_reserve = */ 0.1f, \
/* int dirty_bytes_threshold = */ (256 * 1024), \
/* size_t dirty_bytes_threshold = */ (256 * 1024), \
/* int metadata_write_strategy = */ \
H5AC__DEFAULT_METADATA_WRITE_STRATEGY \
}
@ -340,7 +340,7 @@ H5_DLLVAR hid_t H5AC_ind_dxpl_id;
H5_DLL herr_t H5AC_init(void);
H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr,
unsigned * status_ptr);
unsigned *status_ptr);
H5_DLL 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);
H5_DLL herr_t H5AC_pin_protected_entry(void *thing);
@ -350,73 +350,46 @@ H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
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_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_mark_entry_dirty(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);
haddr_t old_addr, haddr_t new_addr);
H5_DLL herr_t H5AC_dest(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);
const H5AC_class_t *type, haddr_t addr, unsigned flags);
H5_DLL herr_t H5AC_set_sync_point_done_callback(H5C_t *cache_ptr,
void (*sync_point_done)(int num_writes, haddr_t *written_entries_tbl));
H5_DLL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr,
void (* write_done)(void));
H5_DLL herr_t H5AC_stats(const H5F_t *f);
H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr,
H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_get_cache_size(H5AC_t * cache_ptr,
size_t * max_size_ptr,
size_t * min_clean_size_ptr,
size_t * cur_size_ptr,
int32_t * cur_num_entries_ptr);
H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t * cache_ptr,
double * hit_rate_ptr);
H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr);
H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr,
size_t *min_clean_size_ptr, size_t *cur_size_ptr, int32_t *cur_num_entries_ptr);
H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr);
H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr);
H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr,
H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr);
H5_DLL herr_t H5AC_close_trace_file( H5AC_t * cache_ptr);
H5_DLL herr_t H5AC_open_trace_file(H5AC_t * cache_ptr,
const char * trace_file_name);
H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag);
H5_DLL herr_t H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag);
H5_DLL herr_t H5AC_ignore_tags(H5F_t * f);
H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr);
H5_DLL herr_t H5AC_close_trace_file(H5AC_t *cache_ptr);
H5_DLL herr_t H5AC_open_trace_file(H5AC_t *cache_ptr, const char *trace_file_name);
H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag);
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);
#ifdef H5_HAVE_PARALLEL
H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr);
#endif /* H5_HAVE_PARALLEL */
#ifndef NDEBUG /* debugging functions */
H5_DLL herr_t H5AC_stats(const H5F_t *f);
H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr,
void ** entry_ptr_ptr);
void ** entry_ptr_ptr);
H5_DLL herr_t H5AC_verify_entry_type(const H5F_t * f, haddr_t addr,
const H5AC_class_t * expected_type,
hbool_t * in_cache_ptr,
hbool_t * type_ok_ptr);
const H5AC_class_t * expected_type, hbool_t * in_cache_ptr,
hbool_t * type_ok_ptr);
#endif /* NDEBUG */ /* end debugging functions */
#endif /* !_H5ACprivate_H */

View File

@ -496,7 +496,7 @@ typedef struct H5AC_cache_config_t
/* parallel configuration fields: */
int dirty_bytes_threshold;
size_t dirty_bytes_threshold;
int metadata_write_strategy;
} H5AC_cache_config_t;

View File

@ -79,27 +79,27 @@ typedef struct H5A_fh_ud_cmp_t {
/* v2 B-tree function callbacks */
/* v2 B-tree driver callbacks for 'creation order' index */
static herr_t H5A_dense_btree2_corder_store(void *native, const void *udata);
static herr_t H5A_dense_btree2_corder_compare(const void *rec1, const void *rec2);
static herr_t H5A_dense_btree2_corder_encode(uint8_t *raw, const void *native,
static herr_t H5A__dense_btree2_corder_store(void *native, const void *udata);
static herr_t H5A__dense_btree2_corder_compare(const void *rec1, const void *rec2);
static herr_t H5A__dense_btree2_corder_encode(uint8_t *raw, const void *native,
void *ctx);
static herr_t H5A_dense_btree2_corder_decode(const uint8_t *raw, void *native,
static herr_t H5A__dense_btree2_corder_decode(const uint8_t *raw, void *native,
void *ctx);
static herr_t H5A_dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
static herr_t H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
int indent, int fwidth, const void *record, const void *_udata);
/* v2 B-tree driver callbacks for 'name' index */
static herr_t H5A_dense_btree2_name_store(void *native, const void *udata);
static herr_t H5A_dense_btree2_name_compare(const void *rec1, const void *rec2);
static herr_t H5A_dense_btree2_name_encode(uint8_t *raw, const void *native,
static herr_t H5A__dense_btree2_name_store(void *native, const void *udata);
static herr_t H5A__dense_btree2_name_compare(const void *rec1, const void *rec2);
static herr_t H5A__dense_btree2_name_encode(uint8_t *raw, const void *native,
void *ctx);
static herr_t H5A_dense_btree2_name_decode(const uint8_t *raw, void *native,
static herr_t H5A__dense_btree2_name_decode(const uint8_t *raw, void *native,
void *ctx);
static herr_t H5A_dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
static herr_t H5A__dense_btree2_name_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
int indent, int fwidth, const void *record, const void *_udata);
/* Fractal heap function callbacks */
static herr_t H5A_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data);
static herr_t H5A__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data);
/*********************/
@ -112,11 +112,11 @@ const H5B2_class_t H5A_BT2_NAME[1]={{ /* B-tree class information */
sizeof(H5A_dense_bt2_name_rec_t), /* Size of native record */
NULL, /* Create client callback context */
NULL, /* Destroy client callback context */
H5A_dense_btree2_name_store, /* Record storage callback */
H5A_dense_btree2_name_compare, /* Record comparison callback */
H5A_dense_btree2_name_encode, /* Record encoding callback */
H5A_dense_btree2_name_decode, /* Record decoding callback */
H5A_dense_btree2_name_debug, /* Record debugging callback */
H5A__dense_btree2_name_store, /* Record storage callback */
H5A__dense_btree2_name_compare, /* Record comparison callback */
H5A__dense_btree2_name_encode, /* Record encoding callback */
H5A__dense_btree2_name_decode, /* Record decoding callback */
H5A__dense_btree2_name_debug, /* Record debugging callback */
NULL, /* Create debugging context */
NULL /* Destroy debugging context */
}};
@ -128,11 +128,11 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */
sizeof(H5A_dense_bt2_corder_rec_t),/* Size of native record */
NULL, /* Create client callback context */
NULL, /* Destroy client callback context */
H5A_dense_btree2_corder_store, /* Record storage callback */
H5A_dense_btree2_corder_compare, /* Record comparison callback */
H5A_dense_btree2_corder_encode, /* Record encoding callback */
H5A_dense_btree2_corder_decode, /* Record decoding callback */
H5A_dense_btree2_corder_debug, /* Record debugging callback */
H5A__dense_btree2_corder_store, /* Record storage callback */
H5A__dense_btree2_corder_compare, /* Record comparison callback */
H5A__dense_btree2_corder_encode, /* Record encoding callback */
H5A__dense_btree2_corder_decode, /* Record decoding callback */
H5A__dense_btree2_corder_debug, /* Record debugging callback */
NULL, /* Create debugging context */
NULL /* Destroy debugging context */
}};
@ -150,7 +150,7 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */
/*-------------------------------------------------------------------------
* Function: H5A_dense_fh_name_cmp
* Function: H5A__dense_fh_name_cmp
*
* Purpose: Compares the name of a attribute in a fractal heap to another
* name
@ -164,14 +164,14 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_fh_name_cmp(const void *obj, size_t UNUSED obj_len, void *_udata)
H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
{
H5A_fh_ud_cmp_t *udata = (H5A_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */
H5A_t *attr = NULL; /* Pointer to attribute created from heap object */
hbool_t took_ownership = FALSE; /* Whether the "found" operator took ownership of the attribute */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/* Decode attribute information */
if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj)))
@ -200,11 +200,11 @@ done:
H5O_msg_free(H5O_ATTR_ID, attr);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5A_dense_fh_name_cmp() */
} /* end H5A__dense_fh_name_cmp() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_name_store
* Function: H5A__dense_btree2_name_store
*
* Purpose: Store user information into native record for v2 B-tree
*
@ -217,12 +217,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_name_store(void *_nrecord, const void *_udata)
H5A__dense_btree2_name_store(void *_nrecord, const void *_udata)
{
const H5A_bt2_ud_ins_t *udata = (const H5A_bt2_ud_ins_t *)_udata;
H5A_dense_bt2_name_rec_t *nrecord = (H5A_dense_bt2_name_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Copy user information info native record */
nrecord->id = udata->id;
@ -231,11 +231,11 @@ H5A_dense_btree2_name_store(void *_nrecord, const void *_udata)
nrecord->hash = udata->common.name_hash;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_name_store() */
} /* H5A__dense_btree2_name_store() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_name_compare
* Function: H5A__dense_btree2_name_compare
*
* Purpose: Compare two native information records, according to some key
*
@ -249,13 +249,13 @@ H5A_dense_btree2_name_store(void *_nrecord, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec)
H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec)
{
const H5A_bt2_ud_common_t *bt2_udata = (const H5A_bt2_ud_common_t *)_bt2_udata;
const H5A_dense_bt2_name_rec_t *bt2_rec = (const H5A_dense_bt2_name_rec_t *)_bt2_rec;
herr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(bt2_udata);
@ -294,7 +294,7 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec)
HDassert(fheap);
/* Check if the user's attribute and the B-tree's attribute have the same name */
status = H5HF_op(fheap, bt2_udata->dxpl_id, &bt2_rec->id, H5A_dense_fh_name_cmp, &fh_udata);
status = H5HF_op(fheap, bt2_udata->dxpl_id, &bt2_rec->id, H5A__dense_fh_name_cmp, &fh_udata);
HDassert(status >= 0);
/* Callback will set comparison value */
@ -302,11 +302,11 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec)
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A_dense_btree2_name_compare() */
} /* H5A__dense_btree2_name_compare() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_name_encode
* Function: H5A__dense_btree2_name_encode
*
* Purpose: Encode native information into raw form for storing on disk
*
@ -319,11 +319,11 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec)
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx)
H5A__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Encode the record's fields */
HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN);
@ -333,11 +333,11 @@ H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct
UINT32ENCODE(raw, nrecord->hash)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_name_encode() */
} /* H5A__dense_btree2_name_encode() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_name_decode
* Function: H5A__dense_btree2_name_decode
*
* Purpose: Decode raw disk form of record into native form
*
@ -350,11 +350,11 @@ H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx)
H5A__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
H5A_dense_bt2_name_rec_t *nrecord = (H5A_dense_bt2_name_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Decode the record's fields */
HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN);
@ -364,11 +364,11 @@ H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct
UINT32DECODE(raw, nrecord->hash)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_name_decode() */
} /* H5A__dense_btree2_name_decode() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_name_debug
* Function: H5A__dense_btree2_name_debug
*
* Purpose: Debug native form of record
*
@ -381,23 +381,23 @@ H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
int indent, int fwidth, const void *_nrecord, const void UNUSED *_udata)
H5A__dense_btree2_name_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata)
{
const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u, %08lx}\n", indent, "", fwidth,
"Record:",
(hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder, (unsigned long)nrecord->hash);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_name_debug() */
} /* H5A__dense_btree2_name_debug() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_corder_store
* Function: H5A__dense_btree2_corder_store
*
* Purpose: Store user information into native record for v2 B-tree
*
@ -410,12 +410,12 @@ H5A_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dx
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_corder_store(void *_nrecord, const void *_udata)
H5A__dense_btree2_corder_store(void *_nrecord, const void *_udata)
{
const H5A_bt2_ud_ins_t *udata = (const H5A_bt2_ud_ins_t *)_udata;
H5A_dense_bt2_corder_rec_t *nrecord = (H5A_dense_bt2_corder_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Copy user information info native record */
nrecord->id = udata->id;
@ -423,11 +423,11 @@ H5A_dense_btree2_corder_store(void *_nrecord, const void *_udata)
nrecord->corder = udata->common.corder;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_corder_store() */
} /* H5A__dense_btree2_corder_store() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_corder_compare
* Function: H5A__dense_btree2_corder_compare
*
* Purpose: Compare two native information records, according to some key
*
@ -441,13 +441,13 @@ H5A_dense_btree2_corder_store(void *_nrecord, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec)
H5A__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec)
{
const H5A_bt2_ud_common_t *bt2_udata = (const H5A_bt2_ud_common_t *)_bt2_udata;
const H5A_dense_bt2_corder_rec_t *bt2_rec = (const H5A_dense_bt2_corder_rec_t *)_bt2_rec;
herr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(bt2_udata);
@ -462,11 +462,11 @@ H5A_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec)
ret_value = 0;
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A_dense_btree2_corder_compare() */
} /* H5A__dense_btree2_corder_compare() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_corder_encode
* Function: H5A__dense_btree2_corder_encode
*
* Purpose: Encode native information into raw form for storing on disk
*
@ -479,11 +479,11 @@ H5A_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec)
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ctx)
H5A__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Encode the record's fields */
HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN);
@ -492,11 +492,11 @@ H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *
UINT32ENCODE(raw, nrecord->corder)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_corder_encode() */
} /* H5A__dense_btree2_corder_encode() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_corder_decode
* Function: H5A__dense_btree2_corder_decode
*
* Purpose: Decode raw disk form of record into native form
*
@ -509,11 +509,11 @@ H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED *
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ctx)
H5A__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
H5A_dense_bt2_corder_rec_t *nrecord = (H5A_dense_bt2_corder_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Decode the record's fields */
HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN);
@ -522,11 +522,11 @@ H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *
UINT32DECODE(raw, nrecord->corder)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_corder_decode() */
} /* H5A__dense_btree2_corder_decode() */
/*-------------------------------------------------------------------------
* Function: H5A_dense_btree2_corder_debug
* Function: H5A__dense_btree2_corder_debug
*
* Purpose: Debug native form of record
*
@ -539,17 +539,17 @@ H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED *
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
int indent, int fwidth, const void *_nrecord, const void UNUSED *_udata)
H5A__dense_btree2_corder_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
int indent, int fwidth, const void *_nrecord, const void H5_ATTR_UNUSED *_udata)
{
const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord;
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u}\n", indent, "", fwidth,
"Record:",
(hsize_t)nrecord->id.val, (unsigned)nrecord->flags, (unsigned)nrecord->corder);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_corder_debug() */
} /* H5A__dense_btree2_corder_debug() */

View File

@ -538,7 +538,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr)
udata.common.shared_fheap = shared_fheap;
udata.common.name = attr->shared->name;
udata.common.name_hash = H5_checksum_lookup3(attr->shared->name, HDstrlen(attr->shared->name), 0);
H5_ASSIGN_OVERFLOW(udata.common.flags, mesg_flags, unsigned, uint8_t);
H5_CHECKED_ASSIGN(udata.common.flags, uint8_t, mesg_flags, unsigned);
udata.common.corder = attr->shared->crt_idx;
udata.common.found_op = NULL;
udata.common.found_op_data = NULL;
@ -845,7 +845,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5A__dense_copy_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata)
H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_udata)
{
H5A_fh_ud_cp_t *udata = (H5A_fh_ud_cp_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
@ -1082,7 +1082,7 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
H5A_info_t ainfo; /* Info for attribute */
/* Get the attribute information */
if(H5A_get_info(fh_udata.attr, &ainfo) < 0)
if(H5A__get_info(fh_udata.attr, &ainfo) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5_ITER_ERROR, "unable to get attribute info")
/* Make the application callback */

View File

@ -92,7 +92,7 @@ typedef struct {
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);
static herr_t H5A__dense_build_table_cb(const H5A_t *attr, void *_udata);
static int H5A__attr_cmp_name_inc(const void *attr1, const void *attr2);
static int H5A__attr_cmp_name_dec(const void *attr1, const void *attr2);
static int H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2);
@ -255,7 +255,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
/* Get # of elements for attribute's dataspace */
if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, NULL, "dataspace is invalid")
H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, size_t);
H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t);
HDassert(attr->shared->dt_size > 0);
HDassert(attr->shared->ds_size > 0);
@ -283,13 +283,13 @@ done:
/*-------------------------------------------------------------------------
* Function: H5A_open_common
* Function: H5A__open_common
*
* Purpose:
* Finishes initializing an attributes the open
*
* Usage:
* herr_t H5A_open_common(loc, name, dxpl_id)
* herr_t H5A__open_common(loc, name, dxpl_id)
* const H5G_loc_t *loc; IN: Pointer to group location for object
* H5A_t *attr; IN/OUT: Pointer to attribute to initialize
*
@ -301,11 +301,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5A_open_common(const H5G_loc_t *loc, H5A_t *attr)
H5A__open_common(const H5G_loc_t *loc, H5A_t *attr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/* check args */
HDassert(loc);
@ -336,7 +336,7 @@ H5A_open_common(const H5G_loc_t *loc, H5A_t *attr)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A_open_common() */
} /* H5A__open_common() */
/*-------------------------------------------------------------------------
@ -383,7 +383,7 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type,
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to load attribute info from object header")
/* Finish initializing attribute */
if(H5A_open_common(&obj_loc, attr) < 0)
if(H5A__open_common(&obj_loc, attr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to initialize attribute")
/* Set return value */
@ -448,7 +448,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to load attribute info from object header")
/* Finish initializing attribute */
if(H5A_open_common(loc, attr) < 0)
if(H5A__open_common(loc, attr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to initialize attribute")
/* Set return value */
@ -470,11 +470,114 @@ done:
/*--------------------------------------------------------------------------
NAME
H5A_write
H5A__read
PURPOSE
Actually read in data from an attribute
USAGE
herr_t H5A__read (attr, mem_type, buf)
H5A_t *attr; IN: Attribute to read
const H5T_t *mem_type; IN: Memory datatype of buffer
void *buf; IN: Buffer for data to read
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
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)
{
uint8_t *tconv_buf = NULL; /* datatype conv buffer*/
uint8_t *bkg_buf = NULL; /* background buffer */
hssize_t snelmts; /* elements in attribute */
size_t nelmts; /* elements in attribute*/
H5T_path_t *tpath = NULL; /* type conversion info */
hid_t src_id = -1, dst_id = -1;/* temporary type atoms*/
size_t src_type_size; /* size of source type */
size_t dst_type_size; /* size of destination type */
size_t buf_size; /* desired buffer size */
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT
HDassert(attr);
HDassert(mem_type);
HDassert(buf);
/* Create buffer for data to store on disk */
if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t);
if(nelmts > 0) {
/* Get the memory and file datatype sizes */
src_type_size = H5T_GET_SIZE(attr->shared->dt);
dst_type_size = H5T_GET_SIZE(mem_type);
/* Check if the attribute has any data yet, if not, fill with zeroes */
if(attr->obj_opened && !attr->shared->data)
HDmemset(buf, 0, (dst_type_size * nelmts));
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)))
HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes")
/* Check for type conversion required */
if(!H5T_path_noop(tpath)) {
if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0 ||
(dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion")
/* Get the maximum buffer size needed and allocate it */
buf_size = nelmts * MAX(src_type_size, dst_type_size);
if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size)))
HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed")
if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size)))
HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Copy the attribute data into the buffer for conversion */
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)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Copy the converted data into the user's buffer */
HDmemcpy(buf, tconv_buf, (dst_type_size * nelmts));
} /* end if */
/* No type conversion necessary */
else {
HDassert(dst_type_size == src_type_size);
/* Copy the attribute data into the user's buffer */
HDmemcpy(buf, attr->shared->data, (dst_type_size * nelmts));
} /* end else */
} /* end else */
} /* end if */
done:
/* Release resources */
if(src_id >= 0 && H5I_dec_ref(src_id) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object")
if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object")
if(tconv_buf)
tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf);
if(bkg_buf)
bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A__read() */
/*--------------------------------------------------------------------------
NAME
H5A__write
PURPOSE
Actually write out data to an attribute
USAGE
herr_t H5A_write (attr, mem_type, buf)
herr_t H5A__write (attr, mem_type, buf)
H5A_t *attr; IN: Attribute to write
const H5T_t *mem_type; IN: Memory datatype of buffer
const void *buf; IN: Buffer of data to write
@ -485,7 +588,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, hid_t dxpl_id)
{
uint8_t *tconv_buf = NULL; /* datatype conv buffer */
hbool_t tconv_owned = FALSE; /* Whether the datatype conv buffer is owned by attribute */
@ -508,7 +611,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id)
/* Get # of elements for attribute's dataspace */
if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, size_t);
H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t);
/* If there's actually data elements for the attribute, make a copy of the data passed in */
if(nelmts > 0) {
@ -579,110 +682,53 @@ done:
bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf);
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
} /* H5A_write() */
} /* H5A__write() */
/*--------------------------------------------------------------------------
NAME
H5A_read
H5A__get_name
PURPOSE
Actually read in data from an attribute
USAGE
herr_t H5A_read (attr, mem_type, buf)
H5A_t *attr; IN: Attribute to read
const H5T_t *mem_type; IN: Memory datatype of buffer
void *buf; IN: Buffer for data to read
Private function for H5Aget_name. Gets a copy of the name for an
attribute
RETURNS
Non-negative on success/Negative on failure
This function returns the length of the attribute's name (which may be
longer than 'buf_size') on success or negative for failure.
DESCRIPTION
This function reads a complete attribute from disk.
This function retrieves the name of an attribute for an attribute ID.
Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string
terminator. If the name of the attribute is longer than 'buf_size'-1,
the string terminator is stored in the last position of the buffer to
properly terminate the string.
--------------------------------------------------------------------------*/
herr_t
H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id)
ssize_t
H5A__get_name(H5A_t *attr, size_t buf_size, char *buf)
{
uint8_t *tconv_buf = NULL; /* datatype conv buffer*/
uint8_t *bkg_buf = NULL; /* background buffer */
hssize_t snelmts; /* elements in attribute */
size_t nelmts; /* elements in attribute*/
H5T_path_t *tpath = NULL; /* type conversion info */
hid_t src_id = -1, dst_id = -1;/* temporary type atoms*/
size_t src_type_size; /* size of source type */
size_t dst_type_size; /* size of destination type */
size_t buf_size; /* desired buffer size */
herr_t ret_value = SUCCEED;
size_t copy_len, nbytes;
ssize_t ret_value;
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(attr);
HDassert(mem_type);
HDassert(buf);
/* get the real attribute length */
nbytes = HDstrlen(attr->shared->name);
HDassert((ssize_t)nbytes >= 0); /*overflow, pretty unlikely --rpm*/
/* Create buffer for data to store on disk */
if((snelmts = H5S_GET_EXTENT_NPOINTS(attr->shared->ds)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, size_t);
/* compute the string length which will fit into the user's buffer */
copy_len = MIN(buf_size - 1, nbytes);
if(nelmts > 0) {
/* Get the memory and file datatype sizes */
src_type_size = H5T_GET_SIZE(attr->shared->dt);
dst_type_size = H5T_GET_SIZE(mem_type);
/* Copy all/some of the name */
if(buf && copy_len > 0) {
HDmemcpy(buf, attr->shared->name, copy_len);
/* Check if the attribute has any data yet, if not, fill with zeroes */
if(attr->obj_opened && !attr->shared->data)
HDmemset(buf, 0, (dst_type_size * nelmts));
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)))
HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes")
/* Check for type conversion required */
if(!H5T_path_noop(tpath)) {
if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), FALSE)) < 0 ||
(dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion")
/* Get the maximum buffer size needed and allocate it */
buf_size = nelmts * MAX(src_type_size, dst_type_size);
if(NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size)))
HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed")
if(NULL == (bkg_buf = H5FL_BLK_CALLOC(attr_buf, buf_size)))
HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Copy the attribute data into the buffer for conversion */
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)
HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Copy the converted data into the user's buffer */
HDmemcpy(buf, tconv_buf, (dst_type_size * nelmts));
} /* end if */
/* No type conversion necessary */
else {
HDassert(dst_type_size == src_type_size);
/* Copy the attribute data into the user's buffer */
HDmemcpy(buf, attr->shared->data, (dst_type_size * nelmts));
} /* end else */
} /* end else */
/* Terminate the string */
buf[copy_len]='\0';
} /* end if */
done:
/* Release resources */
if(src_id >= 0 && H5I_dec_ref(src_id) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object")
if(dst_id >= 0 && H5I_dec_ref(dst_id) < 0)
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object")
if(tconv_buf)
tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf);
if(bkg_buf)
bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf);
/* Set return value */
ret_value = (ssize_t)nbytes;
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A_read() */
} /* H5A__get_name() */
/*-------------------------------------------------------------------------
@ -825,55 +871,9 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Aget_create_plist() */
/*--------------------------------------------------------------------------
NAME
H5A_get_name
PURPOSE
Private function for H5Aget_name. Gets a copy of the name for an
attribute
RETURNS
This function returns the length of the attribute's name (which may be
longer than 'buf_size') on success or negative for failure.
DESCRIPTION
This function retrieves the name of an attribute for an attribute ID.
Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string
terminator. If the name of the attribute is longer than 'buf_size'-1,
the string terminator is stored in the last position of the buffer to
properly terminate the string.
--------------------------------------------------------------------------*/
ssize_t
H5A_get_name(H5A_t *attr, size_t buf_size, char *buf)
{
size_t copy_len, nbytes;
ssize_t ret_value;
FUNC_ENTER_NOAPI_NOERR
/* get the real attribute length */
nbytes = HDstrlen(attr->shared->name);
HDassert((ssize_t)nbytes >= 0); /*overflow, pretty unlikely --rpm*/
/* compute the string length which will fit into the user's buffer */
copy_len = MIN(buf_size - 1, nbytes);
/* Copy all/some of the name */
if(buf && copy_len > 0) {
HDmemcpy(buf, attr->shared->name, copy_len);
/* Terminate the string */
buf[copy_len]='\0';
} /* end if */
/* Set return value */
ret_value = (ssize_t)nbytes;
FUNC_LEAVE_NOAPI(ret_value)
} /* H5A_get_name() */
/*-------------------------------------------------------------------------
* Function: H5A_get_info
* Function: H5A__get_info
*
* Purpose: Retrieve information about an attribute.
*
@ -886,7 +886,7 @@ H5A_get_name(H5A_t *attr, size_t buf_size, char *buf)
*-------------------------------------------------------------------------
*/
herr_t
H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo)
H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo)
{
FUNC_ENTER_NOAPI_NOERR
@ -907,7 +907,7 @@ H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo)
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5A_get_info() */
} /* end H5A__get_info() */
/*-------------------------------------------------------------------------
@ -1239,8 +1239,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5A__compact_build_table_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/,
unsigned sequence, unsigned UNUSED *oh_modified, void *_udata/*in,out*/)
H5A__compact_build_table_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/,
unsigned sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/)
{
H5A_compact_bt_ud_t *udata = (H5A_compact_bt_ud_t *)_udata; /* Operator user data */
herr_t ret_value = H5_ITER_CONT; /* Return value */
@ -1347,7 +1347,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5A_dense_build_table_cb
* Function: H5A__dense_build_table_cb
*
* Purpose: Callback routine for building table of attributes from dense
* attribute storage.
@ -1362,12 +1362,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_build_table_cb(const H5A_t *attr, void *_udata)
H5A__dense_build_table_cb(const H5A_t *attr, void *_udata)
{
H5A_dense_bt_ud_t *udata = (H5A_dense_bt_ud_t *)_udata; /* 'User data' passed in */
herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/* check arguments */
HDassert(attr);
@ -1387,7 +1387,7 @@ H5A_dense_build_table_cb(const H5A_t *attr, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5A_dense_build_table_cb() */
} /* end H5A__dense_build_table_cb() */
/*-------------------------------------------------------------------------
@ -1453,7 +1453,7 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
/* Build iterator operator */
attr_op.op_type = H5A_ATTR_OP_LIB;
attr_op.u.lib_op = H5A_dense_build_table_cb;
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,
@ -1680,7 +1680,7 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip,
*last_attr = skip;
/* Iterate over attribute messages */
H5_ASSIGN_OVERFLOW(/* To: */ u, /* From: */ skip, /* From: */ hsize_t, /* To: */ size_t)
H5_CHECKED_ASSIGN(u, size_t, skip, hsize_t)
for(; u < atable->nattrs && !ret_value; u++) {
/* Check which type of callback to make */
switch(attr_op->op_type) {
@ -1689,7 +1689,7 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip,
H5A_info_t ainfo; /* Info for attribute */
/* Get the attribute information */
if(H5A_get_info(atable->attrs[u], &ainfo) < 0)
if(H5A__get_info(atable->attrs[u], &ainfo) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5_ITER_ERROR, "unable to get attribute info")
/* Make the application callback */
@ -2012,7 +2012,11 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si
*recompute_size = TRUE;
/* Compute the size of the data */
H5_ASSIGN_OVERFLOW(attr_dst->shared->data_size, H5S_GET_EXTENT_NPOINTS(attr_dst->shared->ds) * H5T_get_size(attr_dst->shared->dt), hssize_t, size_t);
/* NOTE: This raises warnings. If we are going to be serious about
* expecting overflow here, we should implement testing similar to
* that described in CERT bulletins INT30-C and INT32-C.
*/
H5_CHECKED_ASSIGN(attr_dst->shared->data_size, size_t, H5S_GET_EXTENT_NPOINTS(attr_dst->shared->ds) * H5T_get_size(attr_dst->shared->dt), hssize_t);
/* Copy (& convert) the data, if necessary */
if(attr_src->shared->data) {
@ -2253,7 +2257,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5A_dense_post_copy_file_cb
* Function: H5A__dense_post_copy_file_cb
*
* Purpose: Callback routine for copying a dense attribute from SRC to DST.
*
@ -2267,13 +2271,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5A_dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata)
H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata)
{
H5A_dense_file_cp_ud_t *udata = (H5A_dense_file_cp_ud_t *)_udata;
H5A_t *attr_dst = NULL;
herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/* check arguments */
HDassert(attr_src);
@ -2309,7 +2313,7 @@ done:
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close destination attribute")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5A_dense_post_copy_file_cb() */
} /* end H5A__dense_post_copy_file_cb() */
/*-------------------------------------------------------------------------
@ -2350,7 +2354,7 @@ H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo
udata.oloc_dst = dst_oloc;
attr_op.op_type = H5A_ATTR_OP_LIB;
attr_op.u.lib_op = H5A_dense_post_copy_file_cb;
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,

View File

@ -192,12 +192,9 @@ 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 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 ssize_t H5A_get_name(H5A_t *attr, size_t buf_size, char *buf);
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 herr_t H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo);
H5_DLL herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo);
H5_DLL hid_t H5A_get_type(H5A_t *attr);
H5_DLL hid_t H5A_get_space(H5A_t *attr);
H5_DLL hid_t H5A_get_create_plist(H5A_t* attr);
@ -209,6 +206,9 @@ H5_DLL herr_t H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char
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 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);

110
src/H5B.c
View File

@ -134,7 +134,7 @@ typedef struct H5B_iter_ud_t {
} H5B_info_ud_t;
/* Convenience struct for the arguments needed to unprotect a b-tree after a
* call to H5B_iterate_helper() or H5B_split() */
* call to H5B__iterate_helper() or H5B__split() */
typedef struct H5B_ins_ud_t {
H5B_t *bt; /* B-tree */
haddr_t addr; /* B-tree address */
@ -145,7 +145,7 @@ 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,
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,
@ -153,13 +153,13 @@ static H5B_ins_t H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
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,
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,
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 H5B_t * H5B_copy(const H5B_t *old_bt);
static H5B_t * H5B__copy(const H5B_t *old_bt);
/*********************/
@ -258,7 +258,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata,
if(H5AC_insert_entry(f, dxpl_id, 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, dxpl_id, *addr_p, shared->type, udata);
#endif
done:
@ -269,7 +269,7 @@ done:
} /* end if */
if(bt)
/* Destroy B-tree node */
if(H5B_node_dest(bt) < 0)
if(H5B__node_dest(bt) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node")
} /* end if */
@ -375,7 +375,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5B_split
* Function: H5B__split
*
* Purpose: Split a single node into two nodes. The old node will
* contain the left children and the new node will contain the
@ -397,7 +397,7 @@ 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, hid_t dxpl_id, 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 */
@ -407,7 +407,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx,
double split_ratios[3]; /* B-tree split ratios */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/*
* Check arguments.
@ -446,7 +446,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx,
side = "LEFT";
else
side = "MIDDLE";
fprintf(H5DEBUG(B), "H5B_split: %3u {%5.3f,%5.3f,%5.3f} %6s",
fprintf(H5DEBUG(B), "H5B__split: %3u {%5.3f,%5.3f,%5.3f} %6s",
shared->two_k, split_ratios[0], split_ratios[1], split_ratios[2], side);
}
#endif
@ -539,7 +539,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_split() */
} /* end H5B__split() */
/*-------------------------------------------------------------------------
@ -601,7 +601,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void
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, dxpl_id, &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")
@ -638,7 +638,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void
*/
/* Make a copy of the old root information */
if(NULL == (new_root_bt = H5B_copy(bt_ud.bt)))
if(NULL == (new_root_bt = H5B__copy(bt_ud.bt)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to copy old root")
/* Unprotect the old root so we can move it. Also force it to be marked
@ -677,7 +677,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void
done:
if(ret_value < 0)
if(new_root_bt && H5B_node_dest(new_root_bt) < 0)
if(new_root_bt && H5B__node_dest(new_root_bt) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to free B-tree root node");
if(bt_ud.bt)
@ -690,7 +690,7 @@ done:
#ifdef H5B_DEBUG
if(ret_value >= 0)
H5B_assert(f, dxpl_id, addr, type, udata);
H5B__assert(f, dxpl_id, addr, type, udata);
#endif
FUNC_LEAVE_NOAPI(ret_value)
@ -698,7 +698,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5B_insert_child
* Function: H5B__insert_child
*
* Purpose: Insert a child to the left or right of child[IDX] depending
* on whether ANCHOR is H5B_INS_LEFT or H5B_INS_RIGHT. The BT
@ -713,13 +713,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx,
H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx,
haddr_t child, H5B_ins_t anchor, const void *md_key)
{
H5B_shared_t *shared; /* Pointer to shared B-tree info */
uint8_t *base; /* Base offset for move */
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
HDassert(bt);
HDassert(bt_flags);
@ -771,7 +771,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx,
/*-------------------------------------------------------------------------
* Function: H5B_insert_helper
* Function: H5B__insert_helper
*
* Purpose: Inserts the item UDATA into the tree rooted at ADDR and having
* the specified type.
@ -802,7 +802,7 @@ 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,
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,
@ -820,7 +820,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
H5B_ins_t my_ins = H5B_INS_ERROR;
H5B_ins_t ret_value = H5B_INS_ERROR; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/*
* Check arguments
@ -904,7 +904,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE)))
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, dxpl_id, &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)
@ -950,7 +950,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE)))
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, dxpl_id, &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)
@ -1005,7 +1005,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC_WRITE)))
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, dxpl_id, &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")
@ -1064,7 +1064,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, dxpl_id, 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;
@ -1081,7 +1081,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud,
} /* end else */
/* Insert the child */
if(H5B_insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0)
if(H5B__insert_child(tmp_bt, tmp_bt_flags_ptr, idx, new_child_bt_ud.addr, my_ins, md_key) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child")
} /* end else-if */
@ -1119,7 +1119,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5B_iterate_helper
* Function: H5B__iterate_helper
*
* Purpose: Calls the list callback for each leaf node of the
* B-tree, passing it the caller's UDATA structure.
@ -1133,7 +1133,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, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
H5B_operator_t op, void *udata)
{
H5B_t *bt = NULL; /* Pointer to current B-tree node */
@ -1143,7 +1143,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add
unsigned u; /* Local index variable */
herr_t ret_value = H5_ITER_CONT; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/*
* Check arguments.
@ -1170,7 +1170,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add
/* 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, dxpl_id, 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);
if(ret_value < 0)
@ -1182,7 +1182,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_iterate_helper() */
} /* end H5B__iterate_helper() */
/*-------------------------------------------------------------------------
@ -1217,7 +1217,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, dxpl_id, type, addr, op, udata)) < 0)
HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed");
FUNC_LEAVE_NOAPI(ret_value)
@ -1225,7 +1225,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
/*-------------------------------------------------------------------------
* Function: H5B_remove_helper
* Function: H5B__remove_helper
*
* Purpose: The recursive part of removing an item from a B-tree. The
* sub B-tree that is being considered is located at ADDR and
@ -1249,7 +1249,7 @@ 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,
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*/)
@ -1263,7 +1263,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
int cmp = 1; /* Key comparison value */
H5B_ins_t ret_value = H5B_INS_ERROR;
FUNC_ENTER_NOAPI(H5B_INS_ERROR)
FUNC_ENTER_STATIC
HDassert(f);
HDassert(H5F_addr_defined(addr));
@ -1308,7 +1308,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
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,
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*/,
rt_key_changed/*out*/)) < 0)
@ -1555,7 +1555,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_remove_helper() */
} /* end H5B__remove_helper() */
/*-------------------------------------------------------------------------
@ -1594,12 +1594,12 @@ 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,
if(H5B__remove_helper(f, dxpl_id, addr, type, 0, lt_key, &lt_key_changed,
udata, rt_key, &rt_key_changed) == H5B_INS_ERROR)
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, dxpl_id, addr, type, udata);
#endif
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -1789,7 +1789,7 @@ H5B_shared_free(void *_shared)
/*-------------------------------------------------------------------------
* Function: H5B_copy
* Function: H5B__copy
*
* Purpose: Deep copies an existing H5B_t node.
*
@ -1804,13 +1804,13 @@ H5B_shared_free(void *_shared)
*-------------------------------------------------------------------------
*/
static H5B_t *
H5B_copy(const H5B_t *old_bt)
H5B__copy(const H5B_t *old_bt)
{
H5B_t *new_node = NULL;
H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_t *ret_value;
FUNC_ENTER_NOAPI(NULL)
FUNC_ENTER_STATIC
/*
* Check arguments.
@ -1853,11 +1853,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_copy() */
} /* end H5B__copy() */
/*-------------------------------------------------------------------------
* Function: H5B_get_info_helper
* Function: H5B__get_info_helper
*
* Purpose: Walks the B-tree nodes, getting information for all of them.
*
@ -1870,7 +1870,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, hid_t dxpl_id, 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 */
@ -1883,7 +1883,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad
haddr_t left_child; /* Address of left-most child in node */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/*
* Check arguments.
@ -1951,7 +1951,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad
/* 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, dxpl_id, type, left_child, info_udata) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to list B-tree node")
} /* end if */
@ -1960,7 +1960,7 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_get_info_helper() */
} /* end H5B__get_info_helper() */
/*-------------------------------------------------------------------------
@ -2001,13 +2001,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, dxpl_id, 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, dxpl_id, type, addr, op, udata)) < 0)
HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed");
done:
@ -2072,7 +2072,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5B_node_dest
* Function: H5B__node_dest
*
* Purpose: Destroy/release a B-tree node
*
@ -2086,9 +2086,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5B_node_dest(H5B_t *bt)
H5B__node_dest(H5B_t *bt)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_PACKAGE_NOERR
/* check arguments */
HDassert(bt);
@ -2100,5 +2100,5 @@ H5B_node_dest(H5B_t *bt)
bt = H5FL_FREE(H5B_t, bt);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5B_node_dest() */
} /* end H5B__node_dest() */

View File

@ -146,7 +146,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, dxpl_id, cparam, ctx_udata)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't create v2 B-tree header")
/* Create v2 B-tree wrapper */
@ -161,11 +161,11 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat
/* Point v2 B-tree wrapper at header and bump it's ref count */
bt2->hdr = hdr;
if(H5B2_hdr_incr(bt2->hdr) < 0)
if(H5B2__hdr_incr(bt2->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment reference count on shared v2 B-tree header")
/* Increment # of files using this v2 B-tree header */
if(H5B2_hdr_fuse_incr(bt2->hdr) < 0)
if(H5B2__hdr_fuse_incr(bt2->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment file reference count on shared v2 B-tree header")
/* Set file pointer for this v2 B-tree open context */
@ -229,11 +229,11 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata)
/* Point v2 B-tree wrapper at header */
bt2->hdr = hdr;
if(H5B2_hdr_incr(bt2->hdr) < 0)
if(H5B2__hdr_incr(bt2->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment reference count on shared v2 B-tree header")
/* Increment # of files using this v2 B-tree header */
if(H5B2_hdr_fuse_incr(bt2->hdr) < 0)
if(H5B2__hdr_fuse_incr(bt2->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment file reference count on shared v2 B-tree header")
/* Set file pointer for this v2 B-tree open context */
@ -287,28 +287,28 @@ H5B2_insert(H5B2_t *bt2, 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->root)) < 0)
if(H5B2__create_leaf(hdr, dxpl_id, &(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, dxpl_id) < 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, udata) < 0)
if(H5B2__insert_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, 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, udata) < 0)
if(H5B2__insert_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node")
} /* end else */
/* Mark B-tree header as dirty */
if(H5B2_hdr_dirty(hdr) < 0)
if(H5B2__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark B-tree header dirty")
done:
@ -385,7 +385,7 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data)
/* Iterate through records */
if(hdr->root.node_nrec > 0) {
/* Iterate through nodes */
if((ret_value = H5B2_iterate_node(hdr, dxpl_id, hdr->depth, &hdr->root, op, op_data)) < 0)
if((ret_value = H5B2__iterate_node(hdr, dxpl_id, hdr->depth, &hdr->root, op, op_data)) < 0)
HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed");
} /* end if */
@ -422,7 +422,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op,
{
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */
unsigned depth; /* Current depth of the tree */
uint16_t depth; /* Current depth of the tree */
int cmp; /* Comparison value of records */
unsigned idx; /* Location of record which matches key */
H5B2_nodepos_t curr_pos; /* Position of the current node */
@ -479,11 +479,11 @@ 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, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* Locate node pointer for child */
cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx);
cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx);
if(cmp > 0)
idx++;
@ -542,11 +542,11 @@ 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, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ)))
if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Locate record */
cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx);
cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx);
if(cmp != 0) {
/* Unlock leaf node */
@ -622,7 +622,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx,
{
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */
unsigned depth; /* Current depth of the tree */
uint16_t depth; /* Current depth of the tree */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@ -662,7 +662,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, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* Search for record with correct index */
@ -734,7 +734,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, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ)))
if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Sanity check index */
@ -798,7 +798,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, hdr->depth,
if(H5B2__remove_internal(hdr, dxpl_id, &depth_decreased, 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")
@ -817,7 +817,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, udata, op, op_data) < 0)
if(H5B2__remove_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node")
} /* end else */
@ -825,7 +825,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op,
hdr->root.all_nrec--;
/* Mark B-tree header as dirty */
if(H5B2_hdr_dirty(hdr) < 0)
if(H5B2__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark B-tree header dirty")
done:
@ -880,7 +880,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, hdr->depth,
if(H5B2__remove_internal_by_idx(hdr, dxpl_id, &depth_decreased, 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")
@ -899,7 +899,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, (unsigned)idx, op, op_data) < 0)
if(H5B2__remove_leaf_by_idx(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, (unsigned)idx, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node")
} /* end else */
@ -907,7 +907,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order,
hdr->root.all_nrec--;
/* Mark B-tree header as dirty */
if(H5B2_hdr_dirty(hdr) < 0)
if(H5B2__hdr_dirty(hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTMARKDIRTY, FAIL, "unable to mark B-tree header dirty")
done:
@ -994,11 +994,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, udata, op, op_data) < 0)
if(H5B2__neighbor_internal(hdr, dxpl_id, hdr->depth, &hdr->root, NULL, range, 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, udata, op, op_data) < 0)
if(H5B2__neighbor_leaf(hdr, dxpl_id, &hdr->root, NULL, range, udata, op, op_data) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree leaf node")
} /* end else */
@ -1034,7 +1034,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op,
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */
H5B2_nodepos_t curr_pos; /* Position of current node */
unsigned depth; /* Current depth of the tree */
uint16_t depth; /* Current depth of the tree */
int cmp; /* Comparison value of records */
unsigned idx; /* Location of record which matches key */
herr_t ret_value = SUCCEED; /* Return value */
@ -1070,11 +1070,11 @@ 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, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_WRITE)))
if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* Locate node pointer for child */
cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx);
cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx);
if(cmp > 0)
idx++;
@ -1142,11 +1142,11 @@ 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, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_WRITE)))
if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_WRITE)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Locate record */
cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx);
cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx);
if(cmp != 0) {
/* Unlock leaf node */
@ -1238,7 +1238,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id)
HDassert(bt2->f);
/* Decrement file reference & check if this is the last open v2 B-tree using the shared B-tree header */
if(0 == H5B2_hdr_fuse_decr(bt2->hdr)) {
if(0 == H5B2__hdr_fuse_decr(bt2->hdr)) {
/* Set the shared v2 B-tree header's file context for this operation */
bt2->hdr->f = bt2->f;
@ -1283,22 +1283,22 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id)
hdr->f = bt2->f;
/* Decrement the reference count on the B-tree header */
/* (don't put in H5B2_hdr_fuse_decr() as the B-tree header may be evicted
/* (don't put in H5B2__hdr_fuse_decr() as the B-tree header may be evicted
* immediately -QAK)
*/
if(H5B2_hdr_decr(bt2->hdr) < 0)
if(H5B2__hdr_decr(bt2->hdr) < 0)
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, dxpl_id) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree")
} /* end if */
else {
/* Decrement the reference count on the B-tree header */
/* (don't put in H5B2_hdr_fuse_decr() as the B-tree header may be evicted
/* (don't put in H5B2__hdr_fuse_decr() as the B-tree header may be evicted
* immediately -QAK)
*/
if(H5B2_hdr_decr(bt2->hdr) < 0)
if(H5B2__hdr_decr(bt2->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement reference count on shared v2 B-tree header")
} /* end else */
@ -1368,7 +1368,7 @@ 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, dxpl_id) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree")
hdr = NULL;
} /* end if */

View File

@ -70,17 +70,17 @@
/* Metadata cache callbacks */
static H5B2_hdr_t *H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
static herr_t H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_hdr_t *hdr, unsigned UNUSED * flags_ptr);
static herr_t H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr);
static herr_t H5B2__cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr);
static herr_t H5B2__cache_hdr_clear(H5F_t *f, H5B2_hdr_t *hdr, hbool_t destroy);
static herr_t H5B2__cache_hdr_size(const H5F_t *f, const H5B2_hdr_t *hdr, size_t *size_ptr);
static H5B2_internal_t *H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
static herr_t H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *i, unsigned UNUSED * flags_ptr);
static herr_t H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *i, unsigned H5_ATTR_UNUSED * flags_ptr);
static herr_t H5B2__cache_internal_dest(H5F_t *f, H5B2_internal_t *internal);
static herr_t H5B2__cache_internal_clear(H5F_t *f, H5B2_internal_t *i, hbool_t destroy);
static herr_t H5B2__cache_internal_size(const H5F_t *f, const H5B2_internal_t *i, size_t *size_ptr);
static H5B2_leaf_t *H5B2__cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
static herr_t H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *l, unsigned UNUSED * flags_ptr);
static herr_t H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *l, unsigned H5_ATTR_UNUSED * flags_ptr);
static herr_t H5B2__cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf);
static herr_t H5B2__cache_leaf_clear(H5F_t *f, H5B2_leaf_t *l, hbool_t destroy);
static herr_t H5B2__cache_leaf_size(const H5F_t *f, const H5B2_leaf_t *l, size_t *size_ptr);
@ -173,7 +173,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
HDassert(udata);
/* Allocate new B-tree header and reset cache info */
if(NULL == (hdr = H5B2_hdr_alloc(udata->f)))
if(NULL == (hdr = H5B2__hdr_alloc(udata->f)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "allocation failed for B-tree header")
/* Wrap the local buffer for serialized header info */
@ -238,7 +238,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* Initialize B-tree header info */
cparam.cls = H5B2_client_class_g[id];
if(H5B2_hdr_init(hdr, &cparam, udata->ctx_udata, depth) < 0)
if(H5B2__hdr_init(hdr, &cparam, udata->ctx_udata, depth) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't initialize B-tree header info")
/* Set the B-tree header's address */
@ -252,7 +252,7 @@ done:
if(wb && H5WB_unwrap(wb) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer")
if(!ret_value && hdr)
if(H5B2_hdr_free(hdr) < 0)
if(H5B2__hdr_free(hdr) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, NULL, "can't release v2 B-tree header")
FUNC_LEAVE_NOAPI(ret_value)
@ -274,7 +274,7 @@ done:
*/
static herr_t
H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5B2_hdr_t *hdr, unsigned UNUSED * flags_ptr)
H5B2_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr)
{
H5WB_t *wb = NULL; /* Wrapped buffer for header data */
uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */
@ -282,7 +282,7 @@ H5B2__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
FUNC_ENTER_STATIC
/* check arguments */
/* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(hdr);
@ -399,7 +399,7 @@ H5B2__cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr)
} /* end if */
/* Release B-tree header info */
if(H5B2_hdr_free(hdr) < 0)
if(H5B2__hdr_free(hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free v2 B-tree header info")
done:
@ -460,11 +460,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B2__cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ptr)
H5B2__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ptr)
{
FUNC_ENTER_STATIC_NOERR
/* check arguments */
/* Check arguments */
HDassert(f);
HDassert(hdr);
HDassert(size_ptr);
@ -519,7 +519,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
udata->hdr->f = f;
/* Increment ref. count on B-tree header */
if(H5B2_hdr_incr(udata->hdr) < 0)
if(H5B2__hdr_incr(udata->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header")
/* Share B-tree information */
@ -601,7 +601,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
done:
if(!ret_value && internal)
if(H5B2_internal_free(internal) < 0)
if(H5B2__internal_free(internal) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree internal node")
FUNC_LEAVE_NOAPI(ret_value)
@ -622,13 +622,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *internal, unsigned UNUSED * flags_ptr)
H5B2__cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *internal, unsigned H5_ATTR_UNUSED * flags_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* check arguments */
/* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(internal);
@ -742,7 +742,7 @@ H5B2__cache_internal_dest(H5F_t *f, H5B2_internal_t *internal)
} /* end if */
/* Release v2 b-tree internal node */
if(H5B2_internal_free(internal) < 0)
if(H5B2__internal_free(internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree internal node")
done:
@ -803,11 +803,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B2__cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal, size_t *size_ptr)
H5B2__cache_internal_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_internal_t *internal, size_t *size_ptr)
{
FUNC_ENTER_STATIC_NOERR
/* check arguments */
/* Check arguments */
HDassert(internal);
HDassert(internal->hdr);
HDassert(size_ptr);
@ -834,7 +834,7 @@ H5B2__cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal
*-------------------------------------------------------------------------
*/
static H5B2_leaf_t *
H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata)
H5B2__cache_leaf_load(H5F_t H5_ATTR_UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata)
{
H5B2_leaf_cache_ud_t *udata = (H5B2_leaf_cache_ud_t *)_udata;
H5B2_leaf_t *leaf = NULL; /* Pointer to lead node loaded */
@ -854,14 +854,14 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata
/* Allocate new leaf node and reset cache info */
if(NULL == (leaf = H5FL_MALLOC(H5B2_leaf_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed")
HDmemset(&leaf->cache_info, 0, sizeof(H5AC_info_t));
/* Set the B-tree header's file context for this operation */
udata->hdr->f = udata->f;
/* Increment ref. count on B-tree header */
if(H5B2_hdr_incr(udata->hdr) < 0)
if(H5B2__hdr_incr(udata->hdr) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, NULL, "can't increment ref. count on B-tree header")
/* Share B-tree header information */
@ -875,12 +875,12 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata
/* Magic number */
if(HDmemcmp(p, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node signature")
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree leaf node signature")
p += H5_SIZEOF_MAGIC;
/* Version */
if(*p++ != H5B2_LEAF_VERSION)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree leaf node version")
HGOTO_ERROR(H5E_BTREE, H5E_BADRANGE, NULL, "wrong B-tree leaf node version")
/* B-tree type */
if(*p++ != (uint8_t)udata->hdr->cls->id)
@ -888,7 +888,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata
/* Allocate space for the native keys in memory */
if(NULL == (leaf->leaf_native = (uint8_t *)H5FL_FAC_MALLOC(udata->hdr->node_info[0].nat_rec_fac)))
HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "memory allocation failed for B-tree leaf native keys")
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree leaf native keys")
/* Set the number of records in the leaf */
leaf->nrec = udata->nrec;
@ -905,7 +905,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata
native += udata->hdr->cls->nrec_size;
} /* end for */
/* Compute checksum on internal node */
/* Compute checksum on leaf node */
computed_chksum = H5_checksum_metadata(udata->hdr->page, (size_t)(p - (const uint8_t *)udata->hdr->page), 0);
/* Metadata checksum */
@ -923,7 +923,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata
done:
if(!ret_value && leaf)
if(H5B2_leaf_free(leaf) < 0)
if(H5B2__leaf_free(leaf) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree leaf node")
FUNC_LEAVE_NOAPI(ret_value)
@ -944,13 +944,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *leaf, unsigned UNUSED * flags_ptr)
H5B2__cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *leaf, unsigned H5_ATTR_UNUSED * flags_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* check arguments */
/* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(leaf);
@ -1050,7 +1050,7 @@ H5B2__cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf)
} /* end if */
/* Destroy v2 b-tree leaf node */
if(H5B2_leaf_free(leaf) < 0)
if(H5B2__leaf_free(leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node")
done:
@ -1111,7 +1111,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B2__cache_leaf_size(const H5F_t UNUSED *f, const H5B2_leaf_t *leaf, size_t *size_ptr)
H5B2__cache_leaf_size(const H5F_t H5_ATTR_UNUSED *f, const H5B2_leaf_t *leaf, size_t *size_ptr)
{
FUNC_ENTER_STATIC_NOERR

View File

@ -74,7 +74,7 @@
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_debug
* Function: H5B2__hdr_debug
*
* Purpose: Prints debugging info about a B-tree header.
*
@ -87,7 +87,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, hid_t dxpl_id, 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 */
@ -97,7 +97,7 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_PACKAGE
/*
* Check arguments.
@ -185,11 +185,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_debug() */
} /* end H5B2__hdr_debug() */
/*-------------------------------------------------------------------------
* Function: H5B2_int_debug
* Function: H5B2__int_debug
*
* Purpose: Prints debugging info about a B-tree internal node
*
@ -202,7 +202,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, 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)
{
H5B2_hdr_t *hdr = NULL; /* B-tree header */
@ -213,7 +213,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_PACKAGE
/*
* Check arguments.
@ -251,7 +251,9 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
/*
* Load the B-tree internal node
*/
if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, addr, nrec, depth, H5AC_READ)))
H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t);
H5_CHECK_OVERFLOW(depth, unsigned, uint16_t);
if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, addr, (uint16_t)nrec, (uint16_t)depth, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node")
/* Print opening message */
@ -317,11 +319,11 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree internal node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_int_debug() */
} /* end H5B2__int_debug() */
/*-------------------------------------------------------------------------
* Function: H5B2_leaf_debug
* Function: H5B2__leaf_debug
*
* Purpose: Prints debugging info about a B-tree leaf node
*
@ -334,7 +336,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, 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)
{
H5B2_hdr_t *hdr = NULL; /* B-tree header */
@ -345,7 +347,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
char temp_str[128]; /* Temporary string, for formatting */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_PACKAGE
/*
* Check arguments.
@ -383,7 +385,8 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
/*
* Load the B-tree leaf node
*/
if(NULL == (leaf = H5B2_protect_leaf(hdr, dxpl_id, addr, nrec, H5AC_READ)))
H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t);
if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, addr, (uint16_t)nrec, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Print opening message */
@ -430,5 +433,5 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree leaf node")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_leaf_debug() */
} /* end H5B2__leaf_debug() */

View File

@ -94,7 +94,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t);
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_init
* Function: H5B2__hdr_init
*
* Purpose: Allocate & initialize B-tree header info
*
@ -107,7 +107,7 @@ H5FL_SEQ_DEFINE(H5B2_node_info_t);
*-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata,
H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata,
uint16_t depth)
{
size_t sz_max_nrec; /* Temporary variable for range checking */
@ -115,7 +115,7 @@ H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata,
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/*
* Check arguments.
@ -160,7 +160,7 @@ HDmemset(hdr->page, 0, hdr->node_size);
/* Initialize leaf node info */
sz_max_nrec = H5B2_NUM_LEAF_REC(hdr->node_size, hdr->rrec_size);
H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[0].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned)
H5_CHECKED_ASSIGN(hdr->node_info[0].max_nrec, unsigned, sz_max_nrec, size_t)
hdr->node_info[0].split_nrec = (hdr->node_info[0].max_nrec * hdr->split_percent) / 100;
hdr->node_info[0].merge_nrec = (hdr->node_info[0].max_nrec * hdr->merge_percent) / 100;
hdr->node_info[0].cum_max_nrec = hdr->node_info[0].max_nrec;
@ -182,14 +182,14 @@ HDmemset(hdr->page, 0, hdr->node_size);
/* Compute size to store # of records in each node */
/* (uses leaf # of records because its the largest) */
u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec);
H5_ASSIGN_OVERFLOW(/* To: */ hdr->max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t)
H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned)
HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE);
/* Initialize internal node info */
if(depth > 0) {
for(u = 1; u < (unsigned)(depth + 1); u++) {
sz_max_nrec = H5B2_NUM_INT_REC(hdr, u);
H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned)
H5_CHECKED_ASSIGN(hdr->node_info[u].max_nrec, unsigned, sz_max_nrec, size_t)
HDassert(hdr->node_info[u].max_nrec <= hdr->node_info[u - 1].max_nrec);
hdr->node_info[u].split_nrec = (hdr->node_info[u].max_nrec * hdr->split_percent) / 100;
@ -198,7 +198,7 @@ HDmemset(hdr->page, 0, hdr->node_size);
hdr->node_info[u].cum_max_nrec = ((hdr->node_info[u].max_nrec + 1) *
hdr->node_info[u - 1].cum_max_nrec) + hdr->node_info[u].max_nrec;
u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec);
H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].cum_max_nrec_size, /* From: */ u_max_nrec_size, /* From: */ unsigned, /* To: */ uint8_t)
H5_CHECKED_ASSIGN(hdr->node_info[u].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned)
if(NULL == (hdr->node_info[u].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[u].max_nrec)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't create node native key block factory")
@ -215,15 +215,15 @@ HDmemset(hdr->page, 0, hdr->node_size);
done:
if(ret_value < 0)
if(H5B2_hdr_free(hdr) < 0)
if(H5B2__hdr_free(hdr) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free shared v2 B-tree info")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_init() */
} /* end H5B2__hdr_init() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_alloc
* Function: H5B2__hdr_alloc
*
* Purpose: Allocate B-tree header
*
@ -236,12 +236,12 @@ done:
*-------------------------------------------------------------------------
*/
H5B2_hdr_t *
H5B2_hdr_alloc(H5F_t *f)
H5B2__hdr_alloc(H5F_t *f)
{
H5B2_hdr_t *hdr = NULL; /* v2 B-tree header */
H5B2_hdr_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/*
* Check arguments.
@ -256,7 +256,7 @@ H5B2_hdr_alloc(H5F_t *f)
hdr->f = f;
hdr->sizeof_addr = H5F_SIZEOF_ADDR(f);
hdr->sizeof_size = H5F_SIZEOF_SIZE(f);
hdr->hdr_size = H5B2_HEADER_SIZE(hdr);
hdr->hdr_size = H5B2_HEADER_SIZE_HDR(hdr);
hdr->root.addr = HADDR_UNDEF;
/* Set return value */
@ -265,11 +265,11 @@ H5B2_hdr_alloc(H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_alloc() */
} /* end H5B2__hdr_alloc() */
/*-------------------------------------------------------------------------
* Function: H5HF_hdr_create
* Function: H5B2__hdr_create
*
* Purpose: Create new fractal heap header
*
@ -282,13 +282,13 @@ done:
*-------------------------------------------------------------------------
*/
haddr_t
H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam,
H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam,
void *ctx_udata)
{
H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */
haddr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/*
* Check arguments.
@ -297,11 +297,11 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam,
HDassert(cparam);
/* Allocate v2 B-tree header */
if(NULL == (hdr = H5B2_hdr_alloc(f)))
if(NULL == (hdr = H5B2__hdr_alloc(f)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed for B-tree header")
/* Initialize shared B-tree info */
if(H5B2_hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0)
if(H5B2__hdr_init(hdr, cparam, ctx_udata, (uint16_t)0) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info")
/* Allocate space for the header on disk */
@ -317,15 +317,15 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam,
done:
if(!H5F_addr_defined(ret_value) && hdr)
if(H5B2_hdr_free(hdr) < 0)
if(H5B2__hdr_free(hdr) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, HADDR_UNDEF, "unable to release v2 B-tree header")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_create() */
} /* end H5B2__hdr_create() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_incr
* Function: H5B2__hdr_incr
*
* Purpose: Increment reference count on B-tree header
*
@ -338,11 +338,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_incr(H5B2_hdr_t *hdr)
H5B2__hdr_incr(H5B2_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/* Sanity checks */
HDassert(hdr);
@ -357,11 +357,11 @@ H5B2_hdr_incr(H5B2_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_incr_hdr() */
} /* end H5B2__hdr_incr() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_decr
* Function: H5B2__hdr_decr
*
* Purpose: Decrement reference count on B-tree header
*
@ -374,11 +374,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_decr(H5B2_hdr_t *hdr)
H5B2__hdr_decr(H5B2_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@ -394,11 +394,11 @@ H5B2_hdr_decr(H5B2_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_decr() */
} /* end H5B2__hdr_decr() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_fuse_incr
* Function: H5B2__hdr_fuse_incr
*
* Purpose: Increment file reference count on shared v2 B-tree header
*
@ -411,7 +411,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr)
H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@ -422,11 +422,11 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr)
hdr->file_rc++;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5B2_hdr_fuse_incr() */
} /* end H5B2__hdr_fuse_incr() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_fuse_decr
* Function: H5B2__hdr_fuse_decr
*
* Purpose: Decrement file reference count on shared v2 B-tree header
*
@ -439,7 +439,7 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr)
*-------------------------------------------------------------------------
*/
size_t
H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr)
H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@ -451,11 +451,11 @@ H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr)
hdr->file_rc--;
FUNC_LEAVE_NOAPI(hdr->file_rc)
} /* end H5B2_hdr_fuse_decr() */
} /* end H5B2__hdr_fuse_decr() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_dirty
* Function: H5B2__hdr_dirty
*
* Purpose: Mark B-tree header as dirty
*
@ -468,11 +468,11 @@ H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr)
*-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_dirty(H5B2_hdr_t *hdr)
H5B2__hdr_dirty(H5B2_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@ -483,11 +483,11 @@ H5B2_hdr_dirty(H5B2_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_dirty() */
} /* end H5B2__hdr_dirty() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_free
* Function: H5B2__hdr_free
*
* Purpose: Free B-tree header info
*
@ -500,11 +500,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_free(H5B2_hdr_t *hdr)
H5B2__hdr_free(H5B2_hdr_t *hdr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@ -557,11 +557,11 @@ H5B2_hdr_free(H5B2_hdr_t *hdr)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_free() */
} /* end H5B2__hdr_free() */
/*-------------------------------------------------------------------------
* Function: H5B2_hdr_delete
* Function: H5B2__hdr_delete
*
* Purpose: Delete a v2 B-tree, starting with the header
*
@ -574,12 +574,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id)
H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id)
{
unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting v2 B-tree header */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(hdr);
@ -600,7 +600,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->remove_op, hdr->remove_op_data) < 0)
if(H5B2__delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, 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 */
@ -612,5 +612,5 @@ done:
HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree header")
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B2_hdr_delete() */
} /* end H5B2__hdr_delete() */

File diff suppressed because it is too large Load Diff

View File

@ -45,10 +45,10 @@
/* Size of a "tree pointer" (on disk) */
/* (essentially, the largest internal pointer allowed) */
#define H5B2_TREE_POINTER_SIZE(h) ( \
(h)->sizeof_addr + \
#define H5B2_TREE_POINTER_SIZE(sizeof_addr, sizeof_size) ( \
(sizeof_addr) + \
H5B2_SIZEOF_RECORDS_PER_NODE + \
(h)->sizeof_size \
(sizeof_size) \
)
/* Size of a internal node pointer (on disk) */
@ -70,7 +70,7 @@
)
/* Size of the v2 B-tree header on disk */
#define H5B2_HEADER_SIZE(h) ( \
#define H5B2_HEADER_SIZE(sizeof_addr, sizeof_size) ( \
/* General metadata fields */ \
H5B2_METADATA_PREFIX_SIZE \
\
@ -80,7 +80,17 @@
+ (unsigned)2 /* Depth of tree */ \
+ (unsigned)1 /* Split % of full (as integer, ie. "98" means 98%) */ \
+ (unsigned)1 /* Merge % of full (as integer, ie. "98" means 98%) */ \
+ H5B2_TREE_POINTER_SIZE(h) /* Node pointer to root node in tree */ \
+ H5B2_TREE_POINTER_SIZE(sizeof_addr, sizeof_size) /* Node pointer to root node in tree */ \
)
/* Size of the v2 B-tree header on disk (via file pointer) */
#define H5B2_HEADER_SIZE_FILE(f) ( \
H5B2_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \
)
/* Size of the v2 B-tree header on disk (via v2 B-tree header) */
#define H5B2_HEADER_SIZE_HDR(h) ( \
H5B2_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \
)
/* Size of the v2 B-tree internal node prefix */
@ -228,15 +238,15 @@ typedef struct H5B2_hdr_cache_ud_t {
typedef struct H5B2_internal_cache_ud_t {
H5F_t *f; /* File that v2 b-tree header is within */
H5B2_hdr_t *hdr; /* v2 B-tree header */
unsigned nrec; /* Number of records in node to load */
unsigned depth; /* Depth of node to load */
uint16_t nrec; /* Number of records in node to load */
uint16_t depth; /* Depth of node to load */
} H5B2_internal_cache_ud_t;
/* Callback info for loading a free space leaf node into the cache */
typedef struct H5B2_leaf_cache_ud_t {
H5F_t *f; /* File that v2 b-tree header is within */
H5B2_hdr_t *hdr; /* v2 B-tree header */
unsigned nrec; /* Number of records in node to load */
uint16_t nrec; /* Number of records in node to load */
} H5B2_leaf_cache_ud_t;
#ifdef H5B2_TESTING
@ -281,88 +291,88 @@ extern const H5B2_class_t *const H5B2_client_class_g[H5B2_NUM_BTREE_ID];
/******************************/
/* 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,
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 herr_t H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam,
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);
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 herr_t H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id);
H5_DLL herr_t H5B2__hdr_incr(H5B2_hdr_t *hdr);
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 herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id);
/* Routines for operating on leaf nodes */
H5B2_leaf_t *H5B2_protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr,
unsigned nrec, H5AC_protect_t rw);
H5B2_leaf_t *H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr,
uint16_t nrec, H5AC_protect_t rw);
/* Routines for operating on internal nodes */
H5_DLL H5B2_internal_t *H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
haddr_t addr, unsigned nrec, unsigned depth, H5AC_protect_t rw);
H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
haddr_t addr, uint16_t nrec, uint16_t depth, H5AC_protect_t rw);
/* 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,
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,
H5B2_node_ptr_t *node_ptr);
/* Routines for releasing structures */
H5_DLL herr_t H5B2_hdr_free(H5B2_hdr_t *hdr);
H5_DLL herr_t H5B2_leaf_free(H5B2_leaf_t *l);
H5_DLL herr_t H5B2_internal_free(H5B2_internal_t *i);
H5_DLL herr_t H5B2__hdr_free(H5B2_hdr_t *hdr);
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_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
unsigned depth, unsigned *parent_cache_info_flags_ptr,
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 *udata);
H5_DLL herr_t H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
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 *udata);
/* Routines for iterating over nodes/records */
H5_DLL herr_t H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
H5_DLL herr_t H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
const H5B2_node_ptr_t *curr_node, H5B2_operator_t op, void *op_data);
H5_DLL herr_t H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id,
unsigned depth, const H5B2_node_ptr_t *curr_node, hsize_t *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, hsize_t *op_data);
/* Routines for locating records */
H5_DLL int H5B2_locate_record(const H5B2_class_t *type, unsigned nrec,
H5_DLL int H5B2__locate_record(const H5B2_class_t *type, unsigned nrec,
size_t *rec_off, const uint8_t *native, const void *udata, unsigned *idx);
H5_DLL herr_t H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
unsigned depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc,
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 *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_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc,
H5B2_compare_t comp, 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, unsigned depth,
H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr,
H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
hbool_t *depth_decreased, void *swap_loc, uint16_t depth,
H5AC_info_t *parent_cache_info, hbool_t *parent_cache_info_dirtied_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,
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 *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,
hbool_t *depth_decreased, void *swap_loc, unsigned 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,
H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
hbool_t *depth_decreased, void *swap_loc, uint16_t depth,
H5AC_info_t *parent_cache_info, hbool_t *parent_cache_info_dirtied_ptr,
H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t idx,
H5B2_remove_t op, void *op_data);
H5_DLL herr_t H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
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,
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, unsigned depth,
H5_DLL herr_t H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth,
const H5B2_node_ptr_t *curr_node, 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,
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,
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,
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);

View File

@ -139,7 +139,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, btree_size) < 0)
if(H5B2__node_size(hdr, dxpl_id, hdr->depth, &hdr->root, btree_size) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed")
} /* end if */

View File

@ -61,15 +61,15 @@ typedef struct H5B2_test_ctx_t {
/* Local Prototypes */
/********************/
static void *H5B2_test_crt_context(void *udata);
static herr_t H5B2_test_dst_context(void *ctx);
static herr_t H5B2_test_store(void *nrecord, const void *udata);
static herr_t H5B2_test_compare(const void *rec1, const void *rec2);
static herr_t H5B2_test_encode(uint8_t *raw, const void *nrecord, void *ctx);
static herr_t H5B2_test_decode(const uint8_t *raw, void *nrecord, void *ctx);
static herr_t H5B2_test_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
static void *H5B2__test_crt_context(void *udata);
static herr_t H5B2__test_dst_context(void *ctx);
static herr_t H5B2__test_store(void *nrecord, const void *udata);
static herr_t H5B2__test_compare(const void *rec1, const void *rec2);
static herr_t H5B2__test_encode(uint8_t *raw, const void *nrecord, void *ctx);
static herr_t H5B2__test_decode(const uint8_t *raw, void *nrecord, void *ctx);
static herr_t H5B2__test_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id,
int indent, int fwidth, const void *record, const void *_udata);
static void *H5B2_test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr);
static void *H5B2__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr);
/*********************/
@ -80,15 +80,15 @@ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */
H5B2_TEST_ID, /* Type of B-tree */
"H5B2_TEST_ID", /* Name of B-tree class */
sizeof(hsize_t), /* Size of native record */
H5B2_test_crt_context, /* Create client callback context */
H5B2_test_dst_context, /* Destroy client callback context */
H5B2_test_store, /* Record storage callback */
H5B2_test_compare, /* Record comparison callback */
H5B2_test_encode, /* Record encoding callback */
H5B2_test_decode, /* Record decoding callback */
H5B2_test_debug, /* Record debugging callback */
H5B2_test_crt_dbg_context, /* Create debugging context */
H5B2_test_dst_context /* Destroy debugging context */
H5B2__test_crt_context, /* Create client callback context */
H5B2__test_dst_context, /* Destroy client callback context */
H5B2__test_store, /* Record storage callback */
H5B2__test_compare, /* Record comparison callback */
H5B2__test_encode, /* Record encoding callback */
H5B2__test_decode, /* Record decoding callback */
H5B2__test_debug, /* Record debugging callback */
H5B2__test_crt_dbg_context, /* Create debugging context */
H5B2__test_dst_context /* Destroy debugging context */
}};
@ -107,7 +107,7 @@ H5FL_DEFINE_STATIC(H5B2_test_ctx_t);
/*-------------------------------------------------------------------------
* Function: H5B2_test_crt_context
* Function: H5B2__test_crt_context
*
* Purpose: Create client callback context
*
@ -120,13 +120,13 @@ H5FL_DEFINE_STATIC(H5B2_test_ctx_t);
*-------------------------------------------------------------------------
*/
static void *
H5B2_test_crt_context(void *_f)
H5B2__test_crt_context(void *_f)
{
H5F_t *f = (H5F_t *)_f; /* User data for building callback context */
H5B2_test_ctx_t *ctx; /* Callback context structure */
void *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@ -143,11 +143,11 @@ H5B2_test_crt_context(void *_f)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2_test_crt_context() */
} /* H5B2__test_crt_context() */
/*-------------------------------------------------------------------------
* Function: H5B2_test_dst_context
* Function: H5B2__test_dst_context
*
* Purpose: Destroy client callback context
*
@ -160,11 +160,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B2_test_dst_context(void *_ctx)
H5B2__test_dst_context(void *_ctx)
{
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
@ -173,11 +173,11 @@ H5B2_test_dst_context(void *_ctx)
ctx = H5FL_FREE(H5B2_test_ctx_t, ctx);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5B2_test_dst_context() */
} /* H5B2__test_dst_context() */
/*-------------------------------------------------------------------------
* Function: H5B2_test_store
* Function: H5B2__test_store
*
* Purpose: Store native information into record for B-tree
*
@ -190,18 +190,18 @@ H5B2_test_dst_context(void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
H5B2_test_store(void *nrecord, const void *udata)
H5B2__test_store(void *nrecord, const void *udata)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
*(hsize_t *)nrecord = *(const hsize_t *)udata;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5B2_test_store() */
} /* H5B2__test_store() */
/*-------------------------------------------------------------------------
* Function: H5B2_test_compare
* Function: H5B2__test_compare
*
* Purpose: Compare two native information records, according to some key
*
@ -215,16 +215,16 @@ H5B2_test_store(void *nrecord, const void *udata)
*-------------------------------------------------------------------------
*/
static herr_t
H5B2_test_compare(const void *rec1, const void *rec2)
H5B2__test_compare(const void *rec1, const void *rec2)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI((herr_t)(*(const hssize_t *)rec1 - *(const hssize_t *)rec2))
} /* H5B2_test_compare() */
} /* H5B2__test_compare() */
/*-------------------------------------------------------------------------
* Function: H5B2_test_encode
* Function: H5B2__test_encode
*
* Purpose: Encode native information into raw form for storing on disk
*
@ -237,11 +237,11 @@ H5B2_test_compare(const void *rec1, const void *rec2)
*-------------------------------------------------------------------------
*/
static herr_t
H5B2_test_encode(uint8_t *raw, const void *nrecord, void *_ctx)
H5B2__test_encode(uint8_t *raw, const void *nrecord, void *_ctx)
{
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
@ -249,11 +249,11 @@ H5B2_test_encode(uint8_t *raw, const void *nrecord, void *_ctx)
H5F_ENCODE_LENGTH_LEN(raw, *(const hsize_t *)nrecord, ctx->sizeof_size);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5B2_test_encode() */
} /* H5B2__test_encode() */
/*-------------------------------------------------------------------------
* Function: H5B2_test_decode
* Function: H5B2__test_decode
*
* Purpose: Decode raw disk form of record into native form
*
@ -266,11 +266,11 @@ H5B2_test_encode(uint8_t *raw, const void *nrecord, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
H5B2_test_decode(const uint8_t *raw, void *nrecord, void *_ctx)
H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx)
{
H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(ctx);
@ -278,11 +278,11 @@ H5B2_test_decode(const uint8_t *raw, void *nrecord, void *_ctx)
H5F_DECODE_LENGTH_LEN(raw, *(hsize_t *)nrecord, ctx->sizeof_size);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5B2_test_decode() */
} /* H5B2__test_decode() */
/*-------------------------------------------------------------------------
* Function: H5B2_test_debug
* Function: H5B2__test_debug
*
* Purpose: Debug native form of record
*
@ -295,11 +295,11 @@ H5B2_test_decode(const uint8_t *raw, void *nrecord, void *_ctx)
*-------------------------------------------------------------------------
*/
static herr_t
H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
H5B2__test_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
int indent, int fwidth, const void *record,
const void UNUSED *_udata)
const void H5_ATTR_UNUSED *_udata)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
HDassert (record);
@ -307,11 +307,11 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
*(const hsize_t *)record);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5B2_test_debug() */
} /* H5B2__test_debug() */
/*-------------------------------------------------------------------------
* Function: H5B2_test_crt_dbg_context
* Function: H5B2__test_crt_dbg_context
*
* Purpose: Create context for debugging callback
*
@ -324,12 +324,12 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
*-------------------------------------------------------------------------
*/
static void *
H5B2_test_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr)
H5B2__test_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr)
{
H5B2_test_ctx_t *ctx; /* Callback context structure */
void *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@ -346,7 +346,7 @@ H5B2_test_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5B2_test_crt_dbg_context() */
} /* H5B2__test_crt_dbg_context() */
/*-------------------------------------------------------------------------
@ -397,7 +397,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata,
{
H5B2_hdr_t *hdr; /* Pointer to the B-tree header */
H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */
unsigned depth; /* Current depth of the tree */
uint16_t depth; /* Current depth of the tree */
int cmp; /* Comparison value of records */
unsigned idx; /* Location of record which matches key */
herr_t ret_value = SUCCEED; /* Return value */
@ -430,11 +430,11 @@ 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, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
/* Locate node pointer for child */
cmp = H5B2_locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx);
cmp = H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx);
if(cmp > 0)
idx++;
@ -470,11 +470,11 @@ 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, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ)))
if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, H5AC_READ)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Locate record */
cmp = H5B2_locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx);
cmp = H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx);
/* Unlock current node */
if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0)
@ -499,7 +499,7 @@ done:
*
* Purpose: Determine the depth of a node holding a record in the B-tree
*
* Note: Just a simple wrapper around the H5B2_get_node_info_test() routine
* Note: Just a simple wrapper around the H5B2__get_node_info_test() routine
*
* Return: Success: non-negative depth of the node where the record
* was found

View File

@ -56,7 +56,7 @@
/* Metadata cache callbacks */
static H5B_t *H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
static herr_t H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned UNUSED * flags_ptr);
static herr_t H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned H5_ATTR_UNUSED * flags_ptr);
static herr_t H5B__dest(H5F_t *f, H5B_t *bt);
static herr_t H5B__clear(H5F_t *f, H5B_t *b, hbool_t destroy);
static herr_t H5B__compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr);
@ -115,6 +115,7 @@ H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
HDassert(H5F_addr_defined(addr));
HDassert(udata);
/* Allocate the B-tree node in memory */
if(NULL == (bt = H5FL_MALLOC(H5B_t)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate B-tree struct")
HDmemset(&bt->cache_info, 0, sizeof(H5AC_info_t));
@ -141,7 +142,7 @@ H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
/* magic number */
if(HDmemcmp(p, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC))
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "wrong B-tree signature")
HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "wrong B-tree signature")
p += 4;
/* node type and level */
@ -185,7 +186,7 @@ H5B__load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
done:
if(!ret_value && bt)
if(H5B_node_dest(bt) < 0)
if(H5B__node_dest(bt) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree node")
FUNC_LEAVE_NOAPI(ret_value)
@ -206,7 +207,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, unsigned UNUSED * flags_ptr)
H5B__flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, unsigned H5_ATTR_UNUSED * flags_ptr)
{
H5B_shared_t *shared; /* Pointer to shared B-tree info */
herr_t ret_value = SUCCEED; /* Return value */
@ -328,7 +329,7 @@ H5B__dest(H5F_t *f, H5B_t *bt)
} /* end if */
/* Destroy B-tree node */
if(H5B_node_dest(bt) < 0)
if(H5B__node_dest(bt) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node")
done:
@ -388,7 +389,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5B__compute_size(const H5F_t UNUSED *f, const H5B_t *bt, size_t *size_ptr)
H5B__compute_size(const H5F_t H5_ATTR_UNUSED *f, const H5B_t *bt, size_t *size_ptr)
{
H5B_shared_t *shared; /* Pointer to shared B-tree info */

View File

@ -156,7 +156,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5B_assert
* Function: H5B__assert
*
* Purpose: Verifies that the tree is structured correctly.
*
@ -171,7 +171,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, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void *udata)
{
H5B_t *bt = NULL;
H5UC_t *rc_shared; /* Ref-counted shared info */
@ -189,7 +189,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void
struct child_t *next;
} *head = NULL, *tail = NULL, *prev = NULL, *cur = NULL, *tmp = NULL;
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
if(0 == ncalls++) {
if(H5DEBUG(B))
@ -285,6 +285,6 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5B_assert() */
} /* end H5B__assert() */
#endif /* H5B_DEBUG */

View File

@ -88,9 +88,9 @@ H5FL_EXTERN(H5B_t);
/******************************/
/* Package Private Prototypes */
/******************************/
H5_DLL herr_t H5B_node_dest(H5B_t *bt);
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,
herr_t H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type,
void *udata);
#endif

View File

@ -100,6 +100,7 @@ typedef struct H5B_shared_t {
size_t sizeof_len; /* Size of file lengths (in bytes) */
uint8_t *page; /* Disk page */
size_t *nkey; /* Offsets of each native key in native key buffer */
void *udata; /* 'Local' info for a B-tree */
} H5B_shared_t;
/*

571
src/H5C.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,9 @@
#include "H5private.h" /* Generic Functions */
#include "H5Fprivate.h" /* File access */
/**************************/
/* Library Private Macros */
/**************************/
#define H5C_DO_SANITY_CHECKS 0
#define H5C_DO_TAGGING_SANITY_CHECKS 1
@ -61,36 +64,162 @@
* H5C_COLLECT_CACHE_STATS is also defined to true.
*/
#if H5C_COLLECT_CACHE_STATS
#define H5C_COLLECT_CACHE_ENTRY_STATS 1
#else
#define H5C_COLLECT_CACHE_ENTRY_STATS 0
#endif /* H5C_COLLECT_CACHE_STATS */
#ifdef H5_HAVE_PARALLEL
/* we must maintain the clean and dirty LRU lists when we are compiled
* with parallel support.
*/
#define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 1
#else /* H5_HAVE_PARALLEL */
/* The clean and dirty LRU lists don't buy us anything here -- we may
* want them on for testing on occasion, but in general they should be
* off.
*/
#define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 0
#endif /* H5_HAVE_PARALLEL */
/* Flags returned from the 'flush' callback */
#define H5C_CALLBACK__NO_FLAGS_SET 0x0
#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
#define H5C_CALLBACK__MOVED_FLAG 0x2
/* Upper and lower limits on cache size. These limits are picked
* out of a hat -- you should be able to change them as necessary.
*
* However, if you need a very big cache, you should also increase the
* size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current
* upper bound on cache size is rather large for the current hash table
* size.
*/
#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
/* Default max cache size and min clean size are give here to make
* them generally accessable.
*/
#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
/* Maximum height of flush dependency relationships between entries. This is
* currently tuned to the extensible array (H5EA) data structure, which only
* requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible
* array needs 4 levels, plus another 2 levels are needed: one for the layer
* under the extensible array and one for the layer above it).
*/
#define H5C__NUM_FLUSH_DEP_HEIGHTS 6
#ifndef NDEBUG
/* Values for cache entry magic field */
#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
#endif /* NDEBUG */
/* Cache configuration validation definitions */
#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1
#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2
#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4
#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8
#define H5C_RESIZE_CFG__VALIDATE_ALL \
( \
H5C_RESIZE_CFG__VALIDATE_GENERAL | \
H5C_RESIZE_CFG__VALIDATE_INCREMENT | \
H5C_RESIZE_CFG__VALIDATE_DECREMENT | \
H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
)
/* Cache configuration versions */
#define H5C__CURR_AUTO_SIZE_CTL_VER 1
#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
/* Number of epoch markers active */
#define H5C__MAX_EPOCH_MARKERS 10
/* Default configuration settings */
#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
#define H5C__DEF_AR_INCREMENT 2.0f
#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
#define H5C__DEF_AR_DECREMENT 0.9f
#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_EPCHS_B4_EVICT 3
#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
#define H5C__MIN_AR_EPOCH_LENGTH 100
#define H5C__DEF_AR_EPOCH_LENGTH 50000
#define H5C__MAX_AR_EPOCH_LENGTH 1000000
/* #defines of flags used in the flags parameters in some of the
* cache calls. Note that not all flags are applicable
* to all function calls. Flags that don't apply to a particular
* function are ignored in that function.
*
* These flags apply to all function calls:
* H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
*
*
* These flags apply to H5C_insert_entry():
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__PIN_ENTRY_FLAG
*
* These flags apply to H5C_protect()
* H5C__READ_ONLY_FLAG
*
* These flags apply to H5C_unprotect():
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__DELETED_FLAG
* H5C__DIRTIED_FLAG
* H5C__PIN_ENTRY_FLAG
* H5C__UNPIN_ENTRY_FLAG
* H5C__FREE_FILE_SPACE_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*
* These flags apply to H5C_expunge_entry():
* H5C__FREE_FILE_SPACE_FLAG
*
* These flags apply to H5C_flush_cache():
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination
* with H5C__FLUSH_INVALIDATE_FLAG)
*
* These flags apply to H5C_flush_single_entry():
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*/
#define H5C__NO_FLAGS_SET 0x0000
#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
#define H5C__DELETED_FLAG 0x0002
#define H5C__DIRTIED_FLAG 0x0004
#define H5C__PIN_ENTRY_FLAG 0x0008
#define H5C__UNPIN_ENTRY_FLAG 0x0010
#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
#define H5C__READ_ONLY_FLAG 0x0200
#define H5C__FREE_FILE_SPACE_FLAG 0x0800
#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
#define H5C__FLUSH_LAST_FLAG 0x2000
#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000
/****************************/
/* Library Private Typedefs */
/****************************/
/* Typedef for the main structure for the cache (defined in H5Cpkg.h) */
typedef struct H5C_t H5C_t;
@ -121,10 +250,6 @@ typedef struct H5C_t H5C_t;
* Note that the space allocated on disk may not be contiguous.
*/
#define H5C_CALLBACK__NO_FLAGS_SET 0x0
#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
#define H5C_CALLBACK__MOVED_FLAG 0x2
/* Actions that can be reported to 'notify' client callback */
typedef enum H5C_notify_action_t {
H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache */
@ -135,27 +260,18 @@ typedef enum H5C_notify_action_t {
H5C_NOTIFY_ACTION_BEFORE_EVICT /* Entry is about to be evicted from cache */
} H5C_notify_action_t;
typedef void *(*H5C_load_func_t)(H5F_t *f,
hid_t dxpl_id,
haddr_t addr,
void *udata);
typedef herr_t (*H5C_flush_func_t)(H5F_t *f,
hid_t dxpl_id,
hbool_t dest,
haddr_t addr,
void *thing,
unsigned * flags_ptr);
typedef herr_t (*H5C_dest_func_t)(H5F_t *f,
void *thing);
typedef herr_t (*H5C_clear_func_t)(H5F_t *f,
void *thing,
hbool_t dest);
typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action,
void *thing);
typedef herr_t (*H5C_size_func_t)(const H5F_t *f,
const void *thing,
size_t *size_ptr);
/* Cache client callback function pointers */
typedef void *(*H5C_load_func_t)(H5F_t *f, hid_t dxpl_id, haddr_t addr,
void *udata);
typedef herr_t (*H5C_flush_func_t)(H5F_t *f, hid_t dxpl_id, hbool_t dest,
haddr_t addr, void *thing, unsigned *flags_ptr);
typedef herr_t (*H5C_dest_func_t)(H5F_t *f, void *thing);
typedef herr_t (*H5C_clear_func_t)(H5F_t *f, void *thing, hbool_t dest);
typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, void *thing);
typedef herr_t (*H5C_size_func_t)(const H5F_t *f, const void *thing,
size_t *size_ptr);
/* Metadata cache client class definition */
typedef struct H5C_class_t {
int id;
H5C_load_func_t load;
@ -166,49 +282,11 @@ typedef struct H5C_class_t {
H5C_size_func_t size;
} H5C_class_t;
/* Type defintions of call back functions used by the cache as a whole */
/* Type defintions of callback functions used by the cache as a whole */
typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f,
hid_t dxpl_id,
hbool_t * write_permitted_ptr);
typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
haddr_t addr,
hbool_t was_dirty,
unsigned flags,
int type_id);
/* Upper and lower limits on cache size. These limits are picked
* out of a hat -- you should be able to change them as necessary.
*
* However, if you need a very big cache, you should also increase the
* size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current
* upper bound on cache size is rather large for the current hash table
* size.
*/
#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
/* Default max cache size and min clean size are give here to make
* them generally accessable.
*/
#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
/* Maximum height of flush dependency relationships between entries. This is
* currently tuned to the extensible array (H5EA) data structure, which only
* requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible
* array needs 4 levels, plus another 2 levels are needed: one for the layer
* under the extensible array and one for the layer above it).
*/
#define H5C__NUM_FLUSH_DEP_HEIGHTS 6
hbool_t *write_permitted_ptr);
typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr,
hbool_t was_dirty, unsigned flags);
/****************************************************************************
*
@ -292,16 +370,15 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* dirtied while protected.
*
* This field is set to FALSE in the protect call, and may
* be set to TRUE by the
* H5C_mark_entry_dirty()
* call at an time prior to the unprotect call.
* be set to TRUE by the H5C_mark_entry_dirty() call at any
* time prior to the unprotect call.
*
* The H5C_mark_entry_dirty() call exists
* as a convenience function for the fractal heap code which
* may not know if an entry is protected or pinned, but knows
* that is either protected or pinned. The dirtied field was
* added as in the parallel case, it is necessary to know
* whether a protected entry was dirty prior to the protect call.
* The H5C_mark_entry_dirty() call exists as a convenience
* function for the fractal heap code which may not know if
* an entry is protected or pinned, but knows that is either
* protected or pinned. The dirtied field was added as in
* the parallel case, it is necessary to know whether a
* protected entry is dirty prior to the protect call.
*
* is_protected: Boolean flag indicating whether this entry is protected
* (or locked, to use more conventional terms). When it is
@ -372,21 +449,22 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* the entry is flushed for whatever reason.
*
* flush_me_last: Boolean flag indicating that this entry should not be
* flushed from the cache until all other entries without
* the flush_me_last flag set have been flushed.
* flushed from the cache until all other entries without
* the flush_me_last flag set have been flushed.
*
* flush_me_collectively: Boolean flag indicating that this entry needs
* to be flushed collectively when in a parallel
* situation.
* to be flushed collectively when in a parallel situation.
*
* Note: At this time, the flush_me_last and flush_me_collectively
* flags will only be applied to one entry, the superblock,
* and the code utilizing these flags is protected with HDasserts
* to enforce this. This restraint can certainly be relaxed in
* the future if the the need for multiple entries getting flushed
* last or collectively arises, though the code allowing for that
* will need to be expanded and tested appropriately if that
* functionality is desired.
* Note:
*
* At this time, the flush_me_last and flush_me_collectively
* flags will only be applied to one entry, the superblock,
* and the code utilizing these flags is protected with HDasserts
* to enforce this. This restraint can certainly be relaxed in
* the future if the the need for multiple entries getting flushed
* last or collectively arises, though the code allowing for that
* will need to be expanded and tested appropriately if that
* functionality is desired.
*
* clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used
* to implement the metadata cache In the parallel case, only
@ -580,21 +658,14 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* been pinned in cache in its life time.
*
****************************************************************************/
#ifndef NDEBUG
#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
#endif /* NDEBUG */
typedef struct H5C_cache_entry_t
{
typedef struct H5C_cache_entry_t {
#ifndef NDEBUG
uint32_t magic;
#endif /* NDEBUG */
H5C_t * cache_ptr;
H5C_t * cache_ptr;
haddr_t addr;
size_t size;
const H5C_class_t * type;
const H5C_class_t * type;
haddr_t tag;
hbool_t is_dirty;
hbool_t dirtied;
@ -608,46 +679,38 @@ typedef struct H5C_cache_entry_t
#ifdef H5_HAVE_PARALLEL
hbool_t flush_me_collectively;
hbool_t clear_on_unprotect;
hbool_t flush_immediately;
hbool_t flush_immediately;
#endif /* H5_HAVE_PARALLEL */
hbool_t flush_in_progress;
hbool_t destroy_in_progress;
hbool_t free_file_space_on_destroy;
/* fields supporting the 'flush dependency' feature: */
struct H5C_cache_entry_t * flush_dep_parent;
uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
unsigned flush_dep_height;
hbool_t pinned_from_client;
hbool_t pinned_from_cache;
struct H5C_cache_entry_t * flush_dep_parent;
uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
unsigned flush_dep_height;
hbool_t pinned_from_client;
hbool_t pinned_from_cache;
/* fields supporting the hash table: */
struct H5C_cache_entry_t * ht_next;
struct H5C_cache_entry_t * ht_prev;
struct H5C_cache_entry_t * ht_next;
struct H5C_cache_entry_t * ht_prev;
/* fields supporting replacement policies: */
struct H5C_cache_entry_t * next;
struct H5C_cache_entry_t * prev;
struct H5C_cache_entry_t * aux_next;
struct H5C_cache_entry_t * aux_prev;
struct H5C_cache_entry_t * next;
struct H5C_cache_entry_t * prev;
struct H5C_cache_entry_t * aux_next;
struct H5C_cache_entry_t * aux_prev;
#if H5C_COLLECT_CACHE_ENTRY_STATS
/* cache entry stats fields */
int32_t accesses;
int32_t clears;
int32_t flushes;
int32_t pins;
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
} H5C_cache_entry_t;
/****************************************************************************
*
* structure H5C_auto_size_ctl_t
@ -888,41 +951,6 @@ typedef struct H5C_cache_entry_t
*
****************************************************************************/
#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1
#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2
#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4
#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8
#define H5C_RESIZE_CFG__VALIDATE_ALL \
( \
H5C_RESIZE_CFG__VALIDATE_GENERAL | \
H5C_RESIZE_CFG__VALIDATE_INCREMENT | \
H5C_RESIZE_CFG__VALIDATE_DECREMENT | \
H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
)
#define H5C__CURR_AUTO_SIZE_CTL_VER 1
#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
#define H5C__MAX_EPOCH_MARKERS 10
#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
#define H5C__DEF_AR_INCREMENT 2.0f
#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
#define H5C__DEF_AR_DECREMENT 0.9f
#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_EPCHS_B4_EVICT 3
#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
#define H5C__MIN_AR_EPOCH_LENGTH 100
#define H5C__DEF_AR_EPOCH_LENGTH 50000
#define H5C__MAX_AR_EPOCH_LENGTH 1000000
enum H5C_resize_status
{
in_spec,
@ -936,303 +964,118 @@ enum H5C_resize_status
not_full
}; /* enum H5C_resize_conditions */
typedef void (*H5C_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);
typedef void (*H5C_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);
typedef struct H5C_auto_size_ctl_t
{
typedef struct H5C_auto_size_ctl_t {
/* general configuration fields: */
int32_t version;
H5C_auto_resize_rpt_fcn rpt_fcn;
hbool_t set_initial_size;
size_t initial_size;
double min_clean_fraction;
size_t max_size;
size_t min_size;
int64_t epoch_length;
/* size increase control fields: */
enum H5C_cache_incr_mode incr_mode;
double lower_hr_threshold;
double increment;
hbool_t apply_max_increment;
size_t max_increment;
enum H5C_cache_flash_incr_mode flash_incr_mode;
double flash_multiple;
double flash_threshold;
/* size decrease control fields: */
enum H5C_cache_decr_mode decr_mode;
double upper_hr_threshold;
double decrement;
hbool_t apply_max_decrement;
size_t max_decrement;
int32_t epochs_before_eviction;
hbool_t apply_empty_reserve;
double empty_reserve;
} H5C_auto_size_ctl_t;
/***************************************/
/* Library-private Function Prototypes */
/***************************************/
/*
* Library prototypes.
*/
/* #defines of flags used in the flags parameters in some of the
* following function calls. Note that not all flags are applicable
* to all function calls. Flags that don't apply to a particular
* function are ignored in that function.
*
* These flags apply to all function calls:
*
* H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
*
*
* These flags apply to H5C_insert_entry():
*
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__PIN_ENTRY_FLAG
*
* These flags apply to H5C_protect()
*
* H5C__READ_ONLY_FLAG
*
* These flags apply to H5C_unprotect():
*
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__DELETED_FLAG
* H5C__DIRTIED_FLAG
* H5C__PIN_ENTRY_FLAG
* H5C__UNPIN_ENTRY_FLAG
* H5C__FREE_FILE_SPACE_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*
* These flags apply to H5C_expunge_entry():
*
* H5C__FREE_FILE_SPACE_FLAG
*
* These flags apply to H5C_flush_cache():
*
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination
* with H5C__FLUSH_INVALIDATE_FLAG)
*
* These flags apply to H5C_flush_single_entry():
*
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*/
#define H5C__NO_FLAGS_SET 0x0000
#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
#define H5C__DELETED_FLAG 0x0002
#define H5C__DIRTIED_FLAG 0x0004
#define H5C__PIN_ENTRY_FLAG 0x0008
#define H5C__UNPIN_ENTRY_FLAG 0x0010
#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
#define H5C__READ_ONLY_FLAG 0x0200
#define H5C__FREE_FILE_SPACE_FLAG 0x0800
#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
#define H5C__FLUSH_LAST_FLAG 0x2000
#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000
H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size,
int max_type_id, const char *(*type_name_table_ptr),
H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted,
H5C_log_flush_func_t log_flush, void *aux_ptr);
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 primary_dxpl_id, hid_t secondary_dxpl_id);
H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
const H5C_class_t *type, haddr_t addr, unsigned flags);
H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
unsigned flags);
H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id);
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_size(H5C_t *cache_ptr, size_t *max_size_ptr,
size_t *min_clean_size_ptr, size_t *cur_size_ptr,
int32_t *cur_num_entries_ptr);
H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr);
H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr,
size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr,
hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr,
hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr);
H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_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_insert_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags);
H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t primary_dxpl_id,
hid_t secondary_dxpl_id, int32_t ce_array_len, haddr_t *ce_array_ptr);
H5_DLL herr_t H5C_mark_entry_dirty(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_create_flush_dependency(void *parent_thing, void *child_thing);
H5_DLL void * H5C_protect(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
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);
H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled);
H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix);
H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t *cache_ptr, FILE *trace_file_ptr);
H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name,
hbool_t display_detailed_stats);
H5_DLL void H5C_stats__reset(H5C_t *cache_ptr);
H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name);
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 primary_dxpl_id, hid_t secondary_dxpl_id,
const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags);
H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr,
unsigned int tests);
H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr);
H5_DLL void H5C_retag_copied_metadata(H5C_t *cache_ptr, haddr_t metadata_tag);
#ifdef H5_HAVE_PARALLEL
H5_DLL herr_t H5C_apply_candidate_list(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
H5C_t * cache_ptr,
int 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_apply_candidate_list(H5F_t *f, hid_t primary_dxpl_id,
hid_t secondary_dxpl_id, H5C_t *cache_ptr, int 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);
#endif /* H5_HAVE_PARALLEL */
H5_DLL H5C_t * H5C_create(size_t max_cache_size,
size_t min_clean_size,
int max_type_id,
const char * (* type_name_table_ptr),
H5C_write_permitted_func_t check_write_permitted,
hbool_t write_permitted,
H5C_log_flush_func_t log_flush,
void * aux_ptr);
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 primary_dxpl_id,
hid_t secondary_dxpl_id);
H5_DLL herr_t H5C_expunge_entry(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
unsigned flags);
H5_DLL herr_t H5C_flush_cache(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
unsigned flags);
H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id);
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_size(H5C_t * cache_ptr,
size_t * max_size_ptr,
size_t * min_clean_size_ptr,
size_t * cur_size_ptr,
int32_t * cur_num_entries_ptr);
H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t * cache_ptr,
double * hit_rate_ptr);
H5_DLL herr_t H5C_get_entry_status(const H5F_t *f,
haddr_t addr,
size_t * size_ptr,
hbool_t * in_cache_ptr,
hbool_t * is_dirty_ptr,
hbool_t * is_protected_ptr,
hbool_t * is_pinned_ptr,
hbool_t * is_flush_dep_parent_ptr,
hbool_t * is_flush_dep_child_ptr);
H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr,
hbool_t * evictions_enabled_ptr);
H5_DLL herr_t H5C_get_trace_file_ptr(const H5C_t *cache_ptr,
FILE **trace_file_ptr_ptr);
H5_DLL herr_t H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr,
FILE **trace_file_ptr_ptr);
H5_DLL herr_t H5C_insert_entry(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
void * thing,
unsigned int flags);
H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
int32_t ce_array_len,
haddr_t *ce_array_ptr);
H5_DLL herr_t H5C_mark_entry_dirty(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_create_flush_dependency(void *parent_thing, void *child_thing);
H5_DLL void * H5C_protect(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
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);
H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr,
hbool_t evictions_enabled);
H5_DLL herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix);
H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t * cache_ptr,
FILE * trace_file_ptr);
H5_DLL herr_t H5C_stats(H5C_t * cache_ptr,
const char * cache_name,
hbool_t display_detailed_stats);
H5_DLL void H5C_stats__reset(H5C_t * cache_ptr);
H5_DLL herr_t H5C_dump_cache(H5C_t * cache_ptr,
const char * cache_name);
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 primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
void * thing,
unsigned int flags);
H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr,
unsigned int tests);
H5_DLL herr_t H5C_ignore_tags(H5C_t * cache_ptr);
H5_DLL void H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag);
#ifndef NDEBUG /* debugging functions */
H5_DLL herr_t H5C_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr,
void ** entry_ptr_ptr);
H5_DLL herr_t H5C_verify_entry_type(const H5F_t * f, haddr_t addr,
const H5C_class_t * expected_type,
hbool_t * in_cache_ptr,
hbool_t * type_ok_ptr);
void **entry_ptr_ptr);
H5_DLL herr_t H5C_verify_entry_type(const H5F_t *f, haddr_t addr,
const H5C_class_t *expected_type, hbool_t *in_cache_ptr,
hbool_t *type_ok_ptr);
#endif /* NDEBUG */
#endif /* !_H5Cprivate_H */

View File

@ -49,11 +49,6 @@
/* Local Macros */
/****************/
/*
* Given a B-tree node return the dimensionality of the chunks pointed to by
* that node.
*/
#define H5D_BTREE_NDIMS(X) (((X)->sizeof_rkey-8)/8)
/******************/
/* Local Typedefs */
@ -74,7 +69,7 @@
* The chunk's file address is part of the B-tree and not part of the key.
*/
typedef struct H5D_btree_key_t {
hsize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/
hsize_t scaled[H5O_LAYOUT_NDIMS]; /*logical offset to start*/
uint32_t nbytes; /*size of stored data */
unsigned filter_mask; /*excluded filters */
} H5D_btree_key_t;
@ -97,8 +92,9 @@ typedef struct H5D_btree_dbg_t {
/* Local Prototypes */
/********************/
static herr_t H5D__btree_shared_free(void *_shared);
static herr_t H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store,
unsigned ndims);
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,
@ -203,6 +199,10 @@ H5B_class_t H5B_BTREE[1] = {{
/* Local Variables */
/*******************/
/* Declare a free list to manage H5O_layout_chunk_t objects */
H5FL_DEFINE_STATIC(H5O_layout_chunk_t);
/*-------------------------------------------------------------------------
* Function: H5D__btree_get_shared
@ -220,7 +220,7 @@ H5B_class_t H5B_BTREE[1] = {{
*/
/* ARGSUSED */
static H5UC_t *
H5D__btree_get_shared(const H5F_t UNUSED *f, const void *_udata)
H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata)
{
const H5D_chunk_common_ud_t *udata = (const H5D_chunk_common_ud_t *) _udata;
@ -255,7 +255,7 @@ H5D__btree_get_shared(const H5F_t UNUSED *f, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
H5D__btree_new_node(H5F_t *f, hid_t UNUSED dxpl_id, H5B_ins_t op,
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*/)
{
@ -284,10 +284,10 @@ H5D__btree_new_node(H5F_t *f, hid_t UNUSED dxpl_id, H5B_ins_t op,
* The left key describes the storage of the UDATA chunk being
* inserted into the tree.
*/
H5_ASSIGN_OVERFLOW(lt_key->nbytes, udata->chunk_block.length, hsize_t, uint32_t);
H5_CHECKED_ASSIGN(lt_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t);
lt_key->filter_mask = udata->filter_mask;
for(u = 0; u < udata->common.layout->ndims; u++)
lt_key->offset[u] = udata->common.offset[u];
lt_key->scaled[u] = udata->common.scaled[u];
/*
* The right key might already be present. If not, then add a zero-width
@ -297,9 +297,8 @@ H5D__btree_new_node(H5F_t *f, hid_t UNUSED dxpl_id, H5B_ins_t op,
rt_key->nbytes = 0;
rt_key->filter_mask = 0;
for(u = 0; u < udata->common.layout->ndims; u++) {
HDassert(udata->common.offset[u] + udata->common.layout->dim[u] >
udata->common.offset[u]);
rt_key->offset[u] = udata->common.offset[u] + udata->common.layout->dim[u];
HDassert(udata->common.scaled[u] + 1 > udata->common.scaled[u]);
rt_key->scaled[u] = udata->common.scaled[u] + 1;
} /* end if */
} /* end if */
@ -342,7 +341,7 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key)
HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS);
/* Compare the offsets but ignore the other fields */
ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->offset, rt_key->offset);
ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_cmp2() */
@ -397,18 +396,18 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key)
/* indexed storage B-tree... */
/* (Dump the B-tree with h5debug to look at it) -QAK */
if(udata->layout->ndims == 2) {
if(udata->offset[0] > rt_key->offset[0])
if(udata->scaled[0] > rt_key->scaled[0])
ret_value = 1;
else if(udata->offset[0] == rt_key->offset[0] &&
udata->offset[1] >= rt_key->offset[1])
else if(udata->scaled[0] == rt_key->scaled[0] &&
udata->scaled[1] >= rt_key->scaled[1])
ret_value = 1;
else if(udata->offset[0] < lt_key->offset[0])
else if(udata->scaled[0] < lt_key->scaled[0])
ret_value = (-1);
} /* end if */
else {
if(H5VM_vector_ge_u(udata->layout->ndims, udata->offset, rt_key->offset))
if(H5VM_vector_ge_u(udata->layout->ndims, udata->scaled, rt_key->scaled))
ret_value = 1;
else if(H5VM_vector_lt_u(udata->layout->ndims, udata->offset, lt_key->offset))
else if(H5VM_vector_lt_u(udata->layout->ndims, udata->scaled, lt_key->scaled))
ret_value = (-1);
} /* end else */
@ -442,7 +441,7 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key)
*/
/* ARGSUSED */
static htri_t
H5D__btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void *_lt_key,
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_chunk_ud_t *udata = (H5D_chunk_ud_t *) _udata;
@ -460,7 +459,7 @@ H5D__btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void
/* Is this *really* the requested chunk? */
for(u = 0; u < udata->common.layout->ndims; u++)
if(udata->common.offset[u] >= lt_key->offset[u] + udata->common.layout->dim[u])
if(udata->common.scaled[u] >= (lt_key->scaled[u] + 1))
HGOTO_DONE(FALSE)
/* Initialize return values */
@ -473,6 +472,44 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_found() */
/*-------------------------------------------------------------------------
* Function: H5D__chunk_disjoint
*
* Purpose: Determines if two chunks are disjoint.
*
* Return: Success: FALSE if they are not disjoint.
* TRUE if they are disjoint.
*
* Programmer: Quincey Koziol
* Wednesday, May 6, 2015
*
* Note: Assumes that the chunk offsets are scaled coordinates
*
*-------------------------------------------------------------------------
*/
static hbool_t
H5D__chunk_disjoint(unsigned n, const hsize_t *scaled1, const hsize_t *scaled2)
{
unsigned u; /* Local index variable */
hbool_t ret_value = FALSE; /* Return value */
FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(n);
HDassert(scaled1);
HDassert(scaled2);
/* Loop over two chunks, detecting disjointness and getting out quickly */
for(u = 0; u < n; u++)
if((scaled1[u] + 1) <= scaled2[u] || (scaled2[u] + 1) <= scaled1[u])
HGOTO_DONE(TRUE)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_disjoint() */
/*-------------------------------------------------------------------------
* Function: H5D__btree_insert
@ -504,10 +541,10 @@ done:
*/
/* ARGSUSED */
static H5B_ins_t
H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key,
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 UNUSED *rt_key_changed,
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;
@ -538,8 +575,7 @@ H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key,
HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error")
} else if(H5VM_vector_eq_u(udata->common.layout->ndims,
udata->common.offset, lt_key->offset) &&
lt_key->nbytes > 0) {
udata->common.scaled, lt_key->scaled) && lt_key->nbytes > 0) {
/*
* Already exists. If the new size is not the same as the old size
* then we should reallocate storage.
@ -548,7 +584,7 @@ H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key,
/* Set node's address (already re-allocated by main chunk routines) */
HDassert(H5F_addr_defined(udata->chunk_block.offset));
*new_node_p = udata->chunk_block.offset;
H5_ASSIGN_OVERFLOW(lt_key->nbytes, udata->chunk_block.length, hsize_t, uint32_t);
H5_CHECKED_ASSIGN(lt_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t);
lt_key->filter_mask = udata->filter_mask;
*lt_key_changed = TRUE;
ret_value = H5B_INS_CHANGE;
@ -558,22 +594,18 @@ H5D__btree_insert(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t addr, void *_lt_key,
ret_value = H5B_INS_NOOP;
}
} else if (H5VM_hyper_disjointp(udata->common.layout->ndims,
lt_key->offset, udata->common.layout->dim,
udata->common.offset, udata->common.layout->dim)) {
HDassert(H5VM_hyper_disjointp(udata->common.layout->ndims,
rt_key->offset, udata->common.layout->dim,
udata->common.offset, udata->common.layout->dim));
} else if (H5D__chunk_disjoint(udata->common.layout->ndims,
lt_key->scaled, udata->common.scaled)) {
HDassert(H5D__chunk_disjoint(udata->common.layout->ndims,
rt_key->scaled, udata->common.scaled));
/*
* Split this node, inserting the new new node to the right of the
* current node. The MD_KEY is where the split occurs.
*/
H5_ASSIGN_OVERFLOW(md_key->nbytes, udata->chunk_block.length, hsize_t, uint32_t);
H5_CHECKED_ASSIGN(md_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t);
md_key->filter_mask = udata->filter_mask;
for(u = 0; u < udata->common.layout->ndims; u++) {
HDassert(0 == udata->common.offset[u] % udata->common.layout->dim[u]);
md_key->offset[u] = udata->common.offset[u];
} /* end for */
for(u = 0; u < udata->common.layout->ndims; u++)
md_key->scaled[u] = udata->common.scaled[u];
HDassert(H5F_addr_defined(udata->chunk_block.offset));
*new_node_p = udata->chunk_block.offset;
@ -605,8 +637,8 @@ done:
static H5B_ins_t
H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ ,
hbool_t *lt_key_changed /*out */ ,
void UNUSED * _udata /*in,out */ ,
void UNUSED * _rt_key /*in,out */ ,
void H5_ATTR_UNUSED * _udata /*in,out */ ,
void H5_ATTR_UNUSED * _rt_key /*in,out */ ,
hbool_t *rt_key_changed /*out */ )
{
H5D_btree_key_t *lt_key = (H5D_btree_key_t *)_lt_key;
@ -643,9 +675,10 @@ done:
static herr_t
H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key)
{
H5D_btree_key_t *key = (H5D_btree_key_t *) _key;
size_t ndims;
unsigned u;
const H5O_layout_chunk_t *layout; /* Chunk layout description */
H5D_btree_key_t *key = (H5D_btree_key_t *) _key; /* Pointer to decoded key */
hsize_t tmp_offset; /* Temporary coordinate offset, from file */
unsigned u; /* Local index variable */
FUNC_ENTER_STATIC_NOERR
@ -653,14 +686,21 @@ H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key
HDassert(shared);
HDassert(raw);
HDassert(key);
ndims = H5D_BTREE_NDIMS(shared);
HDassert(ndims <= H5O_LAYOUT_NDIMS);
layout = (const H5O_layout_chunk_t *)shared->udata;
HDassert(layout);
HDassert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS);
/* decode */
UINT32DECODE(raw, key->nbytes);
UINT32DECODE(raw, key->filter_mask);
for(u = 0; u < ndims; u++)
UINT64DECODE(raw, key->offset[u]);
for(u = 0; u < layout->ndims; u++) {
/* Retrieve coordinate offset */
UINT64DECODE(raw, tmp_offset);
HDassert(0 == (tmp_offset % layout->dim[u]));
/* Convert to a scaled offset */
key->scaled[u] = tmp_offset / layout->dim[u];
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__btree_decode_key() */
@ -681,9 +721,10 @@ 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, const void *_key)
{
const H5O_layout_chunk_t *layout; /* Chunk layout description */
const H5D_btree_key_t *key = (const H5D_btree_key_t *)_key;
size_t ndims;
unsigned u;
hsize_t tmp_offset; /* Temporary coordinate offset, from file */
unsigned u; /* Local index variable */
FUNC_ENTER_STATIC_NOERR
@ -691,14 +732,18 @@ H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key
HDassert(shared);
HDassert(raw);
HDassert(key);
ndims = H5D_BTREE_NDIMS(shared);
HDassert(ndims <= H5O_LAYOUT_NDIMS);
layout = (const H5O_layout_chunk_t *)shared->udata;
HDassert(layout);
HDassert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS);
/* encode */
UINT32ENCODE(raw, key->nbytes);
UINT32ENCODE(raw, key->filter_mask);
for(u = 0; u < ndims; u++)
UINT64ENCODE(raw, key->offset[u]);
for(u = 0; u < layout->ndims; u++) {
/* Compute coordinate offset from scaled offset */
tmp_offset = key->scaled[u] * layout->dim[u];
UINT64ENCODE(raw, tmp_offset);
} /* end for */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__btree_encode_key() */
@ -733,12 +778,44 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key,
HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "Filter mask:", key->filter_mask);
HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Logical offset:");
for(u = 0; u < udata->ndims; u++)
HDfprintf(stream, "%s%Hd", u?", ":"", key->offset[u]);
HDfprintf(stream, "%s%Hd", u?", ":"", (key->scaled[u] * udata->common.layout->dim[u]));
HDfputs("}\n", stream);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D__btree_debug_key() */
/*-------------------------------------------------------------------------
* Function: H5D__btree_shared_free
*
* Purpose: Free "local" B-tree shared info
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Thursday, May 7, 2015
*
*-------------------------------------------------------------------------
*/
static herr_t
H5D__btree_shared_free(void *_shared)
{
H5B_shared_t *shared = (H5B_shared_t *)_shared;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Free the chunk layout information */
shared->udata = H5FL_FREE(H5O_layout_chunk_t, shared->udata);
/* Chain up to the generic B-tree shared info free routine */
if(H5B_shared_free(shared) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't free shared B-tree info")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_shared_free() */
/*-------------------------------------------------------------------------
* Function: H5D__btree_shared_create
@ -753,9 +830,11 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key,
*-------------------------------------------------------------------------
*/
static herr_t
H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned ndims)
H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store,
const H5O_layout_chunk_t *layout)
{
H5B_shared_t *shared; /* Shared B-tree node info */
H5O_layout_chunk_t *my_layout = NULL; /* Pointer to copy of layout info */
size_t sizeof_rkey; /* Size of raw (disk) key */
herr_t ret_value = SUCCEED; /* Return value */
@ -764,20 +843,27 @@ H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned nd
/* Set the raw key size */
sizeof_rkey = 4 + /*storage size */
4 + /*filter mask */
ndims * 8; /*dimension indices */
layout->ndims * 8; /*dimension indices */
/* Allocate & initialize global info for the shared structure */
if(NULL == (shared = H5B_shared_new(f, H5B_BTREE, sizeof_rkey)))
HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info")
HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "memory allocation failed for shared B-tree info")
/* Set up the "local" information for this dataset's chunks */
/* <none> */
if(NULL == (my_layout = H5FL_MALLOC(H5O_layout_chunk_t)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate chunk layout")
HDmemcpy(my_layout, layout, sizeof(H5O_layout_chunk_t));
shared->udata = my_layout;
/* Make shared B-tree info reference counted */
if(NULL == (store->u.btree.shared = H5UC_create(shared, H5B_shared_free)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info")
if(NULL == (store->u.btree.shared = H5UC_create(shared, H5D__btree_shared_free)))
HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info")
done:
if(ret_value < 0)
if(my_layout)
my_layout = H5FL_FREE(H5O_layout_chunk_t, my_layout);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_shared_create() */
@ -795,7 +881,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *space,
H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNUSED *space,
haddr_t dset_ohdr_addr)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -813,7 +899,7 @@ H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *spac
idx_info->storage->u.btree.dset_ohdr_addr = dset_ohdr_addr;
/* Allocate the shared structure */
if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0)
if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
done:
@ -992,8 +1078,8 @@ done:
*/
/* ARGSUSED */
static int
H5D__btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
const void *_lt_key, haddr_t addr, const void UNUSED *_rt_key,
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_it_ud_t *udata = (H5D_btree_it_ud_t *)_udata; /* User data */
@ -1006,8 +1092,8 @@ H5D__btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
/* Sanity check for memcpy() */
HDcompile_assert(offsetof(H5D_chunk_rec_t, nbytes) == offsetof(H5D_btree_key_t, nbytes));
HDcompile_assert(sizeof(chunk_rec.nbytes) == sizeof(lt_key->nbytes));
HDcompile_assert(offsetof(H5D_chunk_rec_t, offset) == offsetof(H5D_btree_key_t, offset));
HDcompile_assert(sizeof(chunk_rec.offset) == sizeof(lt_key->offset));
HDcompile_assert(offsetof(H5D_chunk_rec_t, scaled) == offsetof(H5D_btree_key_t, scaled));
HDcompile_assert(sizeof(chunk_rec.scaled) == sizeof(lt_key->scaled));
HDcompile_assert(offsetof(H5D_chunk_rec_t, filter_mask) == offsetof(H5D_btree_key_t, filter_mask));
HDcompile_assert(sizeof(chunk_rec.filter_mask) == sizeof(lt_key->filter_mask));
@ -1144,7 +1230,7 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info)
tmp_storage = *idx_info->storage;
/* Set up the shared structure */
if(H5D__btree_shared_create(idx_info->f, &tmp_storage, idx_info->layout->ndims) < 0)
if(H5D__btree_shared_create(idx_info->f, &tmp_storage, idx_info->layout) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
/* Set up B-tree user data */
@ -1201,9 +1287,9 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
HDassert(!H5F_addr_defined(idx_info_dst->storage->idx_addr));
/* Create shared B-tree info for each file */
if(H5D__btree_shared_create(idx_info_src->f, idx_info_src->storage, idx_info_src->layout->ndims) < 0)
if(H5D__btree_shared_create(idx_info_src->f, idx_info_src->storage, idx_info_src->layout) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for source shared B-tree info")
if(H5D__btree_shared_create(idx_info_dst->f, idx_info_dst->storage, idx_info_dst->layout->ndims) < 0)
if(H5D__btree_shared_create(idx_info_dst->f, idx_info_dst->storage, idx_info_dst->layout) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for destination shared B-tree info")
/* Create the root of the B-tree that describes chunked storage in the dest. file */
@ -1231,7 +1317,7 @@ done:
static herr_t
H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src,
H5O_storage_chunk_t *storage_dst,
hid_t UNUSED dxpl_id)
hid_t H5_ATTR_UNUSED dxpl_id)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -1283,7 +1369,7 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size)
HDassert(index_size);
/* Initialize the shared info for the B-tree traversal */
if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0)
if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
shared_init = TRUE;
@ -1415,11 +1501,13 @@ done:
*/
herr_t
H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
int fwidth, unsigned ndims)
int fwidth, unsigned ndims, const uint32_t *dim)
{
H5D_btree_dbg_t udata; /* User data for B-tree callback */
H5O_storage_chunk_t storage; /* Storage information for B-tree callback */
H5O_layout_chunk_t layout; /* Layout information for B-tree callback */
hbool_t shared_init = FALSE; /* Whether B-tree shared info is initialized */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@ -1428,15 +1516,21 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent
HDmemset(&storage, 0, sizeof(storage));
storage.idx_type = H5D_CHUNK_IDX_BTREE;
/* Reset "fake" layout info */
HDmemset(&layout, 0, sizeof(layout));
layout.ndims = ndims;
for(u = 0; u < ndims; u++)
layout.dim[u] = dim[u];
/* Allocate the shared structure */
if(H5D__btree_shared_create(f, &storage, ndims) < 0)
if(H5D__btree_shared_create(f, &storage, &layout) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
shared_init = TRUE;
/* Set up user data for callback */
udata.common.layout = NULL;
udata.common.layout = &layout;
udata.common.storage = &storage;
udata.common.offset = NULL;
udata.common.scaled = NULL;
udata.ndims = ndims;
/* Dump the records for the B-tree */
@ -1446,10 +1540,10 @@ done:
if(shared_init) {
/* Free the raw B-tree node buffer */
if(NULL == storage.u.btree.shared)
HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted page nil")
HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "ref-counted shared info nil")
else
if(H5UC_DEC(storage.u.btree.shared) < 0)
HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
HDONE_ERROR(H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted shared info")
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)

File diff suppressed because it is too large Load Diff

View File

@ -197,7 +197,7 @@ H5D__compact_construct(H5F_t *f, H5D_t *dset)
tmp_size = H5T_get_size(dset->shared->type);
HDassert(tmp_size > 0);
tmp_size = tmp_size * (hsize_t)stmp_size;
H5_ASSIGN_OVERFLOW(dset->shared->layout.storage.u.compact.size, tmp_size, hssize_t, size_t);
H5_CHECKED_ASSIGN(dset->shared->layout.storage.u.compact.size, size_t, tmp_size, hssize_t);
/* Verify data size is smaller than maximum header message size
* (64KB) minus other layout message fields.
@ -224,7 +224,7 @@ done:
*-------------------------------------------------------------------------
*/
static hbool_t
H5D__compact_is_space_alloc(const H5O_storage_t UNUSED *storage)
H5D__compact_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage)
{
FUNC_ENTER_STATIC_NOERR
@ -249,9 +249,9 @@ H5D__compact_is_space_alloc(const H5O_storage_t UNUSED *storage)
*-------------------------------------------------------------------------
*/
static herr_t
H5D__compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info,
hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space,
H5D_chunk_map_t UNUSED *cm)
H5D__compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info,
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space,
H5D_chunk_map_t H5_ATTR_UNUSED *cm)
{
FUNC_ENTER_STATIC_NOERR

View File

@ -259,7 +259,7 @@ H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id)
/* Get the number of elements in the dataset's dataspace */
if((snpoints = H5S_GET_EXTENT_NPOINTS(dset->shared->space)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "dataset has negative number of elements")
H5_ASSIGN_OVERFLOW(npoints, snpoints, hssize_t, size_t);
H5_CHECKED_ASSIGN(npoints, size_t, snpoints, hssize_t);
/* Initialize the fill value buffer */
if(H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL,
@ -492,9 +492,9 @@ H5D__contig_is_space_alloc(const H5O_storage_t *storage)
*-------------------------------------------------------------------------
*/
static herr_t
H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info,
hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space,
H5D_chunk_map_t UNUSED *cm)
H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info,
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space,
H5D_chunk_map_t H5_ATTR_UNUSED *cm)
{
FUNC_ENTER_STATIC_NOERR
@ -520,7 +520,7 @@ H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *
herr_t
H5D__contig_read(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 UNUSED *fm)
H5D_chunk_map_t H5_ATTR_UNUSED *fm)
{
herr_t ret_value = SUCCEED; /*return value */
@ -557,7 +557,7 @@ done:
herr_t
H5D__contig_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 UNUSED *fm)
H5D_chunk_map_t H5_ATTR_UNUSED *fm)
{
herr_t ret_value = SUCCEED; /*return value */
@ -644,6 +644,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
size_t sieve_size = (size_t)-1; /* Size of sieve buffer */
haddr_t rel_eoa; /* Relative end of file address */
hsize_t max_data; /* Actual maximum size of data to cache */
hsize_t min; /* temporary minimum value (avoids some ugly macro nesting) */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@ -684,7 +685,8 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
max_data = store_contig->dset_size - dst_off;
/* Compute the size of the sieve buffer */
H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t);
min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size);
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)
@ -757,9 +759,13 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
/* Only need this when resizing sieve buffer */
max_data = store_contig->dset_size - dst_off;
/* Compute the size of the sieve buffer */
/* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */
H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t);
/* Compute the size of the sieve buffer.
* Don't read off the end of the file, don't read past
* the end of the data element, and don't read more than
* the buffer size.
*/
min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size);
H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t);
/* Update local copies of sieve information */
sieve_start = dset_contig->sieve_loc;
@ -915,6 +921,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
size_t sieve_size = (size_t)-1; /* size of sieve buffer */
haddr_t rel_eoa; /* Relative end of file address */
hsize_t max_data; /* Actual maximum size of data to cache */
hsize_t min; /* temporary minimum value (avoids some ugly macro nesting) */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@ -960,7 +967,8 @@ if(dset_contig->sieve_size > len)
max_data = store_contig->dset_size - dst_off;
/* Compute the size of the sieve buffer */
H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t);
min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size);
H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t);
/* Check if there is any point in reading the data from the file */
if(dset_contig->sieve_size > len) {
@ -1075,9 +1083,13 @@ if(dset_contig->sieve_size > len)
/* Only need this when resizing sieve buffer */
max_data = store_contig->dset_size - dst_off;
/* Compute the size of the sieve buffer */
/* Don't read off the end of the file, don't read past the end of the data element and don't read more than the buffer size */
H5_ASSIGN_OVERFLOW(dset_contig->sieve_size, MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size), hsize_t, size_t);
/* Compute the size of the sieve buffer.
* Don't read off the end of the file, don't read past
* the end of the data element, and don't read more than
* the buffer size.
*/
min = MIN3(rel_eoa - dset_contig->sieve_loc, max_data, dset_contig->sieve_buf_size);
H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t);
/* Update local copies of sieve information */
sieve_start = dset_contig->sieve_loc;

View File

@ -382,12 +382,56 @@ H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id)
/* 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;
/* Check if the number of bits required to encode the scaled size value changed */
if(dataset->shared->cache.chunk.scaled_power2up[u] != (scaled_power2up = H5VM_power2up(scaled))) {
/* 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")
/* 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")
/* 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 */

View File

@ -170,7 +170,7 @@ H5D__efl_construct(H5F_t *f, H5D_t *dset)
stmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space);
HDassert(stmp_size >= 0);
tmp_size = (hsize_t)stmp_size * dt_size;
H5_ASSIGN_OVERFLOW(dset->shared->layout.storage.u.contig.size, tmp_size, hssize_t, hsize_t);
H5_CHECKED_ASSIGN(dset->shared->layout.storage.u.contig.size, hsize_t, tmp_size, hssize_t);
/* Get the sieve buffer size for this dataset */
dset->shared->cache.contig.sieve_buf_size = H5F_SIEVE_BUF_SIZE(f);
@ -193,7 +193,7 @@ done:
*-------------------------------------------------------------------------
*/
hbool_t
H5D__efl_is_space_alloc(const H5O_storage_t UNUSED *storage)
H5D__efl_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage)
{
FUNC_ENTER_PACKAGE_NOERR
@ -218,9 +218,9 @@ H5D__efl_is_space_alloc(const H5O_storage_t UNUSED *storage)
*-------------------------------------------------------------------------
*/
static herr_t
H5D__efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info,
hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space,
H5D_chunk_map_t UNUSED *cm)
H5D__efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info,
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space,
H5D_chunk_map_t H5_ATTR_UNUSED *cm)
{
FUNC_ENTER_STATIC_NOERR
@ -288,7 +288,7 @@ H5D__efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf)
HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed")
if((fd = HDopen(efl->slot[u].name, O_RDONLY, 0)) < 0)
HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file")
if(HDlseek(fd, (off_t)(efl->slot[u].offset + skip), SEEK_SET) < 0)
if(HDlseek(fd, (HDoff_t)(efl->slot[u].offset + skip), SEEK_SET) < 0)
HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file")
#ifndef NDEBUG
tempto_read = MIN(efl->slot[u].size-skip, (hsize_t)size);
@ -378,7 +378,7 @@ H5D__efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b
else
HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file")
} /* end if */
if(HDlseek(fd, (off_t)(efl->slot[u].offset + skip), SEEK_SET) < 0)
if(HDlseek(fd, (HDoff_t)(efl->slot[u].offset + skip), SEEK_SET) < 0)
HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file")
#ifndef NDEBUG
tempto_write = MIN(efl->slot[u].size - skip, (hsize_t)size);

View File

@ -2102,7 +2102,7 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info)
*/
/* ARGSUSED */
herr_t
H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned 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 */
@ -2240,6 +2240,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
if(changed) {
hbool_t shrink = FALSE; /* Flag to indicate a dimension has shrank */
hbool_t expand = FALSE; /* Flag to indicate a dimension has grown */
hbool_t update_chunks = FALSE; /* Flag to indicate chunk cache update is needed */
unsigned u; /* Local index variable */
/* Determine if we are shrinking and/or expanding any dimensions */
@ -2250,6 +2251,39 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
if(size[u] > curr_dims[u])
expand = TRUE;
/* Chunked storage specific checks */
if(H5D_CHUNKED == dset->shared->layout.type && dset->shared->ndims > 1) {
hsize_t scaled; /* Scaled value */
/* Compute the scaled dimension size value */
scaled = size[u] / dset->shared->layout.u.chunk.dim[u];
/* Check if scaled dimension size changed */
if(scaled != dset->shared->cache.chunk.scaled_dims[u]) {
hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */
/* Update the scaled dimension size value for the current dimension */
dset->shared->cache.chunk.scaled_dims[u] = scaled;
/* Check if algorithm for computing hash values will change */
if((scaled > dset->shared->cache.chunk.nslots &&
dset->shared->cache.chunk.scaled_dims[u] <= dset->shared->cache.chunk.nslots)
|| (scaled <= dset->shared->cache.chunk.nslots &&
dset->shared->cache.chunk.scaled_dims[u] > dset->shared->cache.chunk.nslots))
update_chunks = TRUE;
/* Check if the number of bits required to encode the scaled size value changed */
if(dset->shared->cache.chunk.scaled_power2up[u] != (scaled_power2up = H5VM_power2up(scaled))) {
/* Update the 'power2up' & 'encode_bits' values for the current dimension */
dset->shared->cache.chunk.scaled_power2up[u] = scaled_power2up;
dset->shared->cache.chunk.scaled_encode_bits[u] = H5VM_log2_gen(scaled_power2up);
/* Indicate that the cached chunk indices need to be updated */
update_chunks = TRUE;
} /* end if */
} /* end if */
} /* end if */
/* Update the cached copy of the dataset's dimensions */
dset->shared->curr_dims[u] = size[u];
} /* end for */
@ -2263,8 +2297,12 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
/* Set the cached chunk info */
if(H5D__chunk_set_info(dset) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks")
if(H5D__chunk_update_cache(dset, dxpl_id) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices")
/* 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)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices")
} /* end if */
/* Allocate space for the new parts of the dataset, if appropriate */
@ -2420,7 +2458,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags)
H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -2454,7 +2492,7 @@ H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags)
*-------------------------------------------------------------------------
*/
static int
H5D__flush_cb(void *_dataset, hid_t UNUSED id, void *_udata)
H5D__flush_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 */

View File

@ -409,7 +409,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
mem_space = file_space;
if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection")
H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t);
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)
@ -679,7 +679,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection")
H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, hsize_t);
H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t);
/* Make certain that the number of elements in each selection is the same */
if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space))

View File

@ -254,8 +254,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info,
hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space)
H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info,
hsize_t mpi_buf_count, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space)
{
const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */
herr_t ret_value = SUCCEED;
@ -283,8 +283,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info,
hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space)
H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATTR_UNUSED *type_info,
hsize_t mpi_buf_count, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space)
{
const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */
herr_t ret_value = SUCCEED;
@ -438,7 +438,7 @@ H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm,
/* Get the number of chunks to perform I/O on */
num_chunkf = 0;
ori_num_chunkf = H5SL_count(fm->sel_chunks);
H5_ASSIGN_OVERFLOW(num_chunkf, ori_num_chunkf, size_t, int);
H5_CHECKED_ASSIGN(num_chunkf, int, ori_num_chunkf, size_t);
/* Determine the summation of number of chunks for all processes */
if(MPI_SUCCESS != (mpi_code = MPI_Allreduce(&num_chunkf, sum_chunkf, 1, MPI_INT, MPI_SUM, io_info->comm)))
@ -464,8 +464,8 @@ done:
*/
herr_t
H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t UNUSED *fm)
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space,
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 */
@ -511,8 +511,8 @@ done:
*/
herr_t
H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t UNUSED *fm)
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space,
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 */
@ -714,7 +714,7 @@ done:
*/
herr_t
H5D__chunk_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space,
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space,
H5D_chunk_map_t *fm)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -745,7 +745,7 @@ done:
*/
herr_t
H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space,
hsize_t H5_ATTR_UNUSED nelmts, const H5S_t H5_ATTR_UNUSED *file_space, const H5S_t H5_ATTR_UNUSED *mem_space,
H5D_chunk_map_t *fm)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -826,7 +826,7 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ
} /* end if */
/* Retrieve total # of chunks in dataset */
H5_ASSIGN_OVERFLOW(total_chunks, fm->layout->u.chunk.nchunks, hsize_t, size_t);
H5_CHECKED_ASSIGN(total_chunks, size_t, fm->layout->u.chunk.nchunks, hsize_t);
/* Handle special case when dataspace dimensions only allow one chunk in
* the dataset. [This sometimes is used by developers who want the
@ -860,7 +860,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->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0)
if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, 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 */
@ -1148,7 +1148,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty
#endif
/* Retrieve total # of chunks in dataset */
H5_ASSIGN_OVERFLOW(total_chunk, fm->layout->u.chunk.nchunks, hsize_t, size_t);
H5_CHECKED_ASSIGN(total_chunk, size_t, fm->layout->u.chunk.nchunks, hsize_t);
HDassert(total_chunk != 0);
/* Allocate memories */
@ -1200,8 +1200,7 @@ if(H5DEBUG(D))
HDassert(chunk_info->index == u);
/* Pass in chunk's coordinates in a union. */
store.chunk.offset = chunk_info->coords;
store.chunk.index = chunk_info->index;
store.chunk.scaled = chunk_info->scaled;
} /* end if */
/* Collective IO for this chunk,
@ -1588,8 +1587,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->dxpl_id,
chunk_info->coords, chunk_info->index, &udata) < 0)
if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, 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 */
@ -1699,7 +1697,7 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm,
HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size")
/* Setup parameters */
H5_ASSIGN_OVERFLOW(total_chunks, fm->layout->u.chunk.nchunks, hsize_t, int);
H5_CHECKED_ASSIGN(total_chunks, int, fm->layout->u.chunk.nchunks, hsize_t);
percent_nproc_per_chunk = H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME);
/* if ratio is 0, perform collective io */
if(0 == percent_nproc_per_chunk) {

View File

@ -61,8 +61,6 @@
(io_info)->op_type = H5D_IO_OP_READ; \
(io_info)->u.rbuf = buf
#define H5D_CHUNK_HASH(D, ADDR) H5F_addr_hash(ADDR, (D)->cache.chunk.nslots)
/* Flags for marking aspects of a dataset dirty */
#define H5D_MARK_SPACE 0x01
#define H5D_MARK_LAYOUT 0x02
@ -165,8 +163,7 @@ typedef struct {
} H5D_contig_storage_t;
typedef struct {
hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */
hsize_t *offset; /* Chunk's coordinates in elements */
hsize_t *scaled; /* Scaled coordinates for a chunk */
} H5D_chunk_storage_t;
typedef struct {
@ -239,7 +236,7 @@ typedef struct H5D_chk_idx_info_t {
* The chunk's file address, filter mask and size on disk are not key values.
*/
typedef struct H5D_chunk_rec_t {
hsize_t offset[H5O_LAYOUT_NDIMS]; /* Logical offset to start */
hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Logical offset to start */
uint32_t nbytes; /* Size of stored data */
unsigned filter_mask; /* Excluded filters */
haddr_t chunk_addr; /* Address of chunk in file */
@ -254,7 +251,7 @@ typedef struct H5D_chunk_common_ud_t {
/* downward */
const H5O_layout_chunk_t *layout; /* Chunk layout description */
const H5O_storage_chunk_t *storage; /* Chunk storage description */
const hsize_t *offset; /* Logical offset of chunk */
const hsize_t *scaled; /* Scaled coordinates for a chunk */
} H5D_chunk_common_ud_t;
/* B-tree callback info for various operations */
@ -320,7 +317,7 @@ typedef struct H5D_chunk_ops_t {
typedef struct H5D_chunk_info_t {
hsize_t index; /* "Index" of chunk in dataset */
uint32_t chunk_points; /* Number of elements selected in chunk */
hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of chunk in file dataset's dataspace */
hsize_t scaled[H5O_LAYOUT_NDIMS]; /* Scaled coordinates of chunk (in file dataset's dataspace) */
H5S_t *fspace; /* Dataspace describing chunk & selection in it */
hbool_t fspace_shared; /* Indicate that the file space for a chunk is shared and shouldn't be freed */
H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */
@ -340,6 +337,7 @@ typedef struct H5D_chunk_map_t {
H5S_sel_iter_t mem_iter; /* Iterator for elements in memory selection */
unsigned m_ndims; /* Number of dimensions for memory dataspace */
H5S_sel_type msel_type; /* Selection type in memory */
H5S_sel_type fsel_type; /* Selection type in file */
H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */
@ -360,7 +358,7 @@ typedef struct H5D_chunk_map_t {
/* Cached information about a particular chunk */
typedef struct H5D_chunk_cached_t {
hbool_t valid; /*whether cache info is valid*/
hsize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/
hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled offset of chunk*/
haddr_t addr; /*file address of chunk */
uint32_t nbytes; /*size of stored data */
unsigned filter_mask; /*excluded filters */
@ -386,6 +384,11 @@ typedef struct H5D_rdcc_t {
H5SL_t *sel_chunks; /* Skip list containing information for each chunk selected */
H5S_t *single_space; /* Dataspace for single element I/O on chunks */
H5D_chunk_info_t *single_chunk_info; /* Pointer to single chunk's info */
/* Cached information about scaled dataspace dimensions */
hsize_t scaled_dims[H5S_MAX_RANK]; /* The scaled dim sizes */
hsize_t scaled_power2up[H5S_MAX_RANK]; /* The scaled dim sizes, rounded up to next power of 2 */
unsigned scaled_encode_bits[H5S_MAX_RANK]; /* The number of bits needed to encode the scaled dim sizes */
} H5D_rdcc_t;
/* The raw data contiguous data cache */
@ -494,7 +497,7 @@ typedef struct H5D_rdcc_ent_t {
hbool_t locked; /*entry is locked in cache */
hbool_t dirty; /*needs to be written to disk? */
hbool_t deleted; /*chunk about to be deleted */
hsize_t offset[H5O_LAYOUT_NDIMS]; /*chunk name */
hsize_t scaled[H5O_LAYOUT_NDIMS]; /*scaled chunk 'name' (coordinates) */
uint32_t rd_count; /*bytes remaining to be read */
uint32_t wr_count; /*bytes remaining to be written */
H5F_block_t chunk_block; /*offset/length of chunk in file */
@ -612,7 +615,7 @@ H5_DLL herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset,
hid_t dapl_id);
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 *chunk_offset, hsize_t chunk_idx, H5D_chunk_ud_t *udata);
const hsize_t *scaled, H5D_chunk_ud_t *udata);
H5_DLL void *H5D__chunk_lock(const H5D_io_info_t *io_info,
H5D_chunk_ud_t *udata, hbool_t relax);
H5_DLL herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info,

View File

@ -176,7 +176,7 @@ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_ad
/* 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,
int indent, int fwidth, unsigned ndims);
int indent, int fwidth, unsigned ndims, const uint32_t *dim);
#endif /* _H5Dprivate_H */

View File

@ -148,7 +148,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array info")
/* Lock the array header into memory */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, H5AC_WRITE)))
if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_WRITE)))
H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Point extensible array wrapper at header and bump it's ref count */
@ -168,7 +168,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
CATCH
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, 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)
@ -209,7 +209,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata))
#ifdef QAK
HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr);
#endif /* QAK */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, H5AC_READ)))
if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header, address = %llu", (unsigned long long)ea_addr)
/* Check for pending array deletion */
@ -237,7 +237,7 @@ HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr);
CATCH
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, 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)
@ -1048,7 +1048,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Lock the array header into memory */
/* (OK to pass in NULL for callback context, since we know the header must be in the cache) */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(ea->f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, NULL, H5AC_WRITE)))
if(NULL == (hdr = H5EA__hdr_protect(ea->f, dxpl_id, ea_addr, NULL, H5AC_WRITE)))
H5E_THROW(H5E_CANTLOAD, "unable to load extensible array header")
/* Set the shared array header's file context for this operation */
@ -1112,7 +1112,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata))
#ifdef QAK
HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr);
#endif /* QAK */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, H5AC_WRITE)))
if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC_WRITE)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr)
/* Check for files using shared array header */
@ -1131,7 +1131,7 @@ HDfprintf(stderr, "%s: ea_addr = %a\n", FUNC, ea_addr);
CATCH
/* Unprotect the header, if an error occurred */
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PRIV) /* end H5EA_delete() */

View File

@ -43,7 +43,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5MFprivate.h" /* File memory management */
#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5WBprivate.h" /* Wrapped Buffers */
@ -227,7 +227,7 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata))
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the 'base' size of the extensible array header on disk */
size = H5EA_HEADER_SIZE(hdr);
size = H5EA_HEADER_SIZE_HDR(hdr);
/* Get a pointer to a buffer that's large enough for serialized header */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
@ -350,7 +350,7 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5EA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5EA_hdr_t *hdr, unsigned UNUSED * flags_ptr))
H5EA_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr))
H5WB_t *wb = NULL; /* Wrapped buffer for header data */
uint8_t hdr_buf[H5EA_HDR_BUF_SIZE]; /* Buffer for header */
@ -486,7 +486,7 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_clear() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5EA__cache_hdr_size(const H5F_t UNUSED *f, const H5EA_hdr_t *hdr,
H5EA__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_hdr_t *hdr,
size_t *size_ptr))
/* Sanity check */
@ -577,6 +577,7 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
size_t u; /* Local index variable */
/* Sanity check */
HDassert(f);
@ -638,8 +639,6 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
/* Decode data block addresses in index block */
if(iblock->ndblk_addrs > 0) {
size_t u; /* Local index variable */
/* Decode addresses of data blocks in index block */
for(u = 0; u < iblock->ndblk_addrs; u++)
H5F_addr_decode(f, &p, &iblock->dblk_addrs[u]);
@ -647,8 +646,6 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
/* Decode super block addresses in index block */
if(iblock->nsblk_addrs > 0) {
size_t u; /* Local index variable */
/* Decode addresses of super blocks in index block */
for(u = 0; u < iblock->nsblk_addrs; u++)
H5F_addr_decode(f, &p, &iblock->sblk_addrs[u]);
@ -705,7 +702,7 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5EA__cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5EA_iblock_t *iblock, unsigned UNUSED * flags_ptr))
H5EA_iblock_t *iblock, unsigned H5_ATTR_UNUSED * flags_ptr))
/* Local variables */
H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */
@ -872,11 +869,7 @@ H5EA__cache_iblock_notify(H5AC_notify_action_t action, H5EA_iblock_t *iblock))
break;
default:
#ifdef NDEBUG
H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
CATCH
@ -902,7 +895,7 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5EA__cache_iblock_size(const H5F_t UNUSED *f, const H5EA_iblock_t *iblock,
H5EA__cache_iblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_iblock_t *iblock,
size_t *size_ptr))
/* Sanity check */
@ -1111,7 +1104,7 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5EA__cache_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5EA_sblock_t *sblock, unsigned UNUSED * flags_ptr))
H5EA_sblock_t *sblock, unsigned H5_ATTR_UNUSED * flags_ptr))
/* Local variables */
H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */
@ -1252,7 +1245,7 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_clear() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5EA__cache_sblock_size(const H5F_t UNUSED *f, const H5EA_sblock_t *sblock,
H5EA__cache_sblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_sblock_t *sblock,
size_t *size_ptr))
/* Sanity check */
@ -1300,11 +1293,7 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, H5EA_sblock_t *sblock))
break;
default:
#ifdef NDEBUG
H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
CATCH
@ -1505,7 +1494,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5EA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5EA_dblock_t *dblock, unsigned UNUSED * flags_ptr))
H5EA_dblock_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr))
/* Local variables */
H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */
@ -1662,11 +1651,7 @@ H5EA__cache_dblock_notify(H5AC_notify_action_t action, H5EA_dblock_t *dblock))
break;
default:
#ifdef NDEBUG
H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
CATCH
@ -1692,7 +1677,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5EA__cache_dblock_size(const H5F_t UNUSED *f, const H5EA_dblock_t *dblock,
H5EA__cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_dblock_t *dblock,
size_t *size_ptr))
/* Sanity check */
@ -1791,9 +1776,6 @@ H5EA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(udata && udata->hdr && udata->parent);
#ifdef QAK
HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr);
#endif /* QAK */
/* Allocate the extensible array data block page */
if(NULL == (dblk_page = H5EA__dblk_page_alloc(udata->hdr, udata->parent)))
@ -1807,7 +1789,7 @@ HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr);
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the size of the extensible array data block page on disk */
size = H5EA_DBLK_PAGE_SIZE(dblk_page);
size = H5EA_DBLK_PAGE_SIZE(udata->hdr);
/* Get a pointer to a buffer that's large enough for serialized info */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
@ -1879,7 +1861,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5EA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5EA_dblk_page_t *dblk_page, unsigned UNUSED * flags_ptr))
H5EA_dblk_page_t *dblk_page, unsigned H5_ATTR_UNUSED * flags_ptr))
/* Local variables */
H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */
@ -2014,11 +1996,7 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, H5EA_dblk_page_t *dblk
break;
default:
#ifdef NDEBUG
H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
CATCH
@ -2044,7 +2022,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5EA__cache_dblk_page_size(const H5F_t UNUSED *f, const H5EA_dblk_page_t *dblk_page,
H5EA__cache_dblk_page_size(const H5F_t H5_ATTR_UNUSED *f, const H5EA_dblk_page_t *dblk_page,
size_t *size_ptr))
/* Sanity check */
@ -2077,7 +2055,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_size() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5EA__cache_dblk_page_dest(H5F_t UNUSED *f, H5EA_dblk_page_t *dblk_page))
H5EA__cache_dblk_page_dest(H5F_t H5_ATTR_UNUSED *f, H5EA_dblk_page_t *dblk_page))
/* Sanity check */
HDassert(f);

View File

@ -119,7 +119,7 @@ H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
} /* end if */
/* Load the extensible array header */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, addr, dbg_ctx, H5AC_READ)))
if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Print opening message */
@ -171,7 +171,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 && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__hdr_debug() */
@ -192,13 +192,13 @@ 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 UNUSED addr, FILE *stream, int indent,
H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, 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 */
H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
void *dbg_ctx = NULL; /* Extensible array context */
H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
H5EA_iblock_t *iblock = NULL; /* Extensible array index block */
void *dbg_ctx = NULL; /* Extensible array context */
/* Check arguments */
HDassert(f);
@ -218,7 +218,7 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, i
} /* end if */
/* Load the extensible array header */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ)))
if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Sanity check */
@ -296,7 +296,7 @@ CATCH
H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
if(iblock && H5EA__iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block")
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__iblock_debug() */
@ -321,9 +321,9 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr))
/* Local variables */
H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
void *dbg_ctx = NULL; /* Extensible array context */
H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
H5EA_sblock_t *sblock = NULL; /* Extensible array super block */
void *dbg_ctx = NULL; /* Extensible array context */
/* Check arguments */
HDassert(f);
@ -343,7 +343,7 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
} /* end if */
/* Load the extensible array header */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ)))
if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Protect super block */
@ -388,7 +388,7 @@ CATCH
H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block")
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__sblock_debug() */
@ -415,7 +415,7 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
/* Local variables */
H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
H5EA_dblock_t *dblock = NULL; /* Extensible array data block */
void *dbg_ctx = NULL; /* Extensible array context */
void *dbg_ctx = NULL; /* Extensible array context */
size_t u; /* Local index variable */
/* Check arguments */
@ -437,7 +437,7 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
} /* end if */
/* Load the extensible array header */
if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ)))
if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header")
/* Protect data block */
@ -471,7 +471,7 @@ CATCH
H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context")
if(dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block")
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_EARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__dblock_debug() */

View File

@ -169,7 +169,7 @@ HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr);
/* Set info about data block page on disk */
dblk_page->addr = addr;
dblk_page->size = H5EA_DBLK_PAGE_SIZE(dblk_page);
dblk_page->size = H5EA_DBLK_PAGE_SIZE(hdr);
#ifdef QAK
HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size);
#endif /* QAK */

View File

@ -230,7 +230,7 @@ HDfprintf(stderr, "%s: hdr->sblk_info[%Zu] = {%Zu, %Zu, %Hu, %Hu}\n", FUNC, u, h
} /* end for */
/* Set size of header on disk (locally and in statistics) */
hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE(hdr);
hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE_HDR(hdr);
/* Create the callback context, if there's one */
if(hdr->cparam.cls->crt_context) {
@ -610,6 +610,70 @@ CATCH
END_FUNC(PKG) /* end H5EA__hdr_modified() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_protect
*
* Purpose: Convenience wrapper around protecting extensible array header
*
* Return: Non-NULL pointer to index block on success/NULL on failure
*
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Jul 31 2013
*
*-------------------------------------------------------------------------
*/
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,
H5AC_protect_t rw))
/* Local variables */
/* Sanity check */
HDassert(f);
HDassert(H5F_addr_defined(ea_addr));
/* Protect the header */
if(NULL == (ret_value = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, ctx_udata, rw)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr)
CATCH
END_FUNC(PKG) /* end H5EA__hdr_protect() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_unprotect
*
* Purpose: Convenience wrapper around unprotecting extensible array header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Aug 1 2013
*
*-------------------------------------------------------------------------
*/
BEGIN_FUNC(PKG, ERR,
herr_t, SUCCEED, FAIL,
H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags))
/* Local variables */
/* Sanity check */
HDassert(hdr);
/* Unprotect the header */
if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_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
END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5EA__hdr_delete
@ -665,7 +729,7 @@ HDfprintf(stderr, "%s: hdr->idx_blk_addr = %a\n", FUNC, hdr->idx_blk_addr);
CATCH
/* Unprotect the header, deleting it if an error hasn't occurred */
if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0)
if(H5EA__hdr_unprotect(hdr, dxpl_id, cache_flags) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header")
END_FUNC(PKG) /* end H5EA__hdr_delete() */

View File

@ -66,7 +66,7 @@
)
/* Size of the extensible array header on disk */
#define H5EA_HEADER_SIZE(h) ( \
#define H5EA_HEADER_SIZE(sizeof_addr, sizeof_size) ( \
/* General metadata fields */ \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
@ -79,15 +79,25 @@
+ 1 /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ \
\
/* Extensible Array statistics fields */ \
+ (h)->sizeof_size /* Number of super blocks created */ \
+ (h)->sizeof_size /* Size of super blocks created */ \
+ (h)->sizeof_size /* Number of data blocks created */ \
+ (h)->sizeof_size /* Size of data blocks created */ \
+ (h)->sizeof_size /* Max. index set */ \
+ (h)->sizeof_size /* Number of elements 'realized' */ \
+ (sizeof_size) /* Number of super blocks created */ \
+ (sizeof_size) /* Size of super blocks created */ \
+ (sizeof_size) /* Number of data blocks created */ \
+ (sizeof_size) /* Size of data blocks created */ \
+ (sizeof_size) /* Max. index set */ \
+ (sizeof_size) /* Number of elements 'realized' */ \
\
/* Extensible Array Header specific fields */ \
+ (h)->sizeof_addr /* File address of index block */ \
+ (sizeof_addr) /* File address of index block */ \
)
/* Size of the extensible array header on disk (via file pointer) */
#define H5EA_HEADER_SIZE_FILE(f) ( \
H5EA_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \
)
/* Size of the extensible array header on disk (via extensible array header) */
#define H5EA_HEADER_SIZE_HDR(h) ( \
H5EA_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \
)
/* Size of the extensible array index block on disk */
@ -139,8 +149,8 @@
)
/* Size of the extensible array data block page on disk */
#define H5EA_DBLK_PAGE_SIZE(p) ( \
+ ((p)->hdr->dblk_page_nelmts * (size_t)(p)->hdr->cparam.raw_elmt_size) /* Elements in data block page */ \
#define H5EA_DBLK_PAGE_SIZE(h) ( \
+ ((h)->dblk_page_nelmts * (size_t)(h)->cparam.raw_elmt_size) /* Elements in data block page */ \
+ H5EA_SIZEOF_CHKSUM /* Checksum for each page */ \
)
@ -302,11 +312,12 @@ struct H5EA_t {
/* Metadata cache callback user data types */
/* Info needed for loading data block page */
typedef struct H5EA_dblk_page_cache_ud_t {
/* Info needed for loading super block */
typedef struct H5EA_sblock_cache_ud_t {
H5EA_hdr_t *hdr; /* Shared extensible array information */
H5EA_sblock_t *parent; /* Pointer to parent object for data block page (super block) */
} H5EA_dblk_page_cache_ud_t;
H5EA_iblock_t *parent; /* Pointer to parent object for super block (index block) */
unsigned sblk_idx; /* Index of super block */
} H5EA_sblock_cache_ud_t;
/* Info needed for loading data block */
typedef struct H5EA_dblock_cache_ud_t {
@ -315,12 +326,11 @@ typedef struct H5EA_dblock_cache_ud_t {
size_t nelmts; /* Number of elements in data block */
} H5EA_dblock_cache_ud_t;
/* Info needed for loading super block */
typedef struct H5EA_sblock_cache_ud_t {
/* Info needed for loading data block page */
typedef struct H5EA_dblk_page_cache_ud_t {
H5EA_hdr_t *hdr; /* Shared extensible array information */
H5EA_iblock_t *parent; /* Pointer to parent object for super block (index block) */
unsigned sblk_idx; /* Index of super block */
} H5EA_sblock_cache_ud_t;
H5EA_sblock_t *parent; /* Pointer to parent object for data block page (super block) */
} H5EA_dblk_page_cache_ud_t;
#ifdef H5EA_TESTING
typedef struct H5EA__ctx_cb_t {
@ -377,6 +387,9 @@ 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,
void *ctx_udata, H5AC_protect_t rw);
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_dest(H5EA_hdr_t *hdr);

View File

@ -78,7 +78,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 UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED obj_addr);
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 herr_t H5EA__test_dst_dbg_context(void *_ctx);
/*********************/
@ -358,7 +358,7 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
H5EA__test_crt_dbg_context(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED obj_addr))
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))
/* Local variables */
H5EA__ctx_cb_t *ctx; /* Context for callbacks */

View File

@ -272,10 +272,12 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data)
/* try show the process or thread id in multiple processes cases*/
#ifdef H5_HAVE_PARALLEL
{
int mpi_rank, mpi_initialized;
int mpi_rank, mpi_initialized, mpi_finalized;
MPI_Initialized(&mpi_initialized);
if(mpi_initialized) {
MPI_Finalized(&mpi_finalized);
if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
fprintf(stream, "MPI-process %d", mpi_rank);
} /* end if */
@ -402,10 +404,12 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data)
/* try show the process or thread id in multiple processes cases*/
#ifdef H5_HAVE_PARALLEL
{
int mpi_rank, mpi_initialized;
int mpi_rank, mpi_initialized, mpi_finalized;
MPI_Initialized(&mpi_initialized);
if(mpi_initialized) {
MPI_Finalized(&mpi_finalized);
if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
fprintf(stream, "MPI-process %d", mpi_rank);
} /* end if */

View File

@ -165,7 +165,7 @@ H5_DLL herr_t H5Eclose_stack(hid_t stack_id);
H5_DLL ssize_t H5Eget_class_name(hid_t class_id, char *name, size_t size);
H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id);
H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line,
hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...)__attribute__((format (printf, 8, 9)));
hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...);
H5_DLL herr_t H5Epop(hid_t err_stack, size_t count);
H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream);
H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func,

View File

@ -1380,7 +1380,7 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo)
HDmemset(finfo, 0, sizeof(*finfo));
/* Get the size of the superblock and any superblock extensions */
if(H5F_super_size(f, H5AC_ind_dxpl_id, &finfo->super.super_size, &finfo->super.super_ext_size) < 0)
if(H5F__super_size(f, H5AC_ind_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 */
@ -1477,3 +1477,4 @@ H5Fclear_elink_file_cache(hid_t file_id)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fclear_elink_file_cache() */

View File

@ -141,7 +141,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array info")
/* Lock the array header into memory */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_WRITE)))
if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE)))
H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
/* Point fixed array wrapper at header and bump it's ref count */
@ -161,7 +161,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
CATCH
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
if(!ret_value)
if(fa && H5FA_close(fa, dxpl_id) < 0)
@ -201,7 +201,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata))
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr);
#endif /* H5FA_DEBUG */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_READ)))
if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header, address = %llu", (unsigned long long)fa_addr)
/* Check for pending array deletion */
@ -229,7 +229,7 @@ HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr);
CATCH
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
if(!ret_value)
if(fa && H5FA_close(fa, dxpl_id) < 0)
@ -351,7 +351,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx);
#endif /* H5FA_DEBUG */
/* Create the data block */
hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty, hdr->cparam.nelmts);
hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty);
if(!H5F_addr_defined(hdr->dblk_addr))
H5E_THROW(H5E_CANTCREATE, "unable to create fixed array data block")
} /* end if */
@ -359,7 +359,7 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx
HDassert(idx < hdr->cparam.nelmts);
/* Protect data block */
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, hdr->stats.nelmts, H5AC_WRITE)))
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_WRITE)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr)
/* Check for paging data block */
@ -467,7 +467,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx);
else {
/* Get the data block */
HDassert(H5F_addr_defined(hdr->dblk_addr));
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, hdr->stats.nelmts, H5AC_READ)))
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr)
/* Check for paged data block */
@ -592,7 +592,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Lock the array header into memory */
/* (OK to pass in NULL for callback context, since we know the header must be in the cache) */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(fa->f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, NULL, H5AC_WRITE)))
if(NULL == (hdr = H5FA__hdr_protect(fa->f, dxpl_id, fa_addr, NULL, H5AC_WRITE)))
H5E_THROW(H5E_CANTLOAD, "unable to load fixed array header")
/* Set the shared array header's file context for this operation */
@ -655,7 +655,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata))
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr);
#endif /* H5FA_DEBUG */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_WRITE)))
if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr)
/* Check for files using shared array header */
@ -674,7 +674,7 @@ HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr);
CATCH
/* Unprotect the header, if an error occurred */
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
END_FUNC(PRIV) /* end H5FA_delete() */

View File

@ -16,6 +16,8 @@
/*-------------------------------------------------------------------------
*
* Created: H5FAcache.c
* Jul 2 2009
* Quincey Koziol <koziol@hdfgroup.org>
*
* Purpose: Implement fixed array metadata cache methods.
*
@ -41,7 +43,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5FApkg.h" /* Fixed Arrays */
#include "H5MFprivate.h" /* File memory management */
#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5WBprivate.h" /* Wrapped Buffers */
@ -187,7 +189,7 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata))
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the 'base' size of the fixed array header on disk */
size = H5FA_HEADER_SIZE(hdr);
size = H5FA_HEADER_SIZE_HDR(hdr);
/* Get a pointer to a buffer that's large enough for serialized header */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
@ -299,7 +301,7 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5FA__cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5FA_hdr_t *hdr, unsigned UNUSED * flags_ptr))
H5FA_hdr_t *hdr, unsigned H5_ATTR_UNUSED * flags_ptr))
H5WB_t *wb = NULL; /* Wrapped buffer for header data */
uint8_t hdr_buf[H5FA_HDR_BUF_SIZE]; /* Buffer for header */
@ -424,7 +426,7 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_clear() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5FA__cache_hdr_size(const H5F_t UNUSED *f, const H5FA_hdr_t *hdr,
H5FA__cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_hdr_t *hdr,
size_t *size_ptr))
/* Sanity check */
@ -517,10 +519,10 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
/* Sanity check */
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(udata && udata->hdr && udata->nelmts > 0);
HDassert(udata && udata->hdr);
/* Allocate the fixed array data block */
if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr, udata->nelmts)))
if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr)))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block")
/* Set the fixed array data block's information */
@ -575,9 +577,9 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
if(!dblock->npages) {
/* Decode elements in data block */
/* Convert from raw elements on disk into native elements in memory */
if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, (size_t)udata->nelmts, udata->hdr->cb_ctx) < 0)
if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, (size_t)udata->hdr->stats.nelmts, udata->hdr->cb_ctx) < 0)
H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements")
p += (udata->nelmts * udata->hdr->cparam.raw_elmt_size);
p += (udata->hdr->stats.nelmts * udata->hdr->cparam.raw_elmt_size);
} /* end if */
/* Sanity check */
@ -630,7 +632,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5FA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5FA_dblock_t *dblock, unsigned UNUSED * flags_ptr))
H5FA_dblock_t *dblock, unsigned H5_ATTR_UNUSED * flags_ptr))
/* Local variables */
H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */
@ -771,7 +773,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_clear() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5FA__cache_dblock_size(const H5F_t UNUSED *f, const H5FA_dblock_t *dblock,
H5FA__cache_dblock_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_dblock_t *dblock,
size_t *size_ptr))
/* Sanity check */
@ -868,9 +870,6 @@ H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata))
HDassert(f);
HDassert(H5F_addr_defined(addr));
HDassert(udata && udata->hdr && udata->nelmts > 0);
#ifdef QAK
HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr);
#endif /* QAK */
/* Allocate the fixed array data block page */
if(NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts)))
@ -884,7 +883,7 @@ HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr);
H5E_THROW(H5E_CANTINIT, "can't wrap buffer")
/* Compute the size of the fixed array data block page on disk */
size = H5FA_DBLK_PAGE_SIZE(dblk_page, udata->nelmts);
size = H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts);
/* Get a pointer to a buffer that's large enough for serialized info */
if(NULL == (buf = (uint8_t *)H5WB_actual(wb, size)))
@ -955,7 +954,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_load() */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5FA__cache_dblk_page_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
H5FA_dblk_page_t *dblk_page, unsigned UNUSED * flags_ptr))
H5FA_dblk_page_t *dblk_page, unsigned H5_ATTR_UNUSED * flags_ptr))
/* Local variables */
H5WB_t *wb = NULL; /* Wrapped buffer for serializing data */
@ -1071,7 +1070,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_clear() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5FA__cache_dblk_page_size(const H5F_t UNUSED *f, const H5FA_dblk_page_t *dblk_page,
H5FA__cache_dblk_page_size(const H5F_t H5_ATTR_UNUSED *f, const H5FA_dblk_page_t *dblk_page,
size_t *size_ptr))
/* Sanity check */
@ -1103,7 +1102,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_size() */
/* ARGSUSED */
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
H5FA__cache_dblk_page_dest(H5F_t UNUSED *f, H5FA_dblk_page_t *dblk_page))
H5FA__cache_dblk_page_dest(H5F_t H5_ATTR_UNUSED *f, H5FA_dblk_page_t *dblk_page))
/* Sanity check */
HDassert(f);

View File

@ -117,7 +117,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
} /* end if */
/* Load the fixed array header */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, addr, dbg_ctx, H5AC_READ)))
if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
/* Print opening message */
@ -150,7 +150,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
CATCH
if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0)
H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
END_FUNC(PKG) /* end H5FA__hdr_debug() */
@ -198,11 +198,11 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde
} /* end if */
/* Load the fixed array header */
if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ)))
if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header")
/* Protect data block */
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, hdr->cparam.nelmts, H5AC_READ)))
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, H5AC_READ)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)addr)
/* Print opening message */
@ -280,7 +280,7 @@ CATCH
H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context")
if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block")
if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0)
if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header")
END_FUNC(PKG) /* end H5FA__dblock_debug() */

View File

@ -167,7 +167,7 @@ HDfprintf(stderr, "%s: Called, addr = %a\n", FUNC, addr);
/* Set info about data block page on disk */
dblk_page->addr = addr;
dblk_page->size = H5FA_DBLK_PAGE_SIZE(dblk_page, nelmts);
dblk_page->size = H5FA_DBLK_PAGE_SIZE(hdr, nelmts);
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size);
#endif /* H5FA_DEBUG */

View File

@ -102,14 +102,14 @@ H5FL_BLK_DEFINE(fa_page_init);
*/
BEGIN_FUNC(PKG, ERR,
H5FA_dblock_t *, NULL, NULL,
H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts))
H5FA__dblock_alloc(H5FA_hdr_t *hdr))
/* Local variables */
H5FA_dblock_t *dblock = NULL; /* fixed array data block */
/* Check arguments */
HDassert(hdr);
HDassert(nelmts > 0);
HDassert(hdr->cparam.nelmts > 0);
/* Allocate memory for the data block */
if(NULL == (dblock = H5FL_CALLOC(H5FA_dblock_t)))
@ -124,12 +124,12 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts))
dblock->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits;
/* Check if this data block should be paged */
if(nelmts > dblock->dblk_page_nelmts) {
if(hdr->cparam.nelmts > dblock->dblk_page_nelmts) {
/* Compute number of pages */
hsize_t npages = ((nelmts + dblock->dblk_page_nelmts) - 1) / dblock->dblk_page_nelmts;
hsize_t npages = ((hdr->cparam.nelmts + dblock->dblk_page_nelmts) - 1) / dblock->dblk_page_nelmts;
/* Safely assign the number of pages */
H5_ASSIGN_OVERFLOW(/* To: */ dblock->npages, /* From: */ npages, /* From: */ hsize_t, /* To: */ size_t);
H5_CHECKED_ASSIGN(dblock->npages, size_t, npages, hsize_t);
/* Sanity check that we have at least 1 page */
HDassert(dblock->npages > 0);
@ -146,10 +146,10 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts))
dblock->dblk_page_size = (dblock->dblk_page_nelmts * hdr->cparam.raw_elmt_size) + H5FA_SIZEOF_CHKSUM;
/* Compute the # of elements on last page */
if(0 == nelmts % dblock->dblk_page_nelmts)
if(0 == hdr->cparam.nelmts % dblock->dblk_page_nelmts)
dblock->last_page_nelmts = dblock->dblk_page_nelmts;
else
dblock->last_page_nelmts = (size_t)(nelmts % dblock->dblk_page_nelmts);
dblock->last_page_nelmts = (size_t)(hdr->cparam.nelmts % dblock->dblk_page_nelmts);
} /* end if */
else {
hsize_t dblk_size = hdr->cparam.nelmts * hdr->cparam.cls->nat_elmt_size;
@ -186,24 +186,22 @@ END_FUNC(PKG) /* end H5FA__dblock_alloc() */
*/
BEGIN_FUNC(PKG, ERR,
haddr_t, HADDR_UNDEF, HADDR_UNDEF,
H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty,
hsize_t nelmts))
H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty))
/* Local variables */
H5FA_dblock_t *dblock = NULL; /* fixed array data block */
haddr_t dblock_addr; /* fixed array data block address */
#ifdef H5FA_DEBUG
HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, hdr->stats.nelmts, nelmts);
HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, hdr->stats.nelmts, hdr->cparam.nelmts);
#endif /* H5FA_DEBUG */
/* Sanity check */
HDassert(hdr);
HDassert(hdr_dirty);
HDassert(nelmts > 0);
/* Allocate the data block */
if(NULL == (dblock = H5FA__dblock_alloc(hdr, nelmts)))
if(NULL == (dblock = H5FA__dblock_alloc(hdr)))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block")
/* Set size of data block on disk */
@ -265,7 +263,7 @@ END_FUNC(PKG) /* end H5FA__dblock_create() */
BEGIN_FUNC(PKG, ERR,
H5FA_dblock_t *, NULL, NULL,
H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr,
hsize_t dblk_nelmts, H5AC_protect_t rw))
H5AC_protect_t rw))
/* Local variables */
H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */
@ -277,11 +275,9 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Sanity check */
HDassert(hdr);
HDassert(H5F_addr_defined(dblk_addr));
HDassert(dblk_nelmts);
/* Set up user data */
udata.hdr = hdr;
udata.nelmts = dblk_nelmts;
/* Protect the data block */
if(NULL == (ret_value = (H5FA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, rw)))
@ -340,8 +336,7 @@ END_FUNC(PKG) /* end H5FA__dblock_unprotect() */
*/
BEGIN_FUNC(PKG, ERR,
herr_t, SUCCEED, FAIL,
H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr,
hsize_t dblk_nelmts))
H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr))
/* Local variables */
H5FA_dblock_t *dblock = NULL; /* Pointer to data block */
@ -353,10 +348,9 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Sanity check */
HDassert(hdr);
HDassert(H5F_addr_defined(dblk_addr));
HDassert(dblk_nelmts > 0);
/* Protect data block */
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, dblk_nelmts, H5AC_WRITE)))
if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, H5AC_WRITE)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr)
/* Check if data block is paged */

View File

@ -148,7 +148,7 @@ H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata))
HDassert(hdr);
/* Set size of header on disk (locally and in statistics) */
hdr->stats.hdr_size = hdr->size = H5FA_HEADER_SIZE(hdr);
hdr->stats.hdr_size = hdr->size = H5FA_HEADER_SIZE_HDR(hdr);
/* Set number of elements for Fixed Array in statistics */
hdr->stats.nelmts = hdr->cparam.nelmts;
@ -391,6 +391,70 @@ CATCH
END_FUNC(PKG) /* end H5FA__hdr_modified() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_protect
*
* Purpose: Convenience wrapper around protecting fixed array header
*
* Return: Non-NULL pointer to index block on success/NULL on failure
*
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Aug 12 2013
*
*-------------------------------------------------------------------------
*/
BEGIN_FUNC(PKG, ERR,
H5FA_hdr_t *, NULL, NULL,
H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata,
H5AC_protect_t rw))
/* Local variables */
/* Sanity check */
HDassert(f);
HDassert(H5F_addr_defined(fa_addr));
/* Protect the header */
if(NULL == (ret_value = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, rw)))
H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr)
CATCH
END_FUNC(PKG) /* end H5FA__hdr_protect() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_unprotect
*
* Purpose: Convenience wrapper around unprotecting fixed array header
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* koziol@hdfgroup.org
* Aug 12 2013
*
*-------------------------------------------------------------------------
*/
BEGIN_FUNC(PKG, ERR,
herr_t, SUCCEED, FAIL,
H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags))
/* Local variables */
/* Sanity check */
HDassert(hdr);
/* Unprotect the header */
if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0)
H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array hdr, address = %llu", (unsigned long long)hdr->addr)
CATCH
END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
/*-------------------------------------------------------------------------
* Function: H5FA__hdr_delete
@ -436,7 +500,7 @@ HDfprintf(stderr, "%s: hdr->dblk_addr = %a\n", FUNC, hdr->dblk_addr);
#endif /* H5FA_DEBUG */
/* Delete Fixed Array Data block */
if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr, hdr->cparam.nelmts) < 0)
if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr) < 0)
H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block")
} /* end if */

View File

@ -70,7 +70,7 @@
)
/* Size of the Fixed Array header on disk */
#define H5FA_HEADER_SIZE(h) ( \
#define H5FA_HEADER_SIZE(sizeof_addr, sizeof_size) ( \
/* General metadata fields */ \
H5FA_METADATA_PREFIX_SIZE(TRUE) \
\
@ -79,10 +79,20 @@
+ 1 /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */ \
\
/* Fixed Array statistics fields */ \
+ (h)->sizeof_size /* # of elements in the fixed array */ \
+ (sizeof_size) /* # of elements in the fixed array */ \
\
/* Fixed Array Header specific fields */ \
+ (h)->sizeof_addr /* File address of Fixed Array data block */ \
+ (sizeof_addr) /* File address of Fixed Array data block */ \
)
/* Size of the fixed array header on disk (via file pointer) */
#define H5FA_HEADER_SIZE_FILE(f) ( \
H5FA_HEADER_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \
)
/* Size of the fixed array header on disk (via fixed array header) */
#define H5FA_HEADER_SIZE_HDR(h) ( \
H5FA_HEADER_SIZE((h)->sizeof_addr, (h)->sizeof_size) \
)
/* Size of the Fixed Array data block prefix on disk */
@ -108,9 +118,9 @@
)
/* Size of the Fixed Array data block page on disk */
#define H5FA_DBLK_PAGE_SIZE(d, nelmts) ( \
#define H5FA_DBLK_PAGE_SIZE(h, nelmts) ( \
/* Fixed Array Data Block Page */ \
+ (nelmts * (size_t)(d)->hdr->cparam.raw_elmt_size) /* Elements in data block page */ \
+ (nelmts * (size_t)(h)->cparam.raw_elmt_size) /* Elements in data block page */ \
+ H5FA_SIZEOF_CHKSUM /* Checksum for each page */ \
)
@ -199,13 +209,12 @@ struct H5FA_t {
/* Info needed for loading data block */
typedef struct H5FA_dblock_cache_ud_t {
H5FA_hdr_t *hdr; /* Shared fixed array information */
hsize_t nelmts; /* Number of elements in data block */
} H5FA_dblock_cache_ud_t;
/* Info needed for loading data block page */
typedef struct H5FA_dblk_page_cache_ud_t {
H5FA_hdr_t *hdr; /* Shared fixed array information */
size_t nelmts; /* Number of elements in data block page */
size_t nelmts; /* Number of elements in data block page */
} H5FA_dblk_page_cache_ud_t;
@ -244,19 +253,22 @@ H5_DLL herr_t H5FA__hdr_decr(H5FA_hdr_t *hdr);
H5_DLL herr_t H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr);
H5_DLL size_t H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr);
H5_DLL herr_t H5FA__hdr_modified(H5FA_hdr_t *hdr);
H5_DLL H5FA_hdr_t *H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr,
void *ctx_udata, H5AC_protect_t rw);
H5_DLL herr_t H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags);
H5_DLL herr_t H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id);
H5_DLL herr_t H5FA__hdr_dest(H5FA_hdr_t *hdr);
/* Data block routines */
H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts);
H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty, hsize_t nelmts);
H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr);
H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty);
H5_DLL unsigned H5FA__dblock_sblk_idx(const H5FA_hdr_t *hdr, hsize_t idx);
H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id,
haddr_t dblk_addr, hsize_t dblk_nelmts, H5AC_protect_t rw);
haddr_t dblk_addr, H5AC_protect_t rw);
H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id,
unsigned cache_flags);
H5_DLL herr_t H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id,
haddr_t dblk_addr, hsize_t dblk_nelmts);
haddr_t dblk_addr);
H5_DLL herr_t H5FA__dblock_dest(H5FA_dblock_t *dblock);
/* Data block page routines */

View File

@ -133,7 +133,7 @@ H5FL_DEFINE_STATIC(H5FA__test_ctx_t);
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
H5FA__test_crt_context(void UNUSED *udata))
H5FA__test_crt_context(void H5_ATTR_UNUSED *udata))
/* Local variables */
H5FA__test_ctx_t *ctx; /* Context for callbacks */
@ -226,7 +226,7 @@ END_FUNC(STATIC) /* end H5FA__test_fill() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void UNUSED *_ctx))
H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx))
/* Local variables */
#ifndef NDEBUG
@ -271,7 +271,7 @@ END_FUNC(STATIC) /* end H5FA__test_encode() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void UNUSED *_ctx))
H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_UNUSED *_ctx))
/* Local variables */
#ifndef NDEBUG
@ -350,7 +350,7 @@ END_FUNC(STATIC) /* end H5FA__test_debug() */
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
H5FA__test_crt_dbg_context(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED obj_addr))
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))
/* Local variables */
H5FA__test_ctx_t *ctx; /* Context for callbacks */

View File

@ -540,11 +540,11 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf)
done:
FUNC_LEAVE_NOAPI(ret_value)
}
} /* end H5FD_sb_encode() */
/*-------------------------------------------------------------------------
* Function: H5FD_sb_decode
* Function: H5FD__sb_decode
*
* Purpose: Decodes the driver information block.
*
@ -556,20 +556,61 @@ done:
*
*-------------------------------------------------------------------------
*/
static herr_t
H5FD__sb_decode(H5FD_t *file, const char *name, const uint8_t *buf)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
HDassert(file && file->cls);
/* Decode driver information */
if(file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__sb_decode() */
/*-------------------------------------------------------------------------
* Function: H5FD_sb_load
*
* Purpose: Validate and decode the driver information block.
*
* Return: Success: Non-negative
* Failure: Negative
*
* Programmer: Quincey Koziol
* Friday, July 19, 2013
*
*-------------------------------------------------------------------------
*/
herr_t
H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf)
H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
HDassert(file && file->cls);
if(file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed")
/* Check if driver matches driver information saved. Unfortunately, we can't push this
* function to each specific driver because we're checking if the driver is correct.
*/
if(!HDstrncmp(name, "NCSAfami", (size_t)8) && HDstrcmp(file->cls->name, "family"))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "family driver should be used")
if(!HDstrncmp(name, "NCSAmult", (size_t)8) && HDstrcmp(file->cls->name, "multi"))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "multi driver should be used")
/* Decode driver information */
if(H5FD__sb_decode(file, name, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode driver information")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_sb_decode() */
} /* end H5FD_sb_load() */
/*-------------------------------------------------------------------------

View File

@ -1067,7 +1067,7 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_core_t *file = (const H5FD_core_t*)_file;
@ -1092,7 +1092,7 @@ H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_core_t *file = (H5FD_core_t*)_file;
herr_t ret_value = SUCCEED; /* Return value */
@ -1126,7 +1126,7 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_core_t *file = (const H5FD_core_t*)_file;
@ -1214,7 +1214,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_core_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr,
H5FD_core_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_core_t *file = (H5FD_core_t*)_file;
@ -1274,7 +1274,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr,
H5FD_core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
size_t size, const void *buf)
{
H5FD_core_t *file = (H5FD_core_t*)_file;
@ -1300,7 +1300,7 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had
size_t new_eof;
/* Determine new size of memory buffer */
H5_ASSIGN_OVERFLOW(new_eof, file->increment * ((addr + size) / file->increment), hsize_t, size_t);
H5_CHECKED_ASSIGN(new_eof, size_t, file->increment * ((addr + size) / file->increment), hsize_t);
if((addr + size) % file->increment)
new_eof += file->increment;
@ -1355,7 +1355,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing)
H5FD_core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, unsigned H5_ATTR_UNUSED closing)
{
H5FD_core_t *file = (H5FD_core_t*)_file;
herr_t ret_value = SUCCEED; /* Return value */
@ -1453,7 +1453,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing)
H5FD_core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_core_t *file = (H5FD_core_t*)_file;
size_t new_eof; /* New size of memory buffer */
@ -1469,7 +1469,7 @@ H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing)
new_eof = file->eoa;
else { /* set eof to smallest multiple of increment that exceeds eoa */
/* Determine new size of memory buffer */
H5_ASSIGN_OVERFLOW(new_eof, file->increment * (file->eoa / file->increment), hsize_t, size_t);
H5_CHECKED_ASSIGN(new_eof, size_t, file->increment * (file->eoa / file->increment), hsize_t);
if(file->eoa % file->increment)
new_eof += file->increment;
} /* end else */

View File

@ -515,7 +515,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
file->fd = fd;
H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,h5_stat_size_t,haddr_t);
H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t);
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#ifdef H5_HAVE_WIN32_API
@ -706,7 +706,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_direct_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out */)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@ -745,7 +745,7 @@ H5FD_direct_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_direct_t *file = (const H5FD_direct_t*)_file;
@ -777,7 +777,7 @@ H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file;
@ -810,7 +810,7 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_direct_t *file = (const H5FD_direct_t*)_file;
@ -835,7 +835,7 @@ H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_direct_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
H5FD_direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
herr_t ret_value = SUCCEED;
@ -871,7 +871,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr,
H5FD_direct_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_direct_t *file = (H5FD_direct_t*)_file;
@ -1054,7 +1054,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr,
H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
size_t size, const void *buf)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file;
@ -1284,7 +1284,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing)
H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file;
herr_t ret_value = SUCCEED; /* Return value */

View File

@ -498,7 +498,7 @@ done:
*-------------------------------------------------------------------------
*/
static hsize_t
H5FD_family_sb_size(H5FD_t UNUSED *_file)
H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@ -572,7 +572,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned char *buf)
H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
uint64_t msize;
@ -587,26 +587,25 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha
* h5repart is being used to change member file size. h5repart will open
* files for read and write. When the files are closed, metadata will be
* flushed to the files and updated to this new size */
if(file->mem_newsize) {
if(file->mem_newsize)
file->memb_size = file->pmem_size = file->mem_newsize;
HGOTO_DONE(ret_value)
} /* end if */
else {
/* Default - use the saved member size */
if(file->pmem_size == H5F_FAMILY_DEFAULT)
file->pmem_size = msize;
/* Default - use the saved member size */
if(file->pmem_size == H5F_FAMILY_DEFAULT)
file->pmem_size = msize;
/* Check if member size from file access property is correct */
if(msize != file->pmem_size) {
char err_msg[128];
/* Check if member size from file access property is correct */
if(msize != file->pmem_size) {
char err_msg[128];
HDsnprintf(err_msg, sizeof(err_msg), "Family member size should be %lu. But the size from file access property is %lu", (unsigned long)msize, (unsigned long)file->pmem_size);
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, err_msg)
} /* end if */
HDsnprintf(err_msg, sizeof(err_msg), "Family member size should be %lu. But the size from file access property is %lu", (unsigned long)msize, (unsigned long)file->pmem_size);
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, err_msg)
} /* end if */
/* Update member file size to the size saved in the superblock.
* That's the size intended to be. */
file->memb_size = msize;
/* Update member file size to the size saved in the superblock.
* That's the size intended to be. */
file->memb_size = msize;
} /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
@ -686,14 +685,11 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
/* Check for new family file size. It's used by h5repart only. */
if(H5P_exist_plist(plist, H5F_ACS_FAMILY_NEWSIZE_NAME) > 0) {
hsize_t fam_newsize = 0; /* New member size, when repartitioning */
/* Get the new family file size */
if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &fam_newsize) < 0)
if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &file->mem_newsize) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get new family member size")
/* Store information for later */
file->mem_newsize = fam_newsize; /* New member size passed in through property */
/* Set flag for later */
file->repart_members = TRUE;
} /* end if */
@ -938,7 +934,7 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_family_t *file = (const H5FD_family_t*)_file;
@ -1170,7 +1166,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
/* Read from each member */
while(size > 0) {
H5_ASSIGN_OVERFLOW(u,addr /file->memb_size,hsize_t,unsigned);
H5_CHECKED_ASSIGN(u, unsigned, addr / file->memb_size, hsize_t);
sub = addr % file->memb_size;
@ -1239,7 +1235,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
/* Write to each member */
while (size>0) {
H5_ASSIGN_OVERFLOW(u,addr /file->memb_size,hsize_t,unsigned);
H5_CHECKED_ASSIGN(u, unsigned, addr / file->memb_size, hsize_t);
sub = addr % file->memb_size;

View File

@ -571,7 +571,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
file->fd = fd;
H5_ASSIGN_OVERFLOW(file->eof, sb.st_size, h5_stat_size_t, haddr_t);
H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t);
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#ifdef H5_HAVE_WIN32_API
@ -934,7 +934,7 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t size)
H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsize_t size)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
haddr_t addr;
@ -989,7 +989,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t siz
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_log_t *file = (const H5FD_log_t *)_file;
@ -1061,7 +1061,7 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_log_t *file = (const H5FD_log_t *)_file;
@ -1084,7 +1084,7 @@ H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_log_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void **file_handle)
H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
herr_t ret_value = SUCCEED;
@ -1118,7 +1118,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr,
H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr,
size_t size, void *buf/*out*/)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
@ -1315,7 +1315,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr,
H5FD_log_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_log_t *file = (H5FD_log_t *)_file;
@ -1515,7 +1515,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_log_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing)
H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */

View File

@ -995,7 +995,7 @@ done:
*/
static H5FD_t *
H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t UNUSED maxaddr)
haddr_t H5_ATTR_UNUSED maxaddr)
{
H5FD_mpio_t *file=NULL;
MPI_File fh;
@ -1212,7 +1212,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
H5FD_mpio_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags /* out */)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@ -1251,7 +1251,7 @@ H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
@ -1286,7 +1286,7 @@ H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
@ -1331,7 +1331,7 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file;
@ -1359,7 +1359,7 @@ H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle)
H5FD_mpio_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle)
{
H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
herr_t ret_value = SUCCEED;
@ -1445,7 +1445,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t addr, size_t size,
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_t *file = (H5FD_mpio_t*)_file;
@ -1946,7 +1946,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing)
H5FD_mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, unsigned closing)
{
H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
int mpi_code; /* mpi return code */
@ -1991,7 +1991,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing)
H5FD_mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
herr_t ret_value = SUCCEED;

View File

@ -109,7 +109,7 @@ H5_DLL herr_t H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, ha
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);
H5_DLL herr_t H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf);
H5_DLL herr_t H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf);
H5_DLL void *H5FD_fapl_get(H5FD_t *file);
H5_DLL herr_t H5FD_fapl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info);
H5_DLL herr_t H5FD_fapl_close(hid_t driver_id, void *fapl);

View File

@ -358,7 +358,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
file->fd = fd;
H5_ASSIGN_OVERFLOW(file->eof, sb.st_size, h5_stat_size_t, haddr_t);
H5_CHECKED_ASSIGN(file->eof, haddr_t, sb.st_size, h5_stat_size_t);
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
#ifdef H5_HAVE_WIN32_API
@ -568,7 +568,7 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file;
@ -593,7 +593,7 @@ H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
@ -621,7 +621,7 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file;
@ -644,7 +644,7 @@ H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_sec2_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void **file_handle)
H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
herr_t ret_value = SUCCEED;
@ -678,7 +678,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id,
H5FD_sec2_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_sec2_t *file = (H5FD_sec2_t *)_file;
@ -773,7 +773,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id,
H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED dxpl_id,
haddr_t addr, size_t size, const void *buf)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
@ -863,7 +863,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_sec2_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing)
H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */

View File

@ -608,7 +608,7 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, hsize_t size)
H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, hid_t /*H5_ATTR_UNUSED*/ dxpl_id, hsize_t size)
{
H5FD_stdio_t *file = (H5FD_stdio_t*)_file;
haddr_t addr;
@ -653,7 +653,7 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type)
H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type)
{
const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file;
@ -684,7 +684,7 @@ H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type)
*-------------------------------------------------------------------------
*/
static herr_t
H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr)
H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type, haddr_t addr)
{
H5FD_stdio_t *file = (H5FD_stdio_t*)_file;
@ -719,7 +719,7 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type)
H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*H5_ATTR_UNUSED*/ type)
{
const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file;

View File

@ -138,7 +138,7 @@ typedef struct H5FL_reg_head_t {
#else /* H5_NO_REG_FREE_LISTS */
#include "H5MMprivate.h"
/* Common macro for H5FL_DEFINE & H5FL_DEFINE_STATIC */
#define H5FL_DEFINE_COMMON(t) int UNUSED H5FL_REG_NAME(t)
#define H5FL_DEFINE_COMMON(t) int H5_ATTR_UNUSED H5FL_REG_NAME(t)
#define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t)
#define H5FL_EXTERN(t) H5_DLLVAR H5FL_DEFINE_COMMON(t)
@ -208,7 +208,7 @@ typedef struct H5FL_blk_head_t {
#else /* H5_NO_BLK_FREE_LISTS */
/* Common macro for H5FL_BLK_DEFINE & H5FL_BLK_DEFINE_STATIC */
#define H5FL_BLK_DEFINE_COMMON(t) int UNUSED H5FL_BLK_NAME(t)
#define H5FL_BLK_DEFINE_COMMON(t) int H5_ATTR_UNUSED H5FL_BLK_NAME(t)
#define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t)
#define H5FL_BLK_EXTERN(t) H5_DLLVAR H5FL_BLK_DEFINE_COMMON(t)
@ -337,7 +337,7 @@ typedef struct H5FL_seq_head_t {
#else /* H5_NO_SEQ_FREE_LISTS */
/* Common macro for H5FL_SEQ_DEFINE & H5FL_SEQ_DEFINE_STATIC */
#define H5FL_SEQ_DEFINE_COMMON(t) int UNUSED H5FL_SEQ_NAME(t)
#define H5FL_SEQ_DEFINE_COMMON(t) int H5_ATTR_UNUSED H5FL_SEQ_NAME(t)
#define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t)
#define H5FL_SEQ_EXTERN(t) H5_DLLVAR H5FL_SEQ_DEFINE_COMMON(t)

View File

@ -123,7 +123,7 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl
/*
* Allocate free space structure
*/
if(NULL == (fspace = H5FS_new(f, nclasses, classes, cls_init_udata)))
if(NULL == (fspace = H5FS__new(f, nclasses, classes, cls_init_udata)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space free list")
/* Initialize creation information for free space manager */
@ -161,7 +161,7 @@ HDfprintf(stderr, "%s: fspace = %p, fspace->addr = %a\n", FUNC, fspace, fspace->
done:
if(!ret_value && fspace)
if(H5FS_hdr_dest(fspace) < 0)
if(H5FS__hdr_dest(fspace) < 0)
HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space header")
#ifdef H5FS_DEBUG
@ -573,7 +573,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_va
/*-------------------------------------------------------------------------
* Function: H5FS_new
* Function: H5FS__new
*
* Purpose: Create new free space manager structure
*
@ -586,14 +586,14 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_va
*-------------------------------------------------------------------------
*/
H5FS_t *
H5FS_new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[],
H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[],
void *cls_init_udata)
{
H5FS_t *fspace = NULL; /* Free space manager */
size_t u; /* Local index variable */
H5FS_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/* Check arguments. */
HDassert(nclasses == 0 || (nclasses > 0 && classes));
@ -605,7 +605,7 @@ H5FS_new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space free list")
/* Set immutable free list parameters */
fspace->nclasses = nclasses;
H5_CHECKED_ASSIGN(fspace->nclasses, unsigned, nclasses, size_t);
if(nclasses > 0) {
if(NULL == (fspace->sect_cls = H5FL_SEQ_MALLOC(H5FS_section_class_t, nclasses)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space section class array")
@ -631,7 +631,7 @@ H5FS_new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[
/* Initialize non-zero information for new free space manager */
fspace->addr = HADDR_UNDEF;
fspace->hdr_size = H5FS_HEADER_SIZE(f);
fspace->hdr_size = (size_t)H5FS_HEADER_SIZE(f);
fspace->sect_addr = HADDR_UNDEF;
/* Set return value */
@ -649,7 +649,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS_new() */
} /* H5FS__new() */
/*-------------------------------------------------------------------------
@ -763,7 +763,7 @@ HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fsp
HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin free space header")
} /* end if */
else {
if(H5FS_hdr_dest(fspace) < 0)
if(H5FS__hdr_dest(fspace) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCLOSEOBJ, FAIL, "unable to destroy free space header")
} /* end else */
} /* end if */
@ -1005,7 +1005,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5FS_hdr_dest
* Function: H5FS__hdr_dest
*
* Purpose: Destroys a free space header in memory.
*
@ -1018,12 +1018,12 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5FS_hdr_dest(H5FS_t *fspace)
H5FS__hdr_dest(H5FS_t *fspace)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
FUNC_ENTER_PACKAGE
/*
* Check arguments.
@ -1047,7 +1047,7 @@ H5FS_hdr_dest(H5FS_t *fspace)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FS_hdr_dest() */
} /* end H5FS__hdr_dest() */
/*-------------------------------------------------------------------------
@ -1064,7 +1064,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_sinfo_free_sect_cb(void *_sect, void UNUSED *key, void *op_data)
H5FS_sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data)
{
H5FS_section_info_t *sect = (H5FS_section_info_t *)_sect; /* Section to free */
const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)op_data; /* Free space manager for section */
@ -1096,7 +1096,7 @@ H5FS_sinfo_free_sect_cb(void *_sect, void UNUSED *key, void *op_data)
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_sinfo_free_node_cb(void *item, void UNUSED *key, void *op_data)
H5FS_sinfo_free_node_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data)
{
H5FS_node_t *fspace_node = (H5FS_node_t *)item; /* Temporary pointer to free space list node */

View File

@ -38,7 +38,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5FSpkg.h" /* File free space */
#include "H5MFprivate.h" /* File memory management */
#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5VMprivate.h" /* Vectors and arrays */
#include "H5WBprivate.h" /* Wrapped Buffers */
/****************/
@ -75,17 +75,17 @@ typedef struct {
/********************/
/* Section info routines */
static herr_t H5FS_sinfo_serialize_sect_cb(void *_item, void UNUSED *key, void *_udata);
static herr_t H5FS_sinfo_serialize_node_cb(void *_item, void UNUSED *key, void *_udata);
static herr_t H5FS_sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata);
static herr_t H5FS_sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata);
/* Metadata cache callbacks */
static H5FS_t *H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
static herr_t H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned UNUSED * flags_ptr);
static herr_t H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned H5_ATTR_UNUSED * flags_ptr);
static herr_t H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace);
static herr_t H5FS_cache_hdr_clear(H5F_t *f, H5FS_t *fspace, hbool_t destroy);
static herr_t H5FS_cache_hdr_size(const H5F_t *f, const H5FS_t *fspace, size_t *size_ptr);
static H5FS_sinfo_t *H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
static herr_t H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned UNUSED * flags_ptr);
static herr_t H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned H5_ATTR_UNUSED * flags_ptr);
static herr_t H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo);
static herr_t H5FS_cache_sinfo_clear(H5F_t *f, H5FS_sinfo_t *sinfo, hbool_t destroy);
static herr_t H5FS_cache_sinfo_size(const H5F_t *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr);
@ -167,7 +167,7 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
HDassert(udata);
/* Allocate a new free space manager */
if(NULL == (fspace = H5FS_new(udata->f, udata->nclasses, udata->classes, udata->cls_init_udata)))
if(NULL == (fspace = H5FS__new(udata->f, udata->nclasses, udata->classes, udata->cls_init_udata)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set free space manager's internal information */
@ -260,7 +260,7 @@ done:
if(wb && H5WB_unwrap(wb) < 0)
HDONE_ERROR(H5E_FSPACE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer")
if(!ret_value && fspace)
if(H5FS_hdr_dest(fspace) < 0)
if(H5FS__hdr_dest(fspace) < 0)
HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space header")
FUNC_LEAVE_NOAPI(ret_value)
@ -281,7 +281,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned UNUSED * flags_ptr)
H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned H5_ATTR_UNUSED * flags_ptr)
{
H5WB_t *wb = NULL; /* Wrapped buffer for header data */
uint8_t hdr_buf[H5FS_HDR_BUF_SIZE]; /* Buffer for header */
@ -463,7 +463,7 @@ H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace)
} /* end if */
/* Destroy free space header */
if(H5FS_hdr_dest(fspace) < 0)
if(H5FS__hdr_dest(fspace) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header")
done:
@ -524,7 +524,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_ptr)
H5FS_cache_hdr_size(const H5F_t H5_ATTR_UNUSED *f, const H5FS_t *fspace, size_t *size_ptr)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@ -555,7 +555,7 @@ H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_pt
*-------------------------------------------------------------------------
*/
static H5FS_sinfo_t *
H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void *_udata)
{
H5FS_sinfo_t *sinfo = NULL; /* Free space section info */
H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* user data for callback */
@ -578,7 +578,7 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Allocate space for the buffer to serialize the sections into */
H5_ASSIGN_OVERFLOW(/* To: */ old_sect_size, /* From: */ udata->fspace->sect_size, /* From: */ hsize_t, /* To: */ size_t);
H5_CHECKED_ASSIGN(old_sect_size, size_t, udata->fspace->sect_size, hsize_t);
if(NULL == (buf = H5FL_BLK_MALLOC(sect_block, (size_t)udata->fspace->sect_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@ -717,7 +717,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_sinfo_serialize_sect_cb(void *_item, void UNUSED *key, void *_udata)
H5FS_sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
{
H5FS_section_class_t *sect_cls; /* Class of section */
H5FS_section_info_t *sect= (H5FS_section_info_t *)_item; /* Free space section to work on */
@ -773,7 +773,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_sinfo_serialize_node_cb(void *_item, void UNUSED *key, void *_udata)
H5FS_sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
{
H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */
H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */
@ -819,7 +819,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned UNUSED * flags_ptr)
H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned H5_ATTR_UNUSED * flags_ptr)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -865,14 +865,12 @@ H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H
udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count);
/* Iterate over all the bins */
for(bin = 0; bin < sinfo->nbins; bin++) {
for(bin = 0; bin < sinfo->nbins; bin++)
/* Check if there are any sections in this bin */
if(sinfo->bins[bin].bin_list) {
if(sinfo->bins[bin].bin_list)
/* Iterate over list of section size nodes for bin */
if(H5SL_iterate(sinfo->bins[bin].bin_list, H5FS_sinfo_serialize_node_cb, &udata) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes")
} /* end if */
} /* end for */
/* Compute checksum */
metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0);
@ -1029,7 +1027,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_cache_sinfo_size(const H5F_t UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr)
H5FS_cache_sinfo_size(const H5F_t H5_ATTR_UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@ -1038,7 +1036,7 @@ H5FS_cache_sinfo_size(const H5F_t UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *
HDassert(size_ptr);
/* Set size value */
H5_ASSIGN_OVERFLOW(/* To: */ *size_ptr, /* From: */ sinfo->fspace->alloc_sect_size, /* From: */ hsize_t, /* To: */ size_t);
H5_CHECKED_ASSIGN(*size_ptr, size_t, sinfo->fspace->alloc_sect_size, hsize_t);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5FS_cache_sinfo_size() */

View File

@ -232,7 +232,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, int indent, int fwidth,
H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, 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 */

View File

@ -221,7 +221,7 @@ H5FL_EXTERN(H5FS_t);
/******************************/
/* Free space manager header routines */
H5_DLL H5FS_t *H5FS_new(const H5F_t *f, uint16_t nclasses,
H5_DLL H5FS_t *H5FS__new(const H5F_t *f, uint16_t nclasses,
const H5FS_section_class_t *classes[], void *cls_init_udata);
H5_DLL herr_t H5FS_incr(H5FS_t *fspace);
H5_DLL herr_t H5FS_decr(H5FS_t *fspace);
@ -231,7 +231,7 @@ H5_DLL herr_t H5FS_dirty(H5FS_t *fspace);
H5_DLL H5FS_sinfo_t *H5FS_sinfo_new(H5F_t *f, H5FS_t *fspace);
/* Routines for destroying structures */
H5_DLL herr_t H5FS_hdr_dest(H5FS_t *hdr);
H5_DLL herr_t H5FS__hdr_dest(H5FS_t *hdr);
H5_DLL herr_t H5FS_sinfo_dest(H5FS_sinfo_t *sinfo);
/* Sanity check routines */

View File

@ -1895,7 +1895,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_iterate_sect_cb(void *_item, void UNUSED *key, void *_udata)
H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
{
H5FS_section_info_t *sect_info = (H5FS_section_info_t *)_item; /* Free space section to work on */
H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */
@ -1933,7 +1933,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5FS_iterate_node_cb(void *_item, void UNUSED *key, void *_udata)
H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
{
H5FS_node_t *fspace_node = (H5FS_node_t *)_item; /* Free space size node to work on */
H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */

View File

@ -172,7 +172,7 @@ H5F__accum_read(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr,
/* Read the part before the metadata accumulator */
if(addr < accum->loc) {
/* Set the amount to read */
H5_ASSIGN_OVERFLOW(amount_before, (accum->loc - addr), hsize_t, size_t);
H5_CHECKED_ASSIGN(amount_before, size_t, (accum->loc - addr), hsize_t);
/* Make room for the metadata to read in */
HDmemmove(accum->buf + amount_before, accum->buf, accum->size);
@ -193,7 +193,7 @@ H5F__accum_read(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr,
size_t amount_after; /* Amount to read at a time */
/* Set the amount to read */
H5_ASSIGN_OVERFLOW(amount_after, ((addr + size) - (accum->loc + accum->size)), hsize_t, size_t);
H5_CHECKED_ASSIGN(amount_after, size_t, ((addr + size) - (accum->loc + accum->size)), hsize_t);
/* Dispatch to driver */
if(H5FD_read(fio_info->f->shared->lf, fio_info->dxpl, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0)
@ -536,14 +536,14 @@ H5F__accum_write(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr,
size_t old_offset; /* Offset of old data within the accumulator buffer */
/* Calculate the amount we will need to add to the accumulator size, based on the amount of overlap */
H5_ASSIGN_OVERFLOW(add_size, (accum->loc - addr), hsize_t, size_t);
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, fio_info, 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 */
H5_ASSIGN_OVERFLOW(old_offset, (addr + size) - accum->loc, hsize_t, size_t);
H5_CHECKED_ASSIGN(old_offset, size_t, (addr + size) - accum->loc, hsize_t);
/* Move the existing metadata to the proper location */
HDmemmove(accum->buf + size, accum->buf + old_offset, (accum->size - old_offset));
@ -576,7 +576,7 @@ H5F__accum_write(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr,
size_t dirty_off; /* Offset of dirty region */
/* Calculate the amount we will need to add to the accumulator size, based on the amount of overlap */
H5_ASSIGN_OVERFLOW(add_size, (addr + size) - (accum->loc + accum->size), hsize_t, size_t);
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, fio_info, H5F_ACCUM_APPEND, add_size) < 0)
@ -845,7 +845,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t UNUSED type, haddr_t addr,
H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr,
hsize_t size)
{
H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */
@ -885,7 +885,7 @@ H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t UNUSED type, haddr_t a
size_t new_accum_size; /* Size of new accumulator buffer */
/* Calculate the size of the overlap with the accumulator, etc. */
H5_ASSIGN_OVERFLOW(overlap_size, (addr + size) - accum->loc, haddr_t, size_t);
H5_CHECKED_ASSIGN(overlap_size, size_t, (addr + size) - accum->loc, haddr_t);
new_accum_size = accum->size - overlap_size;
/* Move the accumulator buffer information to eliminate the freed block */
@ -919,7 +919,7 @@ H5F__accum_free(const H5F_io_info_t *fio_info, H5FD_mem_t UNUSED type, haddr_t a
haddr_t dirty_start = accum->loc + accum->dirty_off;
/* Calculate the size of the overlap with the accumulator */
H5_ASSIGN_OVERFLOW(overlap_size, (accum->loc + accum->size) - addr, haddr_t, size_t);
H5_CHECKED_ASSIGN(overlap_size, size_t, (accum->loc + accum->size) - addr, haddr_t);
/* Check if block to free begins before end of dirty region */
if(accum->dirty && H5F_addr_lt(addr, dirty_end)) {

View File

@ -181,7 +181,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo)
HDmemset(finfo, 0, sizeof(*finfo));
/* Get the size of the superblock extension */
if(H5F_super_size(f, H5AC_ind_dxpl_id, NULL, &finfo->super_ext_size) < 0)
if(H5F__super_size(f, H5AC_ind_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 */

View File

@ -857,14 +857,6 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close property list")
/* Only truncate the file on an orderly close, with write-access */
if(f->closing && (H5F_ACC_RDWR & H5F_INTENT(f))) {
/* Truncate the file to the current allocated size */
if(H5FD_truncate(f->shared->lf, dxpl_id, (unsigned)TRUE) < 0)
/* Push error, but keep going*/
HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed")
} /* end if */
/* Close the file */
if(H5FD_close(f->shared->lf) < 0)
/* Push error, but keep going*/
@ -1074,7 +1066,7 @@ 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, dxpl_id) < 0)
if(H5F__super_init(file, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to allocate file superblock")
/* Create and open the root group */
@ -1085,7 +1077,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/open root group")
} else if (1 == shared->nrefs) {
/* Read the superblock if it hasn't been read before. */
if(H5F_super_read(file, dxpl_id) < 0)
if(H5F__super_read(file, dxpl_id) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
/* Open the root group */
@ -1182,6 +1174,15 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing)
/* Push error, but keep going*/
HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache")
/* Truncate the file to the current allocated size */
if(H5FD_truncate(f->shared->lf, dxpl_id, closing) < 0)
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, dxpl_id) < 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.dxpl = (H5P_genplist_t *)H5I_object(dxpl_id)))
@ -2049,3 +2050,66 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_get_file_image() */
/*-------------------------------------------------------------------------
* Function: H5F__set_base_addr
*
* Purpose: Quick and dirty routine to set the file's 'base_addr' value
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol <koziol@hdfgroup.org>
* July 19, 2013
*
*-------------------------------------------------------------------------
*/
herr_t
H5F__set_base_addr(const H5F_t *f, haddr_t addr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
HDassert(f);
HDassert(f->shared);
/* Dispatch to driver */
if(H5FD_set_base_addr(f->shared->lf, addr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_base_addr request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__set_base_addr() */
/*-------------------------------------------------------------------------
* Function: H5F__set_eoa
*
* Purpose: Quick and dirty routine to set the file's 'eoa' value
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol <koziol@hdfgroup.org>
* July 19, 2013
*
*-------------------------------------------------------------------------
*/
herr_t
H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
HDassert(f);
HDassert(f->shared);
/* Dispatch to driver */
if(H5FD_set_eoa(f->shared->lf, type, addr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "driver set_eoa request failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__set_eoa() */

View File

@ -128,7 +128,7 @@ done:
*/
static herr_t
H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child,
hid_t UNUSED plist_id, hid_t dxpl_id)
hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id)
{
H5G_t *mount_point = NULL; /*mount point group */
H5F_t *ancestor = NULL; /*ancestor files */

View File

@ -89,34 +89,34 @@
+ 1 /* reserved */ \
+ 4 /* group leaf k, group internal k */ \
+ 4) /* consistency flags */
#define H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) \
#define H5F_SUPERBLOCK_VARLEN_SIZE_V0(sizeof_addr, sizeof_size) \
( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \
+ H5F_SIZEOF_ADDR(f) /* base address */ \
+ H5F_SIZEOF_ADDR(f) /* <unused> */ \
+ H5F_SIZEOF_ADDR(f) /* EOF address */ \
+ H5F_SIZEOF_ADDR(f) /* driver block address */ \
+ H5G_SIZEOF_ENTRY(f)) /* root group ptr */
#define H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) \
+ (sizeof_addr) /* base address */ \
+ (sizeof_addr) /* <unused> */ \
+ (sizeof_addr) /* EOF address */ \
+ (sizeof_addr) /* driver block address */ \
+ H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */
#define H5F_SUPERBLOCK_VARLEN_SIZE_V1(sizeof_addr, sizeof_size) \
( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \
+ 2 /* indexed B-tree internal k */ \
+ 2 /* reserved */ \
+ H5F_SIZEOF_ADDR(f) /* base address */ \
+ H5F_SIZEOF_ADDR(f) /* <unused> */ \
+ H5F_SIZEOF_ADDR(f) /* EOF address */ \
+ H5F_SIZEOF_ADDR(f) /* driver block address */ \
+ H5G_SIZEOF_ENTRY(f)) /* root group ptr */
#define H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) \
+ (sizeof_addr) /* base address */ \
+ (sizeof_addr) /* <unused> */ \
+ (sizeof_addr) /* EOF address */ \
+ (sizeof_addr) /* driver block address */ \
+ H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */
#define H5F_SUPERBLOCK_VARLEN_SIZE_V2(sizeof_addr) \
( 2 /* size of address, size of lengths */ \
+ 1 /* consistency flags */ \
+ H5F_SIZEOF_ADDR(f) /* base address */ \
+ H5F_SIZEOF_ADDR(f) /* superblock extension address */ \
+ H5F_SIZEOF_ADDR(f) /* EOF address */ \
+ H5F_SIZEOF_ADDR(f) /* root group object header address */ \
+ (sizeof_addr) /* base address */ \
+ (sizeof_addr) /* superblock extension address */ \
+ (sizeof_addr) /* EOF address */ \
+ (sizeof_addr) /* root group object header address */ \
+ H5F_SIZEOF_CHKSUM) /* superblock checksum (keep this last) */
#define H5F_SUPERBLOCK_VARLEN_SIZE(v, f) ( \
(v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) : 0) \
+ (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) : 0) \
+ (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) : 0))
(v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) : 0) \
+ (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) : 0) \
+ (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(H5F_SIZEOF_ADDR(f)) : 0))
/* Total size of superblock, depends on superblock version */
#define H5F_SUPERBLOCK_SIZE(v, f) ( H5F_SUPERBLOCK_FIXED_SIZE \
@ -306,10 +306,10 @@ 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 dxpl_id);
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_free(H5F_super_t *sblock);
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 dxpl_id);
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_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);
@ -340,6 +340,10 @@ 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);
/* 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);
H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr);
/* Testing functions */
#ifdef H5F_TESTING
H5_DLL herr_t H5F_get_sohm_mesg_count_test(hid_t fid, unsigned type_id,

View File

@ -244,7 +244,6 @@
#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \
HADDR_UNDEF==(X)+(haddr_t)(Z) || \
(X)+(haddr_t)(Z)<(X))
#define H5F_addr_hash(X,M) ((unsigned)((X)%(M)))
#define H5F_addr_defined(X) ((X)!=HADDR_UNDEF)
/* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making
* certain that X is not HADDR_UNDEF and then checking that X equals Y
@ -395,13 +394,13 @@
*/
#if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T)
# define H5F_OVERFLOW_SIZET2OFFT(X) \
((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(off_t)-1)))
((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(HDoff_t)-1)))
#else
# define H5F_OVERFLOW_SIZET2OFFT(X) 0
#endif
#if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T)
# define H5F_OVERFLOW_HSIZET2OFFT(X) \
((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(off_t)-1)))
((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(HDoff_t)-1)))
#else
# define H5F_OVERFLOW_HSIZET2OFFT(X) 0
#endif

View File

@ -237,7 +237,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F_super_read
* Function: H5F__super_read
*
* Purpose: Reads the superblock from the file or from the BUF. If
* ADDR is a valid address, then it reads it from the file.
@ -254,17 +254,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F_super_read(H5F_t *f, hid_t dxpl_id)
H5F__super_read(H5F_t *f, hid_t dxpl_id)
{
H5P_genplist_t *dxpl; /* DXPL object */
H5F_super_t * sblock = NULL; /* superblock structure */
H5F_super_t * sblock = NULL; /* Superblock structure */
unsigned sblock_flags = H5AC__NO_FLAGS_SET; /* flags used in superblock unprotect call */
haddr_t super_addr; /* Absolute address of superblock */
H5AC_protect_t rw; /* read/write permissions for file */
H5AC_protect_t rw; /* Read/write permissions for file */
hbool_t dirtied = FALSE; /* Bool for sblock protect call */
herr_t ret_value = SUCCEED; /* return value */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL)
FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL)
/* Get the DXPL plist object for DXPL ID */
if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id)))
@ -279,7 +279,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id)
/* Check for userblock present */
if(H5F_addr_gt(super_addr, 0)) {
/* Set the base address for the file in the VFD now */
if(H5FD_set_base_addr(f->shared->lf, super_addr) < 0)
if(H5F__set_base_addr(f, super_addr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "failed to set base address for file driver")
} /* end if */
@ -291,7 +291,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id)
/* Look up the superblock */
if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &dirtied, rw)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "unable to load superblock")
HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock")
/* Mark the superblock dirty if it was modified during loading or VFD indicated to do so */
if((H5AC_WRITE == rw) && (dirtied || H5F_HAS_FEATURE(f, H5FD_FEAT_DIRTY_SBLK_LOAD)))
@ -299,7 +299,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id)
/* Pin the superblock in the cache */
if(H5AC_pin_protected_entry(sblock) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTPIN, FAIL, "unable to pin superblock")
HGOTO_ERROR(H5E_FILE, H5E_CANTPIN, FAIL, "unable to pin superblock")
/* Set the pointer to the pinned superblock */
f->shared->sblock = sblock;
@ -307,14 +307,14 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id)
done:
/* Release the superblock */
if(sblock && H5AC_unprotect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0)
HDONE_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock")
HDONE_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock")
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
} /* end H5F_super_read() */
} /* end H5F__super_read() */
/*-------------------------------------------------------------------------
* Function: H5F_super_init
* Function: H5F__super_init
*
* Purpose: Allocates the superblock for the file and initializes
* information about the superblock in memory. Writes extension
@ -330,7 +330,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F_super_init(H5F_t *f, hid_t dxpl_id)
H5F__super_init(H5F_t *f, hid_t dxpl_id)
{
H5F_super_t *sblock = NULL; /* Superblock cache structure */
hbool_t sblock_in_cache = FALSE; /* Whether the superblock has been inserted into the metadata cache */
@ -344,7 +344,7 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id)
hbool_t ext_created = FALSE; /* Whether the extension has been created */
herr_t ret_value = SUCCEED; /* Return Value */
FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL)
FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL)
/* Allocate space for the superblock */
if(NULL == (sblock = H5FL_CALLOC(H5F_super_t)))
@ -418,13 +418,13 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id)
sblock->status_flags = 0;
/* Reserve space for the userblock */
if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, userblock_size) < 0)
if(H5F__set_eoa(f, H5FD_MEM_SUPER, userblock_size) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to set EOA value for userblock")
/* Set the base address for the file in the VFD now, after allocating
* space for userblock.
*/
if(H5FD_set_base_addr(f->shared->lf, sblock->base_addr) < 0)
if(H5F__set_base_addr(f, sblock->base_addr) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "failed to set base address for file driver")
/* Save a local copy of the superblock version number */
@ -434,7 +434,7 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id)
superblock_size = (hsize_t)H5F_SUPERBLOCK_SIZE(super_vers, f);
/* Compute the size of the driver information block */
H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t);
H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t);
if(driver_size > 0) {
driver_size += H5F_DRVINFOBLOCK_HDR_SIZE;
@ -455,7 +455,7 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id)
superblock_size += driver_size;
/* Reserve space in the file for the superblock, instead of allocating it */
if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_SUPER, superblock_size) < 0)
if(H5F__set_eoa(f, H5FD_MEM_SUPER, superblock_size) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to set EOA value for superblock")
/* Insert superblock into cache, pinned */
@ -594,7 +594,7 @@ done:
} /* end if */
else
/* Free superblock */
if(H5F_super_free(sblock) < 0)
if(H5F__super_free(sblock) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to destroy superblock")
/* Reset variables in file structure */
@ -603,7 +603,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
} /* end H5F_super_init() */
} /* end H5F__super_init() */
/*-------------------------------------------------------------------------
@ -641,7 +641,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5F_super_free
* Function: H5F__super_free
*
* Purpose: Destroyer the file's superblock
*
@ -654,9 +654,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
H5F_super_free(H5F_super_t *sblock)
H5F__super_free(H5F_super_t *sblock)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(sblock);
@ -668,11 +668,11 @@ H5F_super_free(H5F_super_t *sblock)
sblock = (H5F_super_t *)H5FL_FREE(H5F_super_t, sblock);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5F_super_free() */
} /* H5F__super_free() */
/*-------------------------------------------------------------------------
* Function: H5F_super_size
* Function: H5F__super_size
*
* Purpose: Get storage size of the superblock and superblock extension
*
@ -685,11 +685,11 @@ 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, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(f);
@ -725,7 +725,7 @@ H5F_super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5F_super_size() */
} /* H5F__super_size() */
/*-------------------------------------------------------------------------

View File

@ -13,6 +13,17 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------
*
* Created: H5Fsuper_cache.c
* Aug 15 2009
* Quincey Koziol <koziol@hdfgroup.org>
*
* Purpose: Implement file superblock & driver info metadata cache methods.
*
*-------------------------------------------------------------------------
*/
/****************/
/* Module Setup */
/****************/
@ -111,7 +122,7 @@ H5FL_EXTERN(H5F_super_t);
*-------------------------------------------------------------------------
*/
static H5F_super_t *
H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, void *_udata)
{
H5F_super_t *sblock = NULL; /* File's superblock */
haddr_t base_addr = HADDR_UNDEF; /* Base address of file */
@ -133,7 +144,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
FUNC_ENTER_NOAPI_NOINIT
/* check arguments */
/* Check arguments */
HDassert(f);
HDassert(H5F_addr_eq(addr, 0));
HDassert(dirtied);
@ -371,14 +382,6 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
drv_name[8] = '\0';
p += 8; /* advance past name/version */
/* Check if driver matches driver information saved. Unfortunately, we can't push this
* function to each specific driver because we're checking if the driver is correct.
*/
if(!HDstrncmp(drv_name, "NCSAfami", (size_t)8) && HDstrcmp(lf->cls->name, "family"))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "family driver should be used")
if(!HDstrncmp(drv_name, "NCSAmult", (size_t)8) && HDstrcmp(lf->cls->name, "multi"))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "multi driver should be used")
/* Read in variable-sized portion of driver info block */
if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, sblock->driver_addr + H5F_DRVINFOBLOCK_HDR_SIZE + drv_variable_size) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "set end of space allocation request failed")
@ -386,7 +389,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read file driver information")
/* Decode driver information */
if(H5FD_sb_decode(lf, drv_name, p) < 0)
if(H5FD_sb_load(lf, drv_name, p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to decode driver information")
} /* end if */
} /* end if */
@ -535,16 +538,8 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo, dxpl_id))
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "driver info message not present")
/* Check if driver matches driver information saved. Unfortunately, we can't push this
* function to each specific driver because we're checking if the driver is correct.
*/
if(!HDstrncmp(drvinfo.name, "NCSAfami", (size_t)8) && HDstrcmp(lf->cls->name, "family"))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "family driver should be used")
if(!HDstrncmp(drvinfo.name, "NCSAmult", (size_t)8) && HDstrcmp(lf->cls->name, "multi"))
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "multi driver should be used")
/* Decode driver information */
if(H5FD_sb_decode(lf, drvinfo.name, drvinfo.buf) < 0)
if(H5FD_sb_load(lf, drvinfo.name, drvinfo.buf) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to decode driver information")
/* Reset driver info message */
@ -618,7 +613,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata)
done:
/* Release the [possibly partially initialized] superblock on errors */
if(!ret_value && sblock)
if(H5F_super_free(sblock) < 0)
if(H5F__super_free(sblock) < 0)
HDONE_ERROR(H5E_FILE, H5E_CANTFREE, NULL, "unable to destroy superblock data")
FUNC_LEAVE_NOAPI(ret_value)
@ -640,7 +635,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr,
H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t H5_ATTR_UNUSED addr,
H5F_super_t *sblock)
{
herr_t ret_value = SUCCEED;
@ -723,7 +718,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr,
HGOTO_ERROR(H5E_FILE, H5E_CANTENCODE, FAIL, "can't encode root group symbol table entry")
/* Encode the driver information block. */
H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t);
H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t);
/* Checking whether driver block address is defined here is to handle backward
* compatibility. If the file was created with v1.6 library or earlier and no
@ -779,7 +774,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr,
* ultimately match it. */
if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
H5F_addr_encode(f, &p, rel_eof + sblock->base_addr);
H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr));
/* Retrieve information for root group */
if(NULL == (root_oloc = H5G_oloc(f->shared->root_grp)))
@ -799,7 +794,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr,
} /* end else */
/* Retrieve the total size of the superblock info */
H5_ASSIGN_OVERFLOW(superblock_size, (p - buf), ptrdiff_t, size_t);
H5_CHECKED_ASSIGN(superblock_size, size_t, (p - buf), ptrdiff_t);
/* Double check we didn't overrun the block (unlikely) */
HDassert(superblock_size <= sizeof(buf));
@ -824,7 +819,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr,
/* Check for ignoring the driver info for this file */
if(!H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) {
/* Check for driver info message */
H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t);
H5_CHECKED_ASSIGN(driver_size, size_t, H5FD_sb_size(f->shared->lf), hsize_t);
if(driver_size > 0) {
H5O_drvinfo_t drvinfo; /* Driver info */
uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */
@ -877,7 +872,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
H5F_sblock_dest(H5F_t UNUSED *f, H5F_super_t* sblock)
H5F_sblock_dest(H5F_t H5_ATTR_UNUSED *f, H5F_super_t* sblock)
{
herr_t ret_value = SUCCEED; /* Return value */
@ -887,7 +882,7 @@ H5F_sblock_dest(H5F_t UNUSED *f, H5F_super_t* sblock)
HDassert(sblock);
/* Free superblock */
if(H5F_super_free(sblock) < 0)
if(H5F__super_free(sblock) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to destroy superblock")
done:

Some files were not shown because too many files have changed in this diff Show More