summaryrefslogtreecommitdiffstats
path: root/tests/auto/qitemeditorfactory
Commit message (Expand)AuthorAgeFilesLines
* Update license headers again.Jason McDonald2009-09-091-4/+4
* Update tech preview license header.Jason McDonald2009-08-311-13/+13
* Update license headers.Jason McDonald2009-08-111-1/+1
* Fixed compile of tst_qitemeditorfactory.Rohan McGovern2009-07-281-5/+5
* QItemEditorFactory: made sure the ownership is taken on theThierry Bastian2009-06-181-7/+31
* Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
* Remove obsolete code from autotests.Jason McDonald2009-04-161-4/+0
* Long live Qt 4.5!Lars Knoll2009-03-233-0/+89
submit' value='search'/>
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-08-06 20:56:04 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2020-08-22 19:00:44 (GMT)
commitba087ce2b56163dd47827327d492798fb9899562 (patch)
tree8c456e0a9752b99adfc4b3f33f99a69e6d6f2f01 /src
parent2ab6012bc455571645d125eac60d59208eca4dd9 (diff)
downloadhdf5-ba087ce2b56163dd47827327d492798fb9899562.zip
hdf5-ba087ce2b56163dd47827327d492798fb9899562.tar.gz
hdf5-ba087ce2b56163dd47827327d492798fb9899562.tar.bz2
Clean up private / package / static namespace issues (function naming, which
header file, FUNC_ENTER / LEAVE, etc). Removed remaining personal email addresses from library source code (still needs cleaned from other directories). Misc. warning, style, and whitespace cleanup.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/H5.c24
-rw-r--r--src/H5AC.c16
-rw-r--r--src/H5ACdbg.c6
-rw-r--r--src/H5ACmodule.h2
-rw-r--r--src/H5ACmpio.c3
-rw-r--r--src/H5ACprivate.h2
-rw-r--r--src/H5ACpublic.h4
-rw-r--r--src/H5Abtree2.c3
-rw-r--r--src/H5Adense.c14
-rw-r--r--src/H5Adeprec.c2
-rw-r--r--src/H5Aint.c5
-rw-r--r--src/H5Amodule.h2
-rw-r--r--src/H5Apkg.h3
-rw-r--r--src/H5B.c14
-rw-r--r--src/H5B2.c3
-rw-r--r--src/H5B2cache.c24
-rw-r--r--src/H5B2dbg.c5
-rw-r--r--src/H5B2hdr.c7
-rw-r--r--src/H5B2int.c16
-rw-r--r--src/H5B2internal.c12
-rw-r--r--src/H5B2leaf.c16
-rw-r--r--src/H5B2module.h2
-rw-r--r--src/H5B2stat.c2
-rw-r--r--src/H5B2test.c2
-rw-r--r--src/H5Bcache.c7
-rw-r--r--src/H5C.c532
-rw-r--r--src/H5CS.c4
-rw-r--r--src/H5CX.c2
-rw-r--r--src/H5Cdbg.c68
-rw-r--r--src/H5Cimage.c48
-rw-r--r--src/H5Cmodule.h2
-rw-r--r--src/H5Cpkg.h2
-rw-r--r--src/H5Cprivate.h3
-rw-r--r--src/H5Cpublic.h2
-rw-r--r--src/H5Dbtree.c7
-rw-r--r--src/H5Dbtree2.c17
-rw-r--r--src/H5Dchunk.c147
-rw-r--r--src/H5Dcompact.c2
-rw-r--r--src/H5Dcontig.c2
-rw-r--r--src/H5Ddeprec.c2
-rw-r--r--src/H5Dearray.c4
-rw-r--r--src/H5Defl.c5
-rw-r--r--src/H5Dfarray.c4
-rw-r--r--src/H5Dfill.c4
-rw-r--r--src/H5Dint.c18
-rw-r--r--src/H5Dmpio.c38
-rw-r--r--src/H5Dnone.c2
-rw-r--r--src/H5Dpkg.h5
-rw-r--r--src/H5Dsingle.c2
-rw-r--r--src/H5Dtest.c2
-rw-r--r--src/H5Dvirtual.c4
-rw-r--r--src/H5E.c12
-rw-r--r--src/H5EA.c17
-rw-r--r--src/H5EAcache.c31
-rw-r--r--src/H5EAdblkpage.c7
-rw-r--r--src/H5EAdblock.c11
-rw-r--r--src/H5EAhdr.c22
-rw-r--r--src/H5EAiblock.c34
-rw-r--r--src/H5EAint.c4
-rw-r--r--src/H5EApkg.h2
-rw-r--r--src/H5EAsblock.c2
-rw-r--r--src/H5EAstat.c7
-rw-r--r--src/H5EAtest.c4
-rw-r--r--src/H5Edeprec.c2
-rw-r--r--src/H5Eint.c2
-rw-r--r--src/H5Emodule.h2
-rw-r--r--src/H5Epkg.h2
-rw-r--r--src/H5FA.c9
-rw-r--r--src/H5FAcache.c18
-rw-r--r--src/H5FAdbg.c2
-rw-r--r--src/H5FAhdr.c4
-rw-r--r--src/H5FAint.c2
-rw-r--r--src/H5FAmodule.h2
-rw-r--r--src/H5FAstat.c6
-rw-r--r--src/H5FAtest.c2
-rw-r--r--src/H5FDcore.c37
-rw-r--r--src/H5FDcore.h2
-rw-r--r--src/H5FDdirect.c265
-rw-r--r--src/H5FDdirect.h2
-rw-r--r--src/H5FDdrvr_module.h2
-rw-r--r--src/H5FDfamily.c312
-rw-r--r--src/H5FDfamily.h2
-rw-r--r--src/H5FDhdfs.c1313
-rw-r--r--src/H5FDhdfs.h11
-rw-r--r--src/H5FDlog.c256
-rw-r--r--src/H5FDlog.h2
-rw-r--r--src/H5FDmirror.c878
-rw-r--r--src/H5FDmirror.h292
-rw-r--r--src/H5FDmirror_priv.h323
-rw-r--r--src/H5FDmodule.h2
-rw-r--r--src/H5FDmpi.c33
-rw-r--r--src/H5FDmpi.h2
-rw-r--r--src/H5FDmpio.c2
-rw-r--r--src/H5FDmpio.h2
-rw-r--r--src/H5FDmulti.c21
-rw-r--r--src/H5FDmulti.h2
-rw-r--r--src/H5FDpkg.h2
-rw-r--r--src/H5FDprivate.h2
-rw-r--r--src/H5FDpublic.h2
-rw-r--r--src/H5FDros3.c728
-rw-r--r--src/H5FDs3comms.c1705
-rw-r--r--src/H5FDsec2.c187
-rw-r--r--src/H5FDsec2.h2
-rw-r--r--src/H5FDspace.c14
-rw-r--r--src/H5FDsplitter.c774
-rw-r--r--src/H5FDstdio.c2
-rw-r--r--src/H5FDstdio.h2
-rw-r--r--src/H5FDtest.c1
-rw-r--r--src/H5FDwindows.h4
-rw-r--r--src/H5FL.c2
-rw-r--r--src/H5FLmodule.h2
-rw-r--r--src/H5FLprivate.h4
-rw-r--r--src/H5FS.c11
-rw-r--r--src/H5FScache.c12
-rw-r--r--src/H5FSdbg.c2
-rw-r--r--src/H5FSint.c2
-rw-r--r--src/H5FSmodule.h2
-rw-r--r--src/H5FSpkg.h2
-rw-r--r--src/H5FSprivate.h2
-rw-r--r--src/H5FSsection.c147
-rw-r--r--src/H5Faccum.c18
-rw-r--r--src/H5Fcwfs.c2
-rw-r--r--src/H5Fdbg.c3
-rw-r--r--src/H5Fdeprec.c2
-rw-r--r--src/H5Fefc.c2
-rw-r--r--src/H5Ffake.c2
-rw-r--r--src/H5Fint.c2
-rw-r--r--src/H5Fio.c6
-rw-r--r--src/H5Fmodule.h2
-rw-r--r--src/H5Fmount.c12
-rw-r--r--src/H5Fmpi.c2
-rw-r--r--src/H5Fpkg.h2
-rw-r--r--src/H5Fprivate.h14
-rw-r--r--src/H5Fquery.c3
-rw-r--r--src/H5Fspace.c2
-rw-r--r--src/H5Fsuper.c9
-rw-r--r--src/H5Fsuper_cache.c14
-rw-r--r--src/H5Ftest.c2
-rw-r--r--src/H5Gbtree2.c145
-rw-r--r--src/H5Gcache.c2
-rw-r--r--src/H5Gcompact.c20
-rw-r--r--src/H5Gdense.c167
-rw-r--r--src/H5Gdeprec.c10
-rw-r--r--src/H5Gent.c9
-rw-r--r--src/H5Gint.c36
-rw-r--r--src/H5Glink.c48
-rw-r--r--src/H5Gloc.c10
-rw-r--r--src/H5Gmodule.h2
-rw-r--r--src/H5Gname.c78
-rw-r--r--src/H5Gnode.c96
-rw-r--r--src/H5Gobj.c33
-rw-r--r--src/H5Gpkg.h2
-rw-r--r--src/H5Gprivate.h2
-rw-r--r--src/H5Gpublic.h2
-rw-r--r--src/H5Groot.c4
-rw-r--r--src/H5Gstab.c39
-rw-r--r--src/H5Gtest.c3
-rw-r--r--src/H5Gtraverse.c7
-rw-r--r--src/H5HF.c65
-rw-r--r--src/H5HFbtree2.c2
-rw-r--r--src/H5HFcache.c42
-rw-r--r--src/H5HFdbg.c35
-rw-r--r--src/H5HFdblock.c45
-rw-r--r--src/H5HFdtable.c81
-rw-r--r--src/H5HFhdr.c260
-rw-r--r--src/H5HFhuge.c64
-rw-r--r--src/H5HFiblock.c123
-rw-r--r--src/H5HFiter.c132
-rw-r--r--src/H5HFman.c31
-rw-r--r--src/H5HFmodule.h2
-rw-r--r--src/H5HFpkg.h128
-rw-r--r--src/H5HFprivate.h18
-rw-r--r--src/H5HFsection.c385
-rw-r--r--src/H5HFspace.c42
-rw-r--r--src/H5HFstat.c2
-rw-r--r--src/H5HFtest.c11
-rw-r--r--src/H5HFtiny.c86
-rw-r--r--src/H5HG.c4
-rw-r--r--src/H5HGcache.c2
-rw-r--r--src/H5HGdbg.c3
-rw-r--r--src/H5HGmodule.h2
-rw-r--r--src/H5HGpkg.h2
-rw-r--r--src/H5HGprivate.h2
-rw-r--r--src/H5HGquery.c2
-rw-r--r--src/H5HL.c2
-rw-r--r--src/H5HLcache.c2
-rw-r--r--src/H5HLdbg.c2
-rw-r--r--src/H5HLdblk.c2
-rw-r--r--src/H5HLint.c2
-rw-r--r--src/H5HLprfx.c2
-rw-r--r--src/H5HP.c72
-rw-r--r--src/H5Imodule.h2
-rw-r--r--src/H5Ipkg.h2
-rw-r--r--src/H5Itest.c2
-rw-r--r--src/H5L.c97
-rw-r--r--src/H5Lexternal.c2
-rw-r--r--src/H5Lmodule.h2
-rw-r--r--src/H5Lpkg.h24
-rw-r--r--src/H5Lprivate.h22
-rw-r--r--src/H5Lpublic.h2
-rw-r--r--src/H5MF.c36
-rw-r--r--src/H5MFaggr.c10
-rw-r--r--src/H5MFdbg.c5
-rw-r--r--src/H5MFmodule.h2
-rw-r--r--src/H5MFpkg.h3
-rw-r--r--src/H5MFprivate.h3
-rw-r--r--src/H5MFsection.c17
-rw-r--r--src/H5MM.c2
-rw-r--r--src/H5MMprivate.h2
-rw-r--r--src/H5MMpublic.h6
-rw-r--r--src/H5MP.c30
-rw-r--r--src/H5MPmodule.h2
-rw-r--r--src/H5MPpkg.h2
-rw-r--r--src/H5MPprivate.h2
-rw-r--r--src/H5MPtest.c18
-rw-r--r--src/H5Oainfo.c55
-rw-r--r--src/H5Oalloc.c17
-rw-r--r--src/H5Oattr.c112
-rw-r--r--src/H5Oattribute.c54
-rw-r--r--src/H5Obogus.c36
-rw-r--r--src/H5Obtreek.c54
-rw-r--r--src/H5Ocache.c10
-rw-r--r--src/H5Ocache_image.c36
-rw-r--r--src/H5Ocopy.c34
-rw-r--r--src/H5Ocopy_ref.c112
-rw-r--r--src/H5Odbg.c6
-rw-r--r--src/H5Odrvinfo.c57
-rw-r--r--src/H5Odtype.c170
-rw-r--r--src/H5Oefl.c60
-rw-r--r--src/H5Ofill.c179
-rw-r--r--src/H5Oflush.c2
-rw-r--r--src/H5Ofsinfo.c248
-rw-r--r--src/H5Oginfo.c65
-rw-r--r--src/H5Oint.c132
-rw-r--r--src/H5Olayout.c4
-rw-r--r--src/H5Olinfo.c46
-rw-r--r--src/H5Olink.c57
-rw-r--r--src/H5Omessage.c36
-rw-r--r--src/H5Omodule.h2
-rw-r--r--src/H5Omtime.c86
-rw-r--r--src/H5Oname.c54
-rw-r--r--src/H5Onull.c1
-rw-r--r--src/H5Opkg.h5
-rw-r--r--src/H5Opline.c241
-rw-r--r--src/H5Oprivate.h11
-rw-r--r--src/H5Opublic.h2
-rw-r--r--src/H5Orefcount.c57
-rw-r--r--src/H5Osdspace.c105
-rw-r--r--src/H5Oshared.c6
-rw-r--r--src/H5Oshared.h2
-rw-r--r--src/H5Oshmesg.c38
-rw-r--r--src/H5Ostab.c14
-rw-r--r--src/H5Otest.c4
-rw-r--r--src/H5Ounknown.c2
-rw-r--r--src/H5P.c2
-rw-r--r--src/H5PBmodule.h2
-rw-r--r--src/H5Pdapl.c42
-rw-r--r--src/H5Pdcpl.c80
-rw-r--r--src/H5Pdeprec.c2
-rw-r--r--src/H5Pdxpl.c18
-rw-r--r--src/H5Pencdec.c6
-rw-r--r--src/H5Pfapl.c164
-rw-r--r--src/H5Pfcpl.c39
-rw-r--r--src/H5Pfmpl.c14
-rw-r--r--src/H5Pgcpl.c2
-rw-r--r--src/H5Pint.c6
-rw-r--r--src/H5Plapl.c8
-rw-r--r--src/H5Plcpl.c14
-rw-r--r--src/H5Pmodule.h2
-rw-r--r--src/H5Pocpl.c83
-rw-r--r--src/H5Pocpypl.c2
-rw-r--r--src/H5Ppkg.h2
-rw-r--r--src/H5Pstrcpl.c2
-rw-r--r--src/H5Ptest.c2
-rw-r--r--src/H5RS.c14
-rw-r--r--src/H5Rdeprec.c152
-rw-r--r--src/H5Rint.c193
-rw-r--r--src/H5Rpkg.h4
-rw-r--r--src/H5SL.c101
-rw-r--r--src/H5SLmodule.h2
-rw-r--r--src/H5SM.c127
-rw-r--r--src/H5SMbtree2.c42
-rw-r--r--src/H5SMcache.c8
-rw-r--r--src/H5SMmessage.c26
-rw-r--r--src/H5SMmodule.h2
-rw-r--r--src/H5SMpkg.h14
-rw-r--r--src/H5SMprivate.h2
-rw-r--r--src/H5SMtest.c2
-rw-r--r--src/H5ST.c72
-rw-r--r--src/H5Sall.c2
-rw-r--r--src/H5Sdbg.c1
-rw-r--r--src/H5Sdeprec.c1
-rw-r--r--src/H5Shyper.c10
-rw-r--r--src/H5Smodule.h2
-rw-r--r--src/H5Snone.c2
-rw-r--r--src/H5Spkg.h2
-rw-r--r--src/H5Sselect.c38
-rw-r--r--src/H5Stest.c2
-rw-r--r--src/H5T.c32
-rw-r--r--src/H5TSprivate.h2
-rw-r--r--src/H5Tcompound.c12
-rw-r--r--src/H5Tconv.c106
-rw-r--r--src/H5Tcset.c8
-rw-r--r--src/H5Tdeprec.c2
-rw-r--r--src/H5Tenum.c49
-rw-r--r--src/H5Tfields.c13
-rw-r--r--src/H5Tfixed.c9
-rw-r--r--src/H5Tfloat.c4
-rw-r--r--src/H5Tmodule.h2
-rw-r--r--src/H5Toffset.c20
-rw-r--r--src/H5Topaque.c4
-rw-r--r--src/H5Torder.c14
-rw-r--r--src/H5Tpad.c8
-rw-r--r--src/H5Tpkg.h3
-rw-r--r--src/H5Tprecis.c24
-rw-r--r--src/H5Tprivate.h1
-rw-r--r--src/H5Tref.c9
-rw-r--r--src/H5Tstrpad.c8
-rw-r--r--src/H5Tvisit.c2
-rw-r--r--src/H5VLnative_link.c22
-rw-r--r--src/H5VLnative_object.c8
-rw-r--r--src/H5VM.c77
-rw-r--r--src/H5VMprivate.h112
-rw-r--r--src/H5WB.c6
-rw-r--r--src/H5WBprivate.h2
-rw-r--r--src/H5Z.c48
-rw-r--r--src/H5Zdeflate.c20
-rw-r--r--src/H5Zfletcher32.c27
-rw-r--r--src/H5Zmodule.h2
-rw-r--r--src/H5Znbit.c268
-rw-r--r--src/H5Zprivate.h2
-rw-r--r--src/H5Zpublic.h2
-rw-r--r--src/H5Zscaleoffset.c192
-rw-r--r--src/H5Zshuffle.c34
-rw-r--r--src/H5Zszip.c50
-rw-r--r--src/H5Ztrans.c342
-rw-r--r--src/H5checksum.c22
-rw-r--r--src/H5detect.c25
-rw-r--r--src/H5private.h5
-rw-r--r--src/H5system.c2
-rw-r--r--src/H5timer.c2
-rw-r--r--src/H5trace.c2
-rw-r--r--src/hdf5.lnt6
344 files changed, 6657 insertions, 9947 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 39a9e3e..022e5a3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -839,6 +839,7 @@ set (H5_PRIVATE_HEADERS
${HDF5_SRC_DIR}/H5FApkg.h
${HDF5_SRC_DIR}/H5FAprivate.h
+ ${HDF5_SRC_DIR}/H5FDmirror_priv.h
${HDF5_SRC_DIR}/H5FDpkg.h
${HDF5_SRC_DIR}/H5FDprivate.h
diff --git a/src/H5.c b/src/H5.c
index 31b8546..4e5648a 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -50,9 +50,9 @@
/********************/
/* Local Prototypes */
/********************/
-static void H5_debug_mask(const char*);
+static void H5__debug_mask(const char*);
#ifdef H5_HAVE_PARALLEL
-static int H5_mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag);
+static int H5__mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag);
#endif /*H5_HAVE_PARALLEL*/
/*********************/
@@ -139,7 +139,7 @@ H5_init_library(void)
int key_val;
if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN,
- (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb,
+ (MPI_Comm_delete_attr_function *)H5__mpi_delete_cb,
&key_val, NULL)))
HMPI_GOTO_ERROR(FAIL, "MPI_Comm_create_keyval failed", mpi_code)
@@ -219,10 +219,6 @@ H5_init_library(void)
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize vol interface")
if(H5P_init() < 0)
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize property list interface")
- if(H5T_init() < 0)
- HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize datatype interface")
- if(H5D_init() < 0)
- HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize dataset interface")
if(H5AC_init() < 0)
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize metadata caching interface")
if(H5L_init() < 0)
@@ -235,8 +231,8 @@ H5_init_library(void)
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize vol interface")
/* Debugging? */
- H5_debug_mask("-all");
- H5_debug_mask(HDgetenv("HDF5_DEBUG"));
+ H5__debug_mask("-all");
+ H5__debug_mask(HDgetenv("HDF5_DEBUG"));
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -639,7 +635,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5_debug_mask
+ * Function: H5__debug_mask
*
* Purpose: Set runtime debugging flags according to the string S. The
* string should contain file numbers and package names
@@ -662,7 +658,7 @@ done:
*-------------------------------------------------------------------------
*/
static void
-H5_debug_mask(const char *s)
+H5__debug_mask(const char *s)
{
FILE *stream = stderr;
char pkg_name[32], *rest;
@@ -738,12 +734,12 @@ H5_debug_mask(const char *s)
return;
-} /* end H5_debug_mask() */
+} /* end H5__debug_mask() */
#ifdef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
- * Function: H5_mpi_delete_cb
+ * Function: H5__mpi_delete_cb
*
* Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5
* library when the communicator is destroyed, i.e. on MPI_Finalize.
@@ -752,7 +748,7 @@ H5_debug_mask(const char *s)
*
*-------------------------------------------------------------------------
*/
-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)
+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;
diff --git a/src/H5AC.c b/src/H5AC.c
index 6972a31..e4bde8f 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -15,7 +15,7 @@
*
* Created: H5AC.c
* Jul 9 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Functions in this file implement a cache for
* things which exist on disk. All "things" associated
@@ -239,8 +239,6 @@ H5AC_term_package(void)
*
* Programmer: John Mainzer, 1/10/17
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
hbool_t
@@ -275,7 +273,6 @@ H5AC_cache_image_pending(const H5F_t *f)
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -469,7 +466,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -587,7 +583,6 @@ H5AC_evict(H5F_t *f)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't evict cache")
done:
-
/* If currently logging, generate a message */
if(f->shared->cache->log_info->logging)
if(H5C_log_write_evict_cache_msg(f->shared->cache, ret_value) < 0)
@@ -655,7 +650,6 @@ done:
* request to flush all items and something was protected.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -775,7 +769,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -1071,7 +1064,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -1265,7 +1257,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Sep 2 1997
*
*-------------------------------------------------------------------------
@@ -1500,7 +1491,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Sep 2 1997
*
*-------------------------------------------------------------------------
@@ -1527,8 +1517,8 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing,
HDassert(type->image_len);
HDassert(H5F_addr_defined(addr));
HDassert(thing);
- HDassert( ((H5AC_info_t *)thing)->addr == addr );
- HDassert( ((H5AC_info_t *)thing)->type == type );
+ HDassert(((H5AC_info_t *)thing)->addr == addr);
+ HDassert(((H5AC_info_t *)thing)->type == type);
dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) ||
(((H5AC_info_t *)thing)->dirtied));
diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c
index b40f8d0..94f3d83 100644
--- a/src/H5ACdbg.c
+++ b/src/H5ACdbg.c
@@ -270,10 +270,6 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr,
*
* Programmer: John Mainzer, 5/30/14
*
- * Changes: None.
- *
- * JRM -- 9/17/16
- *
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
@@ -351,8 +347,6 @@ H5AC_get_serialization_in_progress(H5F_t *f)
*
* Programmer: John Mainzer, 6/18/16
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
#ifndef NDEBUG
diff --git a/src/H5ACmodule.h b/src/H5ACmodule.h
index e218b31..8c6eae2 100644
--- a/src/H5ACmodule.h
+++ b/src/H5ACmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c
index f097e83..c6ffc80 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -15,7 +15,7 @@
*
* Created: H5ACmpio.c
* Jun 20 2015
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Functions in this file implement support for parallel
* I/O cache functionality
@@ -2284,7 +2284,6 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates,
* request to flush all items and something was protected.
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 22 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index b932e16..f6c3d6b 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5ACprivate.h
* Jul 9 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Constants and typedefs available to the rest of the
* library.
diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h
index a48aa69..e6f4010 100644
--- a/src/H5ACpublic.h
+++ b/src/H5ACpublic.h
@@ -15,12 +15,10 @@
*
* Created: H5ACpublic.h
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Public include file for cache functions.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5ACpublic_H
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c
index 3377aa2..843799e 100644
--- a/src/H5Abtree2.c
+++ b/src/H5Abtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5Abtree2.c
* Dec 4 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for indexing attributes on objects
*
@@ -152,7 +152,6 @@ const H5B2_class_t H5A_BT2_CORDER[1]={{ /* B-tree class information */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 4 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Adense.c b/src/H5Adense.c
index fd92e8f..ac6501a 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -15,7 +15,7 @@
*
* Created: H5Adense.c
* Dec 4 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for operating on "dense" attribute storage
* for an object.
@@ -209,9 +209,6 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo)
/* Retrieve the heap's address in the file */
if(H5HF_get_heap_addr(fheap, &ainfo->fheap_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap address")
-#ifdef QAK
-HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr);
-#endif /* QAK */
#ifndef NDEBUG
{
@@ -221,9 +218,6 @@ HDfprintf(stderr, "%s: ainfo->fheap_addr = %a\n", FUNC, ainfo->fheap_addr);
if(H5HF_get_id_len(fheap, &fheap_id_len) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length")
HDassert(fheap_id_len == H5O_FHEAP_ID_LEN);
-#ifdef QAK
-HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
-#endif /* QAK */
}
#endif /* NDEBUG */
@@ -243,9 +237,6 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
/* Retrieve the v2 B-tree's address in the file */
if(H5B2_get_addr(bt2_name, &ainfo->name_bt2_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index")
-#ifdef QAK
-HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr);
-#endif /* QAK */
/* Check if we should create a creation order index v2 B-tree */
if(ainfo->index_corder) {
@@ -264,9 +255,6 @@ HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr)
/* Retrieve the v2 B-tree's address in the file */
if(H5B2_get_addr(bt2_corder, &ainfo->corder_bt2_addr) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index")
-#ifdef QAK
-HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_addr);
-#endif /* QAK */
} /* end if */
done:
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index dd5eae3..c4d8bb8 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Adeprec.c
* November 27 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5A interface. These
* functions are here for compatibility purposes and may be
diff --git a/src/H5Aint.c b/src/H5Aint.c
index 1e9989d..8d9c600 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -14,8 +14,8 @@
/*-------------------------------------------------------------------------
*
* Created: H5Aint.c
- * Dec 18 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Dec 18 2006
+ * Quincey Koziol
*
* Purpose: Internal routines for managing attributes.
*
@@ -2415,7 +2415,6 @@ done:
* Failure: Negative
*
* Programmer: Peter Cao
- * xcao@hdfgroup.org
* July 20, 2007
*
*-------------------------------------------------------------------------
diff --git a/src/H5Amodule.h b/src/H5Amodule.h
index 8ed056b..6b835e1 100644
--- a/src/H5Amodule.h
+++ b/src/H5Amodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5Apkg.h b/src/H5Apkg.h
index f3870c0..39fdea3 100644
--- a/src/H5Apkg.h
+++ b/src/H5Apkg.h
@@ -263,9 +263,6 @@ H5_DLL herr_t H5O__attr_remove(const H5O_loc_t *loc, const char *name);
H5_DLL herr_t H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n);
H5_DLL htri_t H5O__attr_exists(const H5O_loc_t *loc, const char *name);
-#ifndef H5_NO_DEPRECATED_SYMBOLS
-H5_DLL int H5O__attr_count(const H5O_loc_t *loc);
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
H5_DLL H5A_t *H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size,
H5O_copy_t *cpy_info);
H5_DLL herr_t H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src,
diff --git a/src/H5B.c b/src/H5B.c
index f909d90..2ab5198 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -15,7 +15,7 @@
*
* Created: H5B.c
* Jul 10 1997
- * Robb Matzke <matzke@llnl.gov>
+ * Robb Matzke
*
* Purpose: Implements balanced, sibling-linked, N-ary trees
* capable of storing any type of data with unique key
@@ -206,7 +206,6 @@ H5FL_SEQ_DEFINE_STATIC(size_t);
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -291,7 +290,6 @@ done:
* UDATA is undefined).
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -387,7 +385,6 @@ done:
* returned through the NEW_ADDR argument). Negative on failure.
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 3 1997
*
*-------------------------------------------------------------------------
@@ -542,7 +539,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -700,7 +696,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 8 1997
*
*-------------------------------------------------------------------------
@@ -789,7 +784,6 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx,
* Failure: H5B_INS_ERROR
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 9 1997
*
*-------------------------------------------------------------------------
@@ -1118,7 +1112,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -1185,7 +1178,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jun 23 1997
*
*-------------------------------------------------------------------------
@@ -1679,7 +1671,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 27 2008
*
*-------------------------------------------------------------------------
@@ -1786,7 +1777,6 @@ H5B_shared_free(void *_shared)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Apr 18 2000
*
*-------------------------------------------------------------------------
@@ -1852,7 +1842,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 3 2008
*
*-------------------------------------------------------------------------
@@ -2066,7 +2055,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2.c b/src/H5B2.c
index 5c83de2..06806aa 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -1497,9 +1497,6 @@ H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op,
HDassert(H5F_addr_defined(addr));
/* Lock the v2 B-tree header into memory */
-#ifdef QAK
-HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr);
-#endif /* QAK */
if(NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__NO_FLAGS_SET)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header")
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 80cb6c5..3b7dd5d 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -15,7 +15,7 @@
*
* Created: H5B2cache.c
* Jan 31 2005
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement v2 B-tree metadata cache methods.
*
@@ -171,7 +171,6 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -240,7 +239,6 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 1 2005
*
*-------------------------------------------------------------------------
@@ -339,7 +337,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -370,7 +367,6 @@ H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 1 2005
*
*-------------------------------------------------------------------------
@@ -442,7 +438,6 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Apr 24 2012
*
*-------------------------------------------------------------------------
@@ -530,7 +525,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mike McGreevy
- * mcgreevy@hdfgroup.org
* June 18, 2008
*
*-------------------------------------------------------------------------
@@ -562,7 +556,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -637,7 +630,6 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -756,7 +748,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -788,7 +779,6 @@ H5B2__cache_int_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -875,7 +865,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Apr 25 2012
*
*-------------------------------------------------------------------------
@@ -886,7 +875,7 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing)
H5B2_internal_t *internal = (H5B2_internal_t *)_thing;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -952,7 +941,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mike McGreevy
- * mcgreevy@hdfgroup.org
* June 18, 2008
*
*-------------------------------------------------------------------------
@@ -985,7 +973,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -1060,7 +1047,6 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1159,7 +1145,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -1191,7 +1176,6 @@ H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1264,7 +1248,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Neil Fortner
- * nfortne2@hdfgroup.org
* Apr 25 2012
*
*-------------------------------------------------------------------------
@@ -1275,7 +1258,7 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing)
H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -1341,7 +1324,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mike McGreevy
- * mcgreevy@hdfgroup.org
* June 18, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index b5b1c03..0d93ed6 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -15,7 +15,7 @@
*
* Created: H5B2dbg.c
* Feb 2 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Dump debugging information about a v2 B-tree.
*
@@ -80,7 +80,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -175,7 +174,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 4 2005
*
*-------------------------------------------------------------------------
@@ -287,7 +285,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 7 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c
index 9ba8235..fc5e7f8 100644
--- a/src/H5B2hdr.c
+++ b/src/H5B2hdr.c
@@ -174,7 +174,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata,
/* 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);
+ u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[0].max_nrec);
H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned)
HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE);
@@ -190,7 +190,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata,
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);
+ u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[u].cum_max_nrec);
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)))
@@ -573,7 +573,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 18 2015
*
*-------------------------------------------------------------------------
@@ -605,7 +604,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -682,7 +680,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 15 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2int.c b/src/H5B2int.c
index 53ac835..3f9ae74 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -15,7 +15,7 @@
*
* Created: H5B2int.c
* Feb 27 2006
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Internal routines for managing v2 B-trees.
*
@@ -97,7 +97,6 @@ H5FL_SEQ_EXTERN(H5B2_node_info_t);
* record to locate is greater than all records to search).
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -141,7 +140,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 28 2006
*
*-------------------------------------------------------------------------
@@ -336,7 +334,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -370,7 +367,7 @@ H5B2__split_root(H5B2_hdr_t *hdr)
hdr->node_info[hdr->depth].merge_nrec = (hdr->node_info[hdr->depth].max_nrec * hdr->merge_percent) / 100;
hdr->node_info[hdr->depth].cum_max_nrec = ((hdr->node_info[hdr->depth].max_nrec + 1) *
hdr->node_info[hdr->depth - 1].cum_max_nrec) + hdr->node_info[hdr->depth].max_nrec;
- u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec);
+ u_max_nrec_size = H5VM__limit_enc_size((uint64_t)hdr->node_info[hdr->depth].cum_max_nrec);
H5_CHECKED_ASSIGN(hdr->node_info[hdr->depth].cum_max_nrec_size, uint8_t, u_max_nrec_size, unsigned)
if(NULL == (hdr->node_info[hdr->depth].nat_rec_fac = H5FL_fac_init(hdr->cls->nrec_size * hdr->node_info[hdr->depth].max_nrec)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create node native key block factory")
@@ -414,7 +411,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 9 2005
*
*-------------------------------------------------------------------------
@@ -658,7 +654,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 9 2005
*
*-------------------------------------------------------------------------
@@ -1032,7 +1027,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -1195,7 +1189,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -1437,7 +1430,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 23 2015
*
*-------------------------------------------------------------------------
@@ -1497,7 +1489,6 @@ done:
* Return: Value from callback, non-negative on success, negative on error
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 11 2005
*
*-------------------------------------------------------------------------
@@ -1612,7 +1603,6 @@ done:
* Return: Value from callback, non-negative on success, negative on error
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
@@ -1779,7 +1769,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Dec 1 2016
*
*-------------------------------------------------------------------------
@@ -1877,7 +1866,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Dec 1 2016
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2internal.c b/src/H5B2internal.c
index 1fee0af..82f676f 100644
--- a/src/H5B2internal.c
+++ b/src/H5B2internal.c
@@ -15,7 +15,7 @@
*
* Created: H5B2internal.c
* Dec 01 2016
- * Quincey Koziol <koziol@lbl.gov>
+ * Quincey Koziol
*
* Purpose: Routines for managing v2 B-tree internal ndoes.
*
@@ -87,7 +87,6 @@ H5FL_DEFINE(H5B2_internal_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 3 2005
*
*-------------------------------------------------------------------------
@@ -183,7 +182,6 @@ done:
* Return: Pointer to internal node on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 25 2006
*
*-------------------------------------------------------------------------
@@ -277,7 +275,6 @@ done:
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
@@ -350,7 +347,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 2 2005
*
*-------------------------------------------------------------------------
@@ -513,7 +509,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 24 2015
*
*-------------------------------------------------------------------------
@@ -782,7 +777,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 3 2005
*
*-------------------------------------------------------------------------
@@ -1015,7 +1009,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -1300,7 +1293,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1349,7 +1341,6 @@ done:
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
@@ -1390,7 +1381,6 @@ H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_U
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c
index 1fde36d..d2cfbe0 100644
--- a/src/H5B2leaf.c
+++ b/src/H5B2leaf.c
@@ -15,7 +15,7 @@
*
* Created: H5B2leaf.c
* Dec 01 2016
- * Quincey Koziol <koziol@lbl.gov>
+ * Quincey Koziol
*
* Purpose: Routines for managing v2 B-tree leaf ndoes.
*
@@ -88,7 +88,6 @@ H5FL_DEFINE(H5B2_leaf_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -174,7 +173,6 @@ done:
* Return: Pointer to leaf node on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 5 2010
*
*-------------------------------------------------------------------------
@@ -266,7 +264,6 @@ done:
* Return: Non-negative on success, negative on failure.
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 9 2005
*
*-------------------------------------------------------------------------
@@ -340,7 +337,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 3 2005
*
*-------------------------------------------------------------------------
@@ -453,7 +449,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Dec 23 2015
*
*-------------------------------------------------------------------------
@@ -608,7 +603,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 4 2005
*
*-------------------------------------------------------------------------
@@ -765,14 +759,14 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Mar 3 2005
*
*-------------------------------------------------------------------------
*/
herr_t
H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr,
- H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data)
+ H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op,
+ void *op_data)
{
H5B2_leaf_t *leaf; /* Pointer to leaf node */
haddr_t leaf_addr = HADDR_UNDEF; /* Leaf address on disk */
@@ -874,7 +868,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -976,7 +969,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 2 2005
*
*-------------------------------------------------------------------------
@@ -1021,7 +1013,6 @@ done:
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
@@ -1045,7 +1036,6 @@ H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr,
* Return: Non-negative on success, negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Feb 19 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5B2module.h b/src/H5B2module.h
index 35c982c..6e8c92a 100644
--- a/src/H5B2module.h
+++ b/src/H5B2module.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5B2stat.c b/src/H5B2stat.c
index 5dd9cc2..5c09b3d 100644
--- a/src/H5B2stat.c
+++ b/src/H5B2stat.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Monday, March 6, 2006
*
* Purpose: v2 B-tree metadata statistics functions.
diff --git a/src/H5B2test.c b/src/H5B2test.c
index 7affd49..ee37c54 100644
--- a/src/H5B2test.c
+++ b/src/H5B2test.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Thursday, February 3, 2005
*
* Purpose: v2 B-tree testing functions.
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index c2c7a80..80fb200 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -15,7 +15,7 @@
*
* Created: H5Bcache.c
* Oct 31 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Implement B-tree metadata cache methods.
*
@@ -98,7 +98,6 @@ const H5AC_class_t H5AC_BT[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 18, 2010
*
*-------------------------------------------------------------------------
@@ -135,7 +134,6 @@ H5B__cache_get_initial_load_size(void *_udata, size_t *image_len)
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 24, 2008
*
*-------------------------------------------------------------------------
@@ -241,7 +239,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 20, 2010
*
*-------------------------------------------------------------------------
@@ -277,7 +274,6 @@ H5B__cache_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 24, 2008
*
*-------------------------------------------------------------------------
@@ -363,7 +359,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26, 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5C.c b/src/H5C.c
index 91e4158..fd4386c 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -147,11 +147,11 @@ static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr,
static herr_t H5C__flush_invalidate_cache(H5F_t *f, unsigned flags);
-static herr_t H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags);
+static herr_t H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags);
static herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags);
-static void * H5C_load_entry(H5F_t * f,
+static void * H5C__load_entry(H5F_t * f,
#ifdef H5_HAVE_PARALLEL
hbool_t coll_access,
#endif /* H5_HAVE_PARALLEL */
@@ -166,19 +166,20 @@ static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry);
static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring);
static herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr,
H5C_cache_entry_t *entry_ptr);
-
+static herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr,
+ H5C_cache_entry_t *entry_ptr);
static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type,
haddr_t addr, size_t *len, hbool_t actual);
#if H5C_DO_SLIST_SANITY_CHECKS
-static hbool_t H5C_entry_in_skip_list(H5C_t * cache_ptr,
+static hbool_t H5C__entry_in_skip_list(H5C_t * cache_ptr,
H5C_cache_entry_t *target_ptr);
#endif /* H5C_DO_SLIST_SANITY_CHECKS */
#if H5C_DO_EXTREME_SANITY_CHECKS
-static herr_t H5C_validate_lru_list(H5C_t * cache_ptr);
-static herr_t H5C_validate_pinned_entry_list(H5C_t * cache_ptr);
-static herr_t H5C_validate_protected_entry_list(H5C_t * cache_ptr);
+static herr_t H5C__validate_lru_list(H5C_t * cache_ptr);
+static herr_t H5C__validate_pinned_entry_list(H5C_t * cache_ptr);
+static herr_t H5C__validate_protected_entry_list(H5C_t * cache_ptr);
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
#ifndef NDEBUG
@@ -406,17 +407,17 @@ H5C_create(size_t max_cache_size,
(cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT;
(cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off;
- (cache_ptr->resize_ctl).flash_multiple = 1.0f;
- (cache_ptr->resize_ctl).flash_threshold = 0.25f;
+ (cache_ptr->resize_ctl).flash_multiple = (double)1.0f;
+ (cache_ptr->resize_ctl).flash_threshold = (double)0.25f;
(cache_ptr->resize_ctl).decr_mode = H5C_decr__off;
- (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD;
- (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT;
+ (cache_ptr->resize_ctl).upper_hr_threshold = (double)H5C__DEF_AR_UPPER_THRESHHOLD;
+ (cache_ptr->resize_ctl).decrement = (double)H5C__DEF_AR_DECREMENT;
(cache_ptr->resize_ctl).apply_max_decrement = TRUE;
(cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT;
(cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT;
(cache_ptr->resize_ctl).apply_empty_reserve = TRUE;
- (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE;
+ (cache_ptr->resize_ctl).empty_reserve = (double)H5C__DEF_AR_EMPTY_RESERVE;
cache_ptr->epoch_markers_active = 0;
@@ -691,7 +692,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
/*-------------------------------------------------------------------------
- * Function: H5C_free_tag_list_cb
+ * Function: H5C__free_tag_list_cb
*
* Purpose: Callback function to free tag nodes from the skip list.
*
@@ -703,11 +704,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
*-------------------------------------------------------------------------
*/
static herr_t
-H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data)
+H5C__free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data)
{
H5C_tag_info_t *tag_info = (H5C_tag_info_t *)_item;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(tag_info);
@@ -715,7 +716,7 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED
tag_info = H5FL_FREE(H5C_tag_info_t, tag_info);
FUNC_LEAVE_NOAPI(0)
-} /* H5C_free_tag_list_cb() */
+} /* H5C__free_tag_list_cb() */
/*-------------------------------------------------------------------------
@@ -863,7 +864,7 @@ H5C_dest(H5F_t * f)
} /* end if */
if(cache_ptr->tag_list != NULL) {
- H5SL_destroy(cache_ptr->tag_list, H5C_free_tag_list_cb, NULL);
+ H5SL_destroy(cache_ptr->tag_list, H5C__free_tag_list_cb, NULL);
cache_ptr->tag_list = NULL;
} /* end if */
@@ -951,7 +952,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag
HDassert(H5F_addr_defined(addr));
#if H5C_DO_EXTREME_SANITY_CHECKS
- if(H5C_validate_lru_list(cache_ptr) < 0)
+ if(H5C__validate_lru_list(cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -986,7 +987,7 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if(H5C_validate_lru_list(cache_ptr) < 0)
+ if(H5C__validate_lru_list(cache_ptr) < 0)
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1094,9 +1095,9 @@ H5C_flush_cache(H5F_t *f, unsigned flags)
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1277,9 +1278,9 @@ H5C_insert_entry(H5F_t * f,
#if H5C_DO_EXTREME_SANITY_CHECKS
/* no need to verify that entry is not already in the index as */
/* we already make that check below. */
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1468,9 +1469,9 @@ H5C_insert_entry(H5F_t * f,
H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL)
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed just before done")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1500,9 +1501,9 @@ H5C_insert_entry(H5F_t * f,
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1828,9 +1829,9 @@ H5C_move_entry(H5C_t * cache_ptr,
HDassert(H5F_addr_ne(old_addr, new_addr));
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1932,9 +1933,9 @@ H5C_move_entry(H5C_t * cache_ptr,
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -1981,8 +1982,8 @@ H5C_resize_entry(void *thing, size_t new_size)
HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??")
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2081,8 +2082,8 @@ H5C_resize_entry(void *thing, size_t new_size)
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2123,9 +2124,9 @@ H5C_pin_protected_entry(void *thing)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2140,9 +2141,9 @@ H5C_pin_protected_entry(void *thing)
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2210,9 +2211,9 @@ H5C_protect(H5F_t * f,
HDassert( H5F_addr_defined(addr) );
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2338,7 +2339,7 @@ H5C_protect(H5F_t * f,
hit = FALSE;
- if(NULL == (thing = H5C_load_entry(f,
+ if(NULL == (thing = H5C__load_entry(f,
#ifdef H5_HAVE_PARALLEL
coll_access,
#endif /* H5_HAVE_PARALLEL */
@@ -2592,9 +2593,9 @@ H5C_protect(H5F_t * f,
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2910,9 +2911,9 @@ H5C_unpin_entry(void *_entry_ptr)
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2923,9 +2924,9 @@ H5C_unpin_entry(void *_entry_ptr)
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -3012,9 +3013,9 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
was_clean = ! ( entry_ptr->is_dirty );
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -3211,9 +3212,9 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags)
done:
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0)) {
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0)) {
HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -3958,7 +3959,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted)
enum H5C_resize_status status = in_spec; /* will change if needed */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( f );
HDassert( cache_ptr );
@@ -4274,7 +4275,7 @@ H5C__autoadjust__ageout(H5F_t * f, double hit_rate, enum H5C_resize_status * sta
size_t test_size;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( f );
HDassert( cache_ptr );
@@ -4375,10 +4376,10 @@ done:
static herr_t
H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
int i;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
@@ -4492,7 +4493,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte
H5C_cache_entry_t * prev_ptr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( f );
HDassert( cache_ptr );
@@ -4675,10 +4676,10 @@ done:
static herr_t
H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
int i;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
@@ -4745,11 +4746,11 @@ done:
static herr_t
H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
- int i;
int ring_buf_index;
+ int i;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
@@ -4822,11 +4823,11 @@ done:
static herr_t
H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
- int i;
int ring_buf_index;
+ int i;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
@@ -4912,7 +4913,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr,
double hit_rate;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
@@ -5128,7 +5129,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags)
*/
ring = H5C_RING_USER;
while(ring < H5C_RING_NTYPES) {
- if(H5C_flush_invalidate_ring(f, ring, flags) < 0)
+ if(H5C__flush_invalidate_ring(f, ring, flags) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed")
ring++;
} /* end while */
@@ -5176,7 +5177,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5C_flush_invalidate_ring
+ * Function: H5C__flush_invalidate_ring
*
* Purpose: Flush and destroy the entries contained in the target
* cache and ring.
@@ -5212,7 +5213,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags)
+H5C__flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags)
{
H5C_t *cache_ptr;
hbool_t restart_slist_scan;
@@ -5231,7 +5232,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags)
#endif /* H5C_DO_SANITY_CHECKS */
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
HDassert(f);
HDassert(f->shared);
@@ -5326,7 +5327,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags)
* This flag is set to TRUE by H5C__flush_single_entry if the slist
* is modified by a pre_serialize, serialize, or notify callback.
*
- * H5C_flush_invalidate_ring() uses this flag to detect any
+ * H5C__flush_invalidate_ring() uses this flag to detect any
* modifications to the slist that might corrupt the scan of
* the slist -- and restart the scan in this event.
*/
@@ -5622,7 +5623,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5C_flush_invalidate_ring() */
+} /* H5C__flush_invalidate_ring() */
/*-------------------------------------------------------------------------
@@ -5679,9 +5680,9 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags)
HDassert(ring < H5C_RING_NTYPES);
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -6477,7 +6478,7 @@ done:
/*-------------------------------------------------------------------------
*
- * Function: H5C_load_entry
+ * Function: H5C__load_entry
*
* Purpose: Attempt to load the entry at the specified disk address
* and with the specified type into memory. If successful.
@@ -6494,7 +6495,7 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5C_load_entry(H5F_t * f,
+H5C__load_entry(H5F_t * f,
#ifdef H5_HAVE_PARALLEL
hbool_t coll_access,
#endif /* H5_HAVE_PARALLEL */
@@ -6514,7 +6515,7 @@ H5C_load_entry(H5F_t * f,
#endif /* H5_HAVE_PARALLEL */
void * ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity checks */
HDassert(f);
@@ -6812,7 +6813,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5C_load_entry() */
+} /* H5C__load_entry() */
/*-------------------------------------------------------------------------
@@ -7160,7 +7161,7 @@ done:
/*-------------------------------------------------------------------------
*
- * Function: H5C_validate_lru_list
+ * Function: H5C__validate_lru_list
*
* Purpose: Debugging function that scans the LRU list for errors.
*
@@ -7172,123 +7173,73 @@ done:
*
* Programmer: John Mainzer, 7/14/05
*
- * Changes:
- *
- * Added code to verify that the LRU contains no pinned
- * entries. JRM -- 4/25/14
- *
*-------------------------------------------------------------------------
*/
#if H5C_DO_EXTREME_SANITY_CHECKS
-
static herr_t
-H5C_validate_lru_list(H5C_t * cache_ptr)
+H5C__validate_lru_list(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
int32_t len = 0;
size_t size = 0;
H5C_cache_entry_t * entry_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
-
- HDassert( cache_ptr );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
- if ( ( ( cache_ptr->LRU_head_ptr == NULL )
- ||
- ( cache_ptr->LRU_tail_ptr == NULL )
- )
- &&
- ( cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr )
- ) {
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ if(((cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_tail_ptr == NULL))
+ && (cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed")
- }
if(cache_ptr->LRU_list_len < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed")
- if ( ( cache_ptr->LRU_list_len == 1 )
- &&
- ( ( cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr )
- ||
- ( cache_ptr->LRU_head_ptr == NULL )
- ||
- ( cache_ptr->LRU_head_ptr->size != cache_ptr->LRU_list_size )
- )
- ) {
-
+ if((cache_ptr->LRU_list_len == 1) &&
+ ((cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr) ||
+ (cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_head_ptr->size != cache_ptr->LRU_list_size)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed")
- }
-
- if ( ( cache_ptr->LRU_list_len >= 1 )
- &&
- ( ( cache_ptr->LRU_head_ptr == NULL )
- ||
- ( cache_ptr->LRU_head_ptr->prev != NULL )
- ||
- ( cache_ptr->LRU_tail_ptr == NULL )
- ||
- ( cache_ptr->LRU_tail_ptr->next != NULL )
- )
- ) {
+ if((cache_ptr->LRU_list_len >= 1) &&
+ ((cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_head_ptr->prev != NULL)
+ || (cache_ptr->LRU_tail_ptr == NULL) || (cache_ptr->LRU_tail_ptr->next != NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed")
- }
entry_ptr = cache_ptr->LRU_head_ptr;
- while ( entry_ptr != NULL )
- {
-
- if ( ( entry_ptr != cache_ptr->LRU_head_ptr ) &&
- ( ( entry_ptr->prev == NULL ) ||
- ( entry_ptr->prev->next != entry_ptr ) ) ) {
-
+ while(entry_ptr != NULL) {
+ if((entry_ptr != cache_ptr->LRU_head_ptr) &&
+ ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed")
- }
-
- if ( ( entry_ptr != cache_ptr->LRU_tail_ptr ) &&
- ( ( entry_ptr->next == NULL ) ||
- ( entry_ptr->next->prev != entry_ptr ) ) ) {
+ if((entry_ptr != cache_ptr->LRU_tail_ptr) &&
+ ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed")
- }
-
- if ( ( entry_ptr->is_pinned ) ||
- ( entry_ptr->pinned_from_client ) ||
- ( entry_ptr->pinned_from_cache ) ) {
+ if((entry_ptr->is_pinned) ||
+ (entry_ptr->pinned_from_client) || (entry_ptr->pinned_from_cache))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed")
- }
len++;
size += entry_ptr->size;
entry_ptr = entry_ptr->next;
}
- if ( ( cache_ptr->LRU_list_len != len ) ||
- ( cache_ptr->LRU_list_size != size ) ) {
-
+ if((cache_ptr->LRU_list_len != len) || (cache_ptr->LRU_list_size != size))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed")
- }
done:
-
- if ( ret_value != SUCCEED ) {
-
+ if(ret_value != SUCCEED)
HDassert(0);
- }
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5C_validate_lru_list() */
-
+} /* H5C__validate_lru_list() */
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
/*-------------------------------------------------------------------------
*
- * Function: H5C_validate_pinned_entry_list
+ * Function: H5C__validate_pinned_entry_list
*
* Purpose: Debugging function that scans the pinned entry list for
* errors.
@@ -7301,126 +7252,78 @@ done:
*
* Programmer: John Mainzer, 4/25/14
*
- * Changes:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
#if H5C_DO_EXTREME_SANITY_CHECKS
-
static herr_t
-H5C_validate_pinned_entry_list(H5C_t * cache_ptr)
+H5C__validate_pinned_entry_list(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
int32_t len = 0;
size_t size = 0;
H5C_cache_entry_t * entry_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
-
- HDassert( cache_ptr );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ FUNC_ENTER_STATIC
- if ( ( ( cache_ptr->pel_head_ptr == NULL )
- ||
- ( cache_ptr->pel_tail_ptr == NULL )
- )
- &&
- ( cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr )
- ) {
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ if(((cache_ptr->pel_head_ptr == NULL) || (cache_ptr->pel_tail_ptr == NULL))
+ && (cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed")
- }
if(cache_ptr->pel_len < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed")
- if ( ( cache_ptr->pel_len == 1 )
- &&
- ( ( cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr )
- ||
- ( cache_ptr->pel_head_ptr == NULL )
- ||
- ( cache_ptr->pel_head_ptr->size != cache_ptr->pel_size )
- )
- ) {
-
+ if((cache_ptr->pel_len == 1) &&
+ ((cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr) ||
+ (cache_ptr->pel_head_ptr == NULL) ||
+ (cache_ptr->pel_head_ptr->size != cache_ptr->pel_size)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed")
- }
-
- if ( ( cache_ptr->pel_len >= 1 )
- &&
- ( ( cache_ptr->pel_head_ptr == NULL )
- ||
- ( cache_ptr->pel_head_ptr->prev != NULL )
- ||
- ( cache_ptr->pel_tail_ptr == NULL )
- ||
- ( cache_ptr->pel_tail_ptr->next != NULL )
- )
- ) {
+ if((cache_ptr->pel_len >= 1) &&
+ ((cache_ptr->pel_head_ptr == NULL) ||
+ (cache_ptr->pel_head_ptr->prev != NULL) ||
+ (cache_ptr->pel_tail_ptr == NULL) ||
+ (cache_ptr->pel_tail_ptr->next != NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed")
- }
entry_ptr = cache_ptr->pel_head_ptr;
- while ( entry_ptr != NULL )
- {
-
- if ( ( entry_ptr != cache_ptr->pel_head_ptr ) &&
- ( ( entry_ptr->prev == NULL ) ||
- ( entry_ptr->prev->next != entry_ptr ) ) ) {
-
+ while(entry_ptr != NULL) {
+ if((entry_ptr != cache_ptr->pel_head_ptr) &&
+ ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed")
- }
-
- if ( ( entry_ptr != cache_ptr->pel_tail_ptr ) &&
- ( ( entry_ptr->next == NULL ) ||
- ( entry_ptr->next->prev != entry_ptr ) ) ) {
+ if((entry_ptr != cache_ptr->pel_tail_ptr) &&
+ ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed")
- }
-
- if ( ! entry_ptr->is_pinned ) {
+ if(!entry_ptr->is_pinned)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed")
- }
-
- if ( ! ( ( entry_ptr->pinned_from_client ) ||
- ( entry_ptr->pinned_from_cache ) ) ) {
+ if(!(entry_ptr->pinned_from_client || entry_ptr->pinned_from_cache))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed")
- }
len++;
size += entry_ptr->size;
entry_ptr = entry_ptr->next;
}
- if ( ( cache_ptr->pel_len != len ) ||
- ( cache_ptr->pel_size != size ) ) {
-
+ if((cache_ptr->pel_len != len) || (cache_ptr->pel_size != size))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 9 failed")
- }
done:
-
- if ( ret_value != SUCCEED ) {
-
+ if(ret_value != SUCCEED)
HDassert(0);
- }
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5C_validate_pinned_entry_list() */
-
+} /* H5C__validate_pinned_entry_list() */
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
/*-------------------------------------------------------------------------
*
- * Function: H5C_validate_protected_entry_list
+ * Function: H5C__validate_protected_entry_list
*
* Purpose: Debugging function that scans the protected entry list for
* errors.
@@ -7433,26 +7336,21 @@ done:
*
* Programmer: John Mainzer, 4/25/14
*
- * Changes:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
#if H5C_DO_EXTREME_SANITY_CHECKS
-
static herr_t
-H5C_validate_protected_entry_list(H5C_t * cache_ptr)
+H5C__validate_protected_entry_list(H5C_t * cache_ptr)
{
- herr_t ret_value = SUCCEED; /* Return value */
int32_t len = 0;
size_t size = 0;
H5C_cache_entry_t * entry_ptr = NULL;
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- HDassert( cache_ptr );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
if(((cache_ptr->pl_head_ptr == NULL) || (cache_ptr->pl_tail_ptr == NULL))
&& (cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr))
@@ -7461,91 +7359,55 @@ H5C_validate_protected_entry_list(H5C_t * cache_ptr)
if(cache_ptr->pl_len < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed")
- if ( ( cache_ptr->pl_len == 1 )
- &&
- ( ( cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr )
- ||
- ( cache_ptr->pl_head_ptr == NULL )
- ||
- ( cache_ptr->pl_head_ptr->size != cache_ptr->pl_size )
- )
- ) {
-
+ if((cache_ptr->pl_len == 1) &&
+ ((cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr) ||
+ (cache_ptr->pl_head_ptr == NULL) ||
+ (cache_ptr->pl_head_ptr->size != cache_ptr->pl_size)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed")
- }
-
- if ( ( cache_ptr->pl_len >= 1 )
- &&
- ( ( cache_ptr->pl_head_ptr == NULL )
- ||
- ( cache_ptr->pl_head_ptr->prev != NULL )
- ||
- ( cache_ptr->pl_tail_ptr == NULL )
- ||
- ( cache_ptr->pl_tail_ptr->next != NULL )
- )
- ) {
+ if((cache_ptr->pl_len >= 1) &&
+ ((cache_ptr->pl_head_ptr == NULL) ||
+ (cache_ptr->pl_head_ptr->prev != NULL) ||
+ (cache_ptr->pl_tail_ptr == NULL) ||
+ (cache_ptr->pl_tail_ptr->next != NULL)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed")
- }
entry_ptr = cache_ptr->pl_head_ptr;
- while ( entry_ptr != NULL )
- {
-
- if ( ( entry_ptr != cache_ptr->pl_head_ptr ) &&
- ( ( entry_ptr->prev == NULL ) ||
- ( entry_ptr->prev->next != entry_ptr ) ) ) {
-
+ while(entry_ptr != NULL) {
+ if((entry_ptr != cache_ptr->pl_head_ptr) &&
+ ((entry_ptr->prev == NULL) || (entry_ptr->prev->next != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed")
- }
-
- if ( ( entry_ptr != cache_ptr->pl_tail_ptr ) &&
- ( ( entry_ptr->next == NULL ) ||
- ( entry_ptr->next->prev != entry_ptr ) ) ) {
+ if((entry_ptr != cache_ptr->pl_tail_ptr) &&
+ ((entry_ptr->next == NULL) || (entry_ptr->next->prev != entry_ptr)))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed")
- }
-
- if ( ! entry_ptr->is_protected ) {
+ if(!entry_ptr->is_protected)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed")
- }
-
- if ( ( entry_ptr->is_read_only ) &&
- ( entry_ptr->ro_ref_count <= 0 ) ) {
+ if(entry_ptr->is_read_only && (entry_ptr->ro_ref_count <= 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 8 failed")
- }
len++;
size += entry_ptr->size;
entry_ptr = entry_ptr->next;
}
- if ( ( cache_ptr->pl_len != len ) ||
- ( cache_ptr->pl_size != size ) ) {
-
+ if((cache_ptr->pl_len != len) || (cache_ptr->pl_size != size))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 9 failed")
- }
done:
-
- if ( ret_value != SUCCEED ) {
-
+ if(ret_value != SUCCEED)
HDassert(0);
- }
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5C_validate_protected_entry_list() */
-
+} /* H5C__validate_protected_entry_list() */
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
/*-------------------------------------------------------------------------
*
- * Function: H5C_entry_in_skip_list
+ * Function: H5C__entry_in_skip_list
*
* Purpose: Debugging function that scans skip list to see if it
* is in present. We need this, as it is possible for
@@ -7556,49 +7418,39 @@ done:
*
* Programmer: John Mainzer, 11/1/14
*
- * Changes:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
#if H5C_DO_SLIST_SANITY_CHECKS
-
static hbool_t
-H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr)
+H5C__entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr)
{
- hbool_t in_slist = FALSE;
- H5SL_node_t * node_ptr = NULL;
- H5C_cache_entry_t * entry_ptr = NULL;
+ H5SL_node_t *node_ptr;
+ hbool_t in_slist;
- HDassert( cache_ptr );
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( cache_ptr->slist_ptr );
+ HDassert(cache_ptr);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ HDassert(cache_ptr->slist_ptr);
node_ptr = H5SL_first(cache_ptr->slist_ptr);
+ in_slist = FALSE;
+ while((node_ptr != NULL) && (!in_slist)) {
+ H5C_cache_entry_t *entry_ptr;
- while ( ( node_ptr != NULL ) && ( ! in_slist ) )
- {
entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
- HDassert( entry_ptr );
- HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC );
- HDassert( entry_ptr->is_dirty );
- HDassert( entry_ptr->in_slist );
-
- if ( entry_ptr == target_ptr ) {
+ HDassert(entry_ptr);
+ HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(entry_ptr->is_dirty);
+ HDassert(entry_ptr->in_slist);
+ if(entry_ptr == target_ptr)
in_slist = TRUE;
-
- } else {
-
+ else
node_ptr = H5SL_next(node_ptr);
- }
}
return(in_slist);
-
-} /* H5C_entry_in_skip_list() */
+} /* H5C__entry_in_skip_list() */
#endif /* H5C_DO_SLIST_SANITY_CHECKS */
@@ -8062,9 +7914,9 @@ H5C__serialize_cache(H5F_t *f)
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_DO_EXTREME_SANITY_CHECKS
- if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
- (H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
- (H5C_validate_lru_list(cache_ptr) < 0))
+ if((H5C__validate_protected_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_pinned_entry_list(cache_ptr) < 0) ||
+ (H5C__validate_lru_list(cache_ptr) < 0))
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -8502,7 +8354,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr)
{
haddr_t new_addr = HADDR_UNDEF;
@@ -8511,7 +8363,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr)
unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
diff --git a/src/H5CS.c b/src/H5CS.c
index 3fccce4..324d383 100644
--- a/src/H5CS.c
+++ b/src/H5CS.c
@@ -123,8 +123,6 @@ H5CS__get_stack(void)
* Programmer: Quincey Koziol
* Thursday, February 6, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -214,8 +212,6 @@ H5CS_push(const char *func_name)
* Programmer: Quincey Koziol
* Thursday, February 6, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5CX.c b/src/H5CX.c
index b78d9ec..6beaf56 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@lbl.gov>
+ * Programmer: Quincey Koziol
* Monday, February 19, 2018
*
* Purpose:
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index d5599f2..425bda3 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -1086,74 +1086,6 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr)
return;
} /* H5C_stats__reset() */
-extern void
-H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr,
- hbool_t dump_parents, const char *prefix, int indent);
-
-static void
-H5C__dump_parents(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr, const char *prefix, int indent)
-{
- unsigned u;
-
- for(u = 0; u < entry_ptr->flush_dep_nparents; u++)
- H5C__dump_entry(cache_ptr, entry_ptr->flush_dep_parent[u], TRUE, prefix, indent + 2);
-}
-
-typedef struct H5C__dump_child_ctx_t {
- H5C_t *cache_ptr;
- const H5C_cache_entry_t *parent;
- hbool_t dump_parents;
- const char *prefix;
- int indent;
-} H5C__dump_child_ctx_t;
-
-static int
-H5C__dump_children_cb(H5C_cache_entry_t *entry_ptr, void *_ctx)
-{
- H5C__dump_child_ctx_t *ctx = (H5C__dump_child_ctx_t *)_ctx;
-
- if(entry_ptr->tag_info->tag != entry_ptr->addr) {
- unsigned u;
-
- HDassert(entry_ptr->flush_dep_nparents);
- for(u = 0; u < entry_ptr->flush_dep_nparents; u++)
- if(ctx->parent == entry_ptr->flush_dep_parent[u])
- H5C__dump_entry(ctx->cache_ptr, entry_ptr, ctx->dump_parents, ctx->prefix, ctx->indent + 2);
- } /* end if */
-
- return(H5_ITER_CONT);
-} /* end H5C__dump_children_cb() */
-
-static void
-H5C__dump_children(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr,
- hbool_t dump_parents, const char *prefix, int indent)
-{
- H5C__dump_child_ctx_t ctx;
-
- HDassert(entry_ptr->tag_info);
-
- ctx.cache_ptr = cache_ptr;
- ctx.parent = entry_ptr;
- ctx.dump_parents = dump_parents;
- ctx.prefix = prefix;
- ctx.indent = indent;
- H5C__iter_tagged_entries(cache_ptr, entry_ptr->tag_info->tag, FALSE, H5C__dump_children_cb, &ctx);
-} /* end H5C__dump_children() */
-
-void
-H5C__dump_entry(H5C_t *cache_ptr, const H5C_cache_entry_t *entry_ptr,
- hbool_t dump_parents, const char *prefix, int indent)
-{
- HDassert(cache_ptr);
- HDassert(entry_ptr);
-
- HDfprintf(stderr, "%*s%s: entry_ptr = (%a, '%s', %a, %t, %u, %u/%u)\n", indent, "", prefix, entry_ptr->addr, entry_ptr->type->name, entry_ptr->tag_info ? entry_ptr->tag_info->tag : HADDR_UNDEF, entry_ptr->is_dirty, entry_ptr->flush_dep_nparents, entry_ptr->flush_dep_nchildren, entry_ptr->flush_dep_ndirty_children);
- if(dump_parents && entry_ptr->flush_dep_nparents)
- H5C__dump_parents(cache_ptr, entry_ptr, "Parent", indent);
- if(entry_ptr->flush_dep_nchildren)
- H5C__dump_children(cache_ptr, entry_ptr, FALSE, "Child", indent);
-} /* end H5C__dump_entry() */
-
/*-------------------------------------------------------------------------
* Function: H5C_flush_dependency_exists()
diff --git a/src/H5Cimage.c b/src/H5Cimage.c
index ee286d9..26cbe7d 100644
--- a/src/H5Cimage.c
+++ b/src/H5Cimage.c
@@ -864,54 +864,6 @@ H5C__free_image_entries_array(H5C_t * cache_ptr)
/*-------------------------------------------------------------------------
- * Function: H5C_force_cache_image_load()
- *
- * Purpose: On rare occasions, it is necessary to run
- * H5MF_tidy_self_referential_fsm_hack() prior to the first
- * metadata cache access. This is a problem as if there is a
- * cache image at the end of the file, that routine will
- * discard it.
- *
- * We solve this issue by calling this function, which will
- * load the cache image and then call
- * H5MF_tidy_self_referential_fsm_hack() to discard it.
- *
- * Return: SUCCEED on success, and FAIL on failure.
- *
- * Programmer: John Mainzer
- * 1/11/17
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5C_force_cache_image_load(H5F_t *f)
-{
- H5C_t *cache_ptr;
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Sanity checks */
- HDassert(f);
- HDassert(f->shared);
- cache_ptr = f->shared->cache;
- HDassert(cache_ptr);
- HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
- HDassert(cache_ptr->load_image);
-
- /* Load the cache image, if requested */
- if(cache_ptr->load_image) {
- cache_ptr->load_image = FALSE;
- if(H5C__load_cache_image(f) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image")
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5C_force_cache_image_load() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5C_get_cache_image_config
*
* Purpose: Copy the current configuration for cache image generation
diff --git a/src/H5Cmodule.h b/src/H5Cmodule.h
index 534404d..5b23490 100644
--- a/src/H5Cmodule.h
+++ b/src/H5Cmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h
index 8712af5..22c67ce 100644
--- a/src/H5Cpkg.h
+++ b/src/H5Cpkg.h
@@ -4911,8 +4911,6 @@ H5_DLL herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr);
H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, size_t space_needed,
hbool_t write_permitted);
H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f);
-H5_DLL herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr,
- H5C_cache_entry_t *entry_ptr);
H5_DLL herr_t H5C__serialize_cache(H5F_t *f);
H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global,
H5C_tag_iter_cb_t cb, void *cb_ctx);
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 0ba0234..f82f8df 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -20,8 +20,6 @@
* Purpose: Constants and typedefs available to the rest of the
* library.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -2243,7 +2241,6 @@ H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr,
unsigned flags);
H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags);
H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag);
-H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f);
H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global);
H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags);
H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag);
diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h
index 62107d9..565f41b 100644
--- a/src/H5Cpublic.h
+++ b/src/H5Cpublic.h
@@ -19,8 +19,6 @@
*
* Purpose: Public include file for cache functions.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5Cpublic_H
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index 098e01b..c80f90a 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, October 8, 1997
*
* Purpose: v1 B-tree indexed (chunked) I/O functions. The chunks are
@@ -338,7 +338,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->scaled, rt_key->scaled);
+ ret_value = H5VM__vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__btree_cmp2() */
@@ -620,8 +620,7 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* March 28, 2002
*
*-------------------------------------------------------------------------
diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c
index ccb786b..b9cf6cd 100644
--- a/src/H5Dbtree2.c
+++ b/src/H5Dbtree2.c
@@ -112,7 +112,7 @@ static herr_t H5D__bt2_found_cb(const void *nrecord, void *op_data);
*/
static herr_t H5D__bt2_remove_cb(const void *nrecord, void *_udata);
-/* Callback for H5B2_modify() which is called in H5D__bt2_idx_insert() */
+/* Callback for H5B2_update() which is called in H5D__bt2_idx_insert() */
static herr_t H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed);
/* Chunked layout indexing callbacks for v2 B-tree indexing */
@@ -256,7 +256,7 @@ H5D__bt2_crt_context(void *_udata)
* Compute the size required for encoding the size of a chunk,
* allowing for an extra byte, in case the filter makes the chunk larger.
*/
- ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
+ ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
if(ctx->chunk_size_len > 8)
ctx->chunk_size_len = 8;
@@ -355,7 +355,7 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result)
HDassert(rec2);
/* Compare the offsets but ignore the other fields */
- *result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled);
+ *result = H5VM__vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled);
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D__bt2_compare() */
@@ -773,7 +773,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info)
* Compute the size required for encoding the size of a chunk,
* allowing for an extra byte, in case the filter makes the chunk larger.
*/
- chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
+ chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
if(chunk_size_len > 8)
chunk_size_len = 8;
@@ -837,7 +837,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage)
* Function: H5D__bt2_mod_cb
*
* Purpose: Modify record for dataset chunk when it is found in a v2 B-tree.
- * This is the callback for H5B2_modify() which is called in
+ * This is the callback for H5B2_update() which is called in
* H5D__bt2_idx_insert().
*
* Return: Success: non-negative
@@ -1266,13 +1266,6 @@ done:
*
* Programmer: Vailin Choi; June 2010
*
- * Modifications:
- * Vailin Choi; March 2011
- * Initialize size of an unfiltered chunk.
- * This is a fix for for the assertion failure in:
- * [src/H5FSsection.c:968: H5FS_sect_link_size: Assertion `bin < sinfo->nbins' failed.]
- * which is uncovered by test_unlink_chunked_dataset() in test/unlink.c
- *
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 42ffd3e..88ff72b 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, April 24, 2008
*
* Purpose: Abstract indexed (chunked) I/O functions. The logical
@@ -278,7 +278,7 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]);
-/* format convert cb */
+/* Format convert cb */
static int H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
/* Helper routines */
@@ -300,9 +300,7 @@ static herr_t H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm,
const H5D_io_info_t *io_info);
static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm,
const H5D_io_info_t *io_info);
-
static herr_t H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm);
-
static herr_t H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm);
static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims,
const hsize_t *coords, void *fm);
@@ -327,8 +325,8 @@ static herr_t H5D__chunk_collective_fill(const H5D_t *dset,
static int H5D__chunk_cmp_addr(const void *addr1, const void *addr2);
#endif /* H5_HAVE_PARALLEL */
-static int
-H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
+/* Debugging helper routine callback */
+static int H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata);
/*********************/
/* Package Variables */
@@ -835,7 +833,7 @@ H5D__chunk_set_sizes(H5D_t *dset)
unsigned enc_bytes_per_dim; /* Number of bytes required to encode this dimension */
/* Get encoded size of dim, in bytes */
- enc_bytes_per_dim = (H5VM_log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8;
+ enc_bytes_per_dim = (H5VM__log2_gen(dset->shared->layout.u.chunk.dim[u]) + 8) / 8;
/* Check if this is the largest value so far */
if(enc_bytes_per_dim > max_enc_bytes_per_dim)
@@ -999,14 +997,14 @@ H5D__chunk_init(H5F_t *f, const H5D_t * const dset, hid_t dapl_id)
rdcc->scaled_dims[u] = (dset->shared->curr_dims[u] + dset->shared->layout.u.chunk.dim[u] - 1) /
dset->shared->layout.u.chunk.dim[u];
- if( !(scaled_power2up = H5VM_power2up(rdcc->scaled_dims[u])) )
+ if(!(scaled_power2up = H5VM__power2up(rdcc->scaled_dims[u])))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2")
/* Inital 'power2up' values for scaled dimensions */
rdcc->scaled_power2up[u] = scaled_power2up;
/* Number of bits required to encode scaled dimension size */
- rdcc->scaled_encode_bits[u] = H5VM_log2_gen(rdcc->scaled_power2up[u]);
+ rdcc->scaled_encode_bits[u] = H5VM__log2_gen(rdcc->scaled_power2up[u]);
} /* end for */
} /* end if */
@@ -2821,12 +2819,12 @@ H5D__chunk_flush(H5D_t *dset)
/* Loop over all entries in the chunk cache */
for(ent = rdcc->head; ent; ent = next) {
- next = ent->next;
+ next = ent->next;
if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0)
nerrors++;
} /* end for */
if(nerrors)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -2970,7 +2968,7 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
/* Reset index structures */
if((storage->ops->reset)(storage, reset_addr) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reset chunk index info")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -2992,7 +2990,7 @@ done:
static herr_t
H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last)
{
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(last);
@@ -3615,14 +3613,14 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush)
static herr_t
H5D__chunk_cache_prune(const H5D_t *dset, size_t size)
{
- const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
- size_t total = rdcc->nbytes_max;
- const int nmeth = 2; /*number of methods */
- int w[1]; /*weighting as an interval */
- H5D_rdcc_ent_t *p[2], *cur; /*list pointers */
- H5D_rdcc_ent_t *n[2]; /*list next pointers */
- int nerrors = 0; /* Accumulated error count during preemptions */
- herr_t ret_value = SUCCEED; /* Return value */
+ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk);
+ size_t total = rdcc->nbytes_max;
+ const int nmeth = 2; /* Number of methods */
+ int w[1]; /* Weighting as an interval */
+ H5D_rdcc_ent_t *p[2], *cur; /* List pointers */
+ H5D_rdcc_ent_t *n[2]; /* List next pointers */
+ int nerrors = 0; /* Accumulated error count during preemptions */
+ herr_t ret_value = SUCCEED;/* Return value */
FUNC_ENTER_STATIC
@@ -3643,62 +3641,62 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size)
while((p[0] || p[1]) && (rdcc->nbytes_used + size) > total) {
int i; /* Local index variable */
- /* Introduce new pointers */
- for(i = 0; i < nmeth - 1; i++)
+ /* Introduce new pointers */
+ for(i = 0; i < nmeth - 1; i++)
if(0 == w[i])
p[i + 1] = rdcc->head;
- /* Compute next value for each pointer */
- for(i = 0; i < nmeth; i++)
+ /* Compute next value for each pointer */
+ for(i = 0; i < nmeth; i++)
n[i] = p[i] ? p[i]->next : NULL;
- /* Give each method a chance */
- for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) {
- if(0 == i && p[0] && !p[0]->locked &&
+ /* Give each method a chance */
+ for(i = 0; i < nmeth && (rdcc->nbytes_used + size) > total; i++) {
+ if(0 == i && p[0] && !p[0]->locked &&
((0 == p[0]->rd_count && 0 == p[0]->wr_count) ||
- (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) ||
- (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) {
- /*
- * Method 0: Preempt entries that have been completely written
- * and/or completely read but not entries that are partially
- * written or partially read.
- */
- cur = p[0];
- } else if(1 == i && p[1] && !p[1]->locked) {
- /*
- * Method 1: Preempt the entry without regard to
- * considerations other than being locked. This is the last
- * resort preemption.
- */
- cur = p[1];
- } else {
- /* Nothing to preempt at this point */
- cur = NULL;
- }
+ (0 == p[0]->rd_count && dset->shared->layout.u.chunk.size == p[0]->wr_count) ||
+ (dset->shared->layout.u.chunk.size == p[0]->rd_count && 0 == p[0]->wr_count))) {
+ /*
+ * Method 0: Preempt entries that have been completely written
+ * and/or completely read but not entries that are partially
+ * written or partially read.
+ */
+ cur = p[0];
+ } else if(1 == i && p[1] && !p[1]->locked) {
+ /*
+ * Method 1: Preempt the entry without regard to
+ * considerations other than being locked. This is the last
+ * resort preemption.
+ */
+ cur = p[1];
+ } else {
+ /* Nothing to preempt at this point */
+ cur = NULL;
+ }
- if(cur) {
+ if(cur) {
int j; /* Local index variable */
- for(j = 0; j < nmeth; j++) {
- if(p[j] == cur)
+ for(j = 0; j < nmeth; j++) {
+ if(p[j] == cur)
p[j] = NULL;
- if(n[j] == cur)
+ if(n[j] == cur)
n[j] = cur->next;
- } /* end for */
- if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0)
+ } /* end for */
+ if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0)
nerrors++;
- } /* end if */
- } /* end for */
+ } /* end if */
+ } /* end for */
- /* Advance pointers */
- for(i = 0; i < nmeth; i++)
+ /* Advance pointers */
+ for(i = 0; i < nmeth; i++)
p[i] = n[i];
- for(i = 0; i < nmeth - 1; i++)
+ for(i = 0; i < nmeth - 1; i++)
w[i] -= 1;
} /* end while */
if(nerrors)
- HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry")
+ HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -4347,7 +4345,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
hbool_t unfilt_edge_chunk_dim[H5O_LAYOUT_NDIMS]; /* Whether there are unfiltered edge chunks at the edge of each dimension */
hsize_t edge_chunk_scaled[H5O_LAYOUT_NDIMS]; /* Offset of the unfiltered edge chunks at the edge of each dimension */
unsigned nunfilt_edge_chunk_dims = 0; /* Number of dimensions on an edge */
- const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk);
+ H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); /* Convenience variable */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -4556,9 +4554,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
#ifndef NDEBUG
/* None of the chunks should be allocated */
- if(H5D_CHUNK_IDX_NONE != sc->idx_type) {
+ if(H5D_CHUNK_IDX_NONE != sc->idx_type)
HDassert(!H5F_addr_defined(udata.chunk_block.offset));
- }
/* Make sure the chunk is really in the dataset and outside the
* original dimensions */
@@ -5132,8 +5129,8 @@ H5D__chunk_cmp_addr(const void *addr1, const void *addr2)
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- * March 26, 2002
+ * Programmer: Pedro Vicente
+ * March 26, 2002
*
*-------------------------------------------------------------------------
*/
@@ -5258,7 +5255,7 @@ done:
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Programmer: Pedro Vicente
* Algorithm: Robb Matzke
* March 27, 2002
*
@@ -5411,13 +5408,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
elmts_per_chunk = 1;
for(u = 0; u < space_ndims; u++) {
elmts_per_chunk *= layout->u.chunk.dim[u];
- chunk_dim[u] = layout->u.chunk.dim[u];
- shrunk_dim[u] = (space_dim[u] < old_dim[u]);
+ chunk_dim[u] = layout->u.chunk.dim[u];
+ shrunk_dim[u] = (space_dim[u] < old_dim[u]);
} /* end for */
/* Create a dataspace for a chunk & set the extent */
if(NULL == (chunk_space = H5S_create_simple(space_ndims, chunk_dim, NULL)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
/* Reset hyperslab start array */
/* (hyperslabs will always start from origin) */
@@ -5605,7 +5602,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim)
/* Remove the chunk from disk, if present */
if(H5F_addr_defined(chk_udata.chunk_block.offset)) {
/* Update the offset in idx_udata */
- idx_udata.scaled = udata.common.scaled;
+ idx_udata.scaled = udata.common.scaled;
/* Remove the chunk from disk */
if((sc->ops->remove)(&idx_info, &idx_udata) < 0)
@@ -5995,7 +5992,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata)
if(pline && pline->nused) {
must_filter = TRUE;
if((udata->common.layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) &&
- H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims))
+ H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, udata->common.layout->dim, chunk_rec->scaled, udata->dset_dims))
must_filter = FALSE;
}
@@ -6896,12 +6893,12 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- allow_chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8);
+ allow_chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)(idx_info->layout->size)) + 8) / 8);
if(allow_chunk_size_len > 8)
allow_chunk_size_len = 8;
/* Compute encoded size of chunk */
- new_chunk_size_len = (H5VM_log2_gen((uint64_t)(new_chunk->length)) + 8) / 8;
+ new_chunk_size_len = (H5VM__log2_gen((uint64_t)(new_chunk->length)) + 8) / 8;
if(new_chunk_size_len > 8)
HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "encoded chunk size is more than 8 bytes?!?")
@@ -6938,9 +6935,9 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old
} /* end else */
} /* end if */
else {
- HDassert(!H5F_addr_defined(new_chunk->offset));
- HDassert(new_chunk->length == idx_info->layout->size);
- alloc_chunk = TRUE;
+ HDassert(!H5F_addr_defined(new_chunk->offset));
+ HDassert(new_chunk->length == idx_info->layout->size);
+ alloc_chunk = TRUE;
} /* end else */
/* Actually allocate space for the chunk in the file */
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index 809cdfc..1792fa2 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <slu@ncsa.uiuc.edu>
+ * Programmer: Raymond Lu
* August 5, 2002
*
* Purpose: Compact dataset I/O functions. These routines are similar
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index 655f660..662be69 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, September 28, 2000
*
* Purpose:
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index f4f4223..7668389 100644
--- a/src/H5Ddeprec.c
+++ b/src/H5Ddeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Ddeprec.c
* April 5 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5D interface. These
* functions are here for compatibility purposes and may be
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index a53489e..56be6a7 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -252,7 +252,7 @@ H5D__earray_crt_context(void *_udata)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
+ ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
if(ctx->chunk_size_len > 8)
ctx->chunk_size_len = 8;
@@ -937,7 +937,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
+ chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
if(chunk_size_len > 8)
chunk_size_len = 8;
diff --git a/src/H5Defl.c b/src/H5Defl.c
index 91caa61..79cec8c 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, September 30, 2004
*/
@@ -336,9 +336,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, March 4, 1998
*
- * Modifications:
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index a9202c2..a79471a 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -248,7 +248,7 @@ H5D__farray_crt_context(void *_udata)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- ctx->chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
+ ctx->chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)udata->chunk_size) + 8) / 8);
if(ctx->chunk_size_len > 8)
ctx->chunk_size_len = 8;
@@ -892,7 +892,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info)
/* Compute the size required for encoding the size of a chunk, allowing
* for an extra byte, in case the filter makes the chunk larger.
*/
- chunk_size_len = 1 + ((H5VM_log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
+ chunk_size_len = 1 + ((H5VM__log2_gen((uint64_t)idx_info->layout->size) + 8) / 8);
if(chunk_size_len > 8)
chunk_size_len = 8;
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 94c7b1c..0efe98a 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -15,7 +15,7 @@
*
* Created: H5Dfill.c
* Jun 19 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Fill value operations for datasets
*
@@ -647,7 +647,7 @@ done:
static herr_t
H5D__fill_release(H5D_fill_buf_info_t *fb_info)
{
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check args */
HDassert(fb_info);
diff --git a/src/H5Dint.c b/src/H5Dint.c
index c063bb9..d662cec 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -97,6 +97,7 @@ static herr_t H5D__vlen_get_buf_size_cb(void *elem, hid_t type_id, unsigned ndim
const hsize_t *point, void *op_data);
static herr_t H5D__vlen_get_buf_size_gen_cb(void *elem, hid_t type_id, unsigned ndim,
const hsize_t *point, void *op_data);
+static herr_t H5D__check_filters(H5D_t *dataset);
/*********************/
@@ -671,7 +672,7 @@ H5D__cache_dataspace_info(const H5D_t *dset)
for(u = 0; u < dset->shared->ndims; u++) {
hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */
- if( !(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u])) )
+ if(!(scaled_power2up = H5VM__power2up(dset->shared->curr_dims[u])))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2")
dset->shared->curr_power2up[u] = scaled_power2up;
}
@@ -908,7 +909,7 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc)
HDassert(dset);
HDassert(oloc);
- oh = H5O__create_ohdr(file, dset->shared->dcpl_id);
+ oh = H5O_create_ohdr(file, dset->shared->dcpl_id);
if(NULL == oh)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't instantiate object header")
@@ -917,7 +918,7 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "computed header size is invalid")
/* Special allocation of space for compact datsets is handled by the call here. */
- if(H5O__apply_ohdr(file, oh, dset->shared->dcpl_id, ohdr_size, (size_t)1, oloc) == FAIL)
+ if(H5O_apply_ohdr(file, oh, dset->shared->dcpl_id, ohdr_size, (size_t)1, oloc) == FAIL)
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "can't apply object header to file")
done:
@@ -1022,7 +1023,8 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id)
if(TRUE == use_minimized_header) {
if(H5D__prepare_minimized_oh(file, dset, oloc) == FAIL)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create minimized dataset object header")
- } else {
+ } /* end if */
+ else {
/* Add the dataset's raw data size to the size of the header, if the
* raw data will be stored as compact
*/
@@ -2960,13 +2962,13 @@ done:
* Return: Non-negative on success/Negative on failure
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5D__check_filters(H5D_t *dataset)
{
H5O_fill_t *fill; /* Dataset's fill value */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_STATIC
/* Check args */
HDassert(dataset);
@@ -3086,14 +3088,14 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size)
dset->shared->cache.chunk.scaled_dims[dim_idx] > dset->shared->cache.chunk.nslots))
update_chunks = TRUE;
- if(!(scaled_power2up = H5VM_power2up(scaled)))
+ if(!(scaled_power2up = H5VM__power2up(scaled)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2")
/* Check if the number of bits required to encode the scaled size value changed */
if(dset->shared->cache.chunk.scaled_power2up[dim_idx] != scaled_power2up) {
/* Update the 'power2up' & 'encode_bits' values for the current dimension */
dset->shared->cache.chunk.scaled_power2up[dim_idx] = scaled_power2up;
- dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM_log2_gen(scaled_power2up);
+ dset->shared->cache.chunk.scaled_encode_bits[dim_idx] = H5VM__log2_gen(scaled_power2up);
/* Indicate that the cached chunk indices need to be updated */
update_chunks = TRUE;
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index cfed02e..e56f341 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -1342,9 +1342,9 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in
HDassert(fm);
/* Obtain the current rank of the process and the number of processes */
- if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0)
+ if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0)
HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank")
- if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0)
+ if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0)
HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size")
/* Set the actual-chunk-opt-mode property. */
@@ -1356,10 +1356,10 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in
H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE);
/* Build a list of selected chunks in the collective io operation */
- if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0)
+ if(H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list")
- if (io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */
+ if(io_info->op_type == H5D_IO_OP_WRITE) { /* Filtered collective write */
H5D_chk_idx_info_t index_info;
H5D_chunk_ud_t udata;
hsize_t mpi_buf_count;
@@ -1379,15 +1379,15 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in
* updating each chunk with the data modifications from other processes,
* then re-filtering the chunk.
*/
- for (i = 0; i < chunk_list_num_entries; i++)
- if (mpi_rank == chunk_list[i].owners.new_owner)
- if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0)
+ for(i = 0; i < chunk_list_num_entries; i++)
+ if(mpi_rank == chunk_list[i].owners.new_owner)
+ if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry")
/* Gather the new chunk sizes to all processes for a collective reallocation
* of the chunks in the file.
*/
- if (H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(H5D_filtered_collective_io_info_t),
+ if(H5D__mpio_array_gatherv(chunk_list, chunk_list_num_entries, sizeof(H5D_filtered_collective_io_info_t),
(void **) &collective_chunk_list, &collective_chunk_list_num_entries, true, 0, io_info->comm, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes")
@@ -1480,9 +1480,9 @@ done:
H5MM_free(collective_chunk_list);
/* Free the MPI buf and file types, if they were derived */
- if (mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type)))
+ if(mem_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&mem_type)))
HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
- if (file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type)))
+ if(file_type_is_derived && MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type)))
HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code)
FUNC_LEAVE_NOAPI(ret_value)
@@ -1770,9 +1770,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i
HDassert(fm);
/* Obtain the current rank of the process and the number of processes */
- if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0)
+ if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0)
HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank")
- if ((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0)
+ if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0)
HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size")
/* Set the actual chunk opt mode property */
@@ -1784,7 +1784,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i
H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE);
/* Build a list of selected chunks in the collective IO operation */
- if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0)
+ if(H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't construct filtered I/O info list")
/* Set up contiguous I/O info object */
@@ -1799,9 +1799,9 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i
/* Set dataset storage for I/O info */
io_info->store = &store;
- if (io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */
- for (i = 0; i < chunk_list_num_entries; i++)
- if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0)
+ if(io_info->op_type == H5D_IO_OP_READ) { /* Filtered collective read */
+ for(i = 0; i < chunk_list_num_entries; i++)
+ if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't process chunk entry")
} /* end if */
else { /* Filtered collective write */
@@ -1852,14 +1852,14 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i
/* Check if this process has a chunk to work on for this iteration */
hbool_t have_chunk_to_process = (i < chunk_list_num_entries) && (mpi_rank == chunk_list[i].owners.new_owner);
- if (have_chunk_to_process)
- if (H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0)
+ if(have_chunk_to_process)
+ if(H5D__filtered_collective_chunk_entry_io(&chunk_list[i], io_info, type_info, fm) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't process chunk entry")
/* Gather the new chunk sizes to all processes for a collective re-allocation
* of the chunks in the file
*/
- if (H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(H5D_filtered_collective_io_info_t),
+ if(H5D__mpio_array_gatherv(&chunk_list[i], have_chunk_to_process ? 1 : 0, sizeof(H5D_filtered_collective_io_info_t),
(void **) &collective_chunk_list, &collective_chunk_list_num_entries, true, 0, io_info->comm, NULL) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGATHER, FAIL, "couldn't gather new chunk sizes")
diff --git a/src/H5Dnone.c b/src/H5Dnone.c
index 40ddcb8..751d067 100644
--- a/src/H5Dnone.c
+++ b/src/H5Dnone.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Vailin Choi <vchoi@hdfgroup.org>
+/* Programmer: Vailin Choi
* September 2010
*
* Purpose: Implicit (Non Index) chunked I/O functions.
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 37a27d3..5efcc9b 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -234,8 +234,8 @@ typedef struct H5D_io_info_t {
typedef struct H5D_chk_idx_info_t {
H5F_t *f; /* File pointer for operation */
const H5O_pline_t *pline; /* I/O pipeline info */
- H5O_layout_chunk_t *layout; /* Chunk layout description */
- H5O_storage_chunk_t *storage; /* Chunk storage description */
+ H5O_layout_chunk_t *layout; /* Chunk layout description */
+ H5O_storage_chunk_t *storage; /* Chunk storage description */
} H5D_chk_idx_info_t;
/*
@@ -566,7 +566,6 @@ H5_DLL herr_t H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *coo
H5_DLL haddr_t H5D__get_offset(const H5D_t *dset);
H5_DLL herr_t H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size);
H5_DLL herr_t H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id, hsize_t *size);
-H5_DLL herr_t H5D__check_filters(H5D_t *dataset);
H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size);
H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset);
H5_DLL herr_t H5D__flush_real(H5D_t *dataset);
diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c
index 33274bb..cd71e93 100644
--- a/src/H5Dsingle.c
+++ b/src/H5Dsingle.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Vailin Choi <vchoi@hdfgroup.org>
+/* Programmer: Vailin Choi
* May 2011; updated 10/2015
*
* Purpose: Single Chunk I/O functions.
diff --git a/src/H5Dtest.c b/src/H5Dtest.c
index 916ec72..7c791d4 100644
--- a/src/H5Dtest.c
+++ b/src/H5Dtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Thursday, May 27, 2004
*
* Purpose: Dataset testing functions.
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c
index e07f538..799ee2b 100644
--- a/src/H5Dvirtual.c
+++ b/src/H5Dvirtual.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Neil Fortner <nfortne2@hdfgroup.org>
+ * Programmer: Neil Fortner
* Wednesday, January 28, 2015
*
* Purpose:
@@ -2238,7 +2238,7 @@ H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset)
size_t i, j; /* Local index variables */
hbool_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_PACKAGE_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity checks */
HDassert(shared_dset);
diff --git a/src/H5E.c b/src/H5E.c
index f204864..0f7a031 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -391,7 +391,7 @@ H5E__get_stack(void)
/*-------------------------------------------------------------------------
- * Function: H5E_free_class
+ * Function: H5E__free_class
*
* Purpose: Private function to free an error class.
*
@@ -403,9 +403,9 @@ H5E__get_stack(void)
*-------------------------------------------------------------------------
*/
static herr_t
-H5E_free_class(H5E_cls_t *cls)
+H5E__free_class(H5E_cls_t *cls)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(cls);
@@ -417,7 +417,7 @@ H5E_free_class(H5E_cls_t *cls)
cls = H5FL_FREE(H5E_cls_t, cls);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5E_free_class() */
+} /* end H5E__free_class() */
/*-------------------------------------------------------------------------
@@ -502,7 +502,7 @@ H5E__register_class(const char *cls_name, const char *lib_name, const char *vers
done:
if(!ret_value)
- if(cls && H5E_free_class(cls) < 0)
+ if(cls && H5E__free_class(cls) < 0)
HDONE_ERROR(H5E_ERROR, H5E_CANTRELEASE, NULL, "unable to free error class")
FUNC_LEAVE_NOAPI(ret_value)
@@ -572,7 +572,7 @@ H5E__unregister_class(H5E_cls_t *cls)
HGOTO_ERROR(H5E_ERROR, H5E_BADITER, FAIL, "unable to free all messages in this error class")
/* Free error class structure */
- if(H5E_free_class(cls) < 0)
+ if(H5E__free_class(cls) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTRELEASE, FAIL, "unable to free error class")
done:
diff --git a/src/H5EA.c b/src/H5EA.c
index 56663dc..a027792 100644
--- a/src/H5EA.c
+++ b/src/H5EA.c
@@ -15,7 +15,7 @@
*
* Created: H5EA.c
* Jun 17 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implements an "extensible array" for storing elements
* in an array whose high bounds can extend and shrink.
@@ -124,7 +124,6 @@ H5FL_BLK_DEFINE(ea_native_elmt);
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 10 2016
*
*-------------------------------------------------------------------------
@@ -190,7 +189,6 @@ END_FUNC(STATIC) /* end H5EA__new() */
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 17 2008
*
*-------------------------------------------------------------------------
@@ -241,7 +239,6 @@ END_FUNC(PRIV) /* end H5EA_create() */
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 28 2008
*
*-------------------------------------------------------------------------
@@ -283,7 +280,6 @@ END_FUNC(PRIV) /* end H5EA_open() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
@@ -314,7 +310,6 @@ END_FUNC(PRIV) /* end H5EA_get_nelmts() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
@@ -347,7 +342,6 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -559,7 +553,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend,
(page_idx * sblock->dblk_page_size);
/* Check if page has been initialized yet */
- if(!H5VM_bit_get(sblock->page_init, page_init_idx)) {
+ if(!H5VM__bit_get(sblock->page_init, page_init_idx)) {
/* Check if we are allowed to create the thing */
if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */
/* Create the data block page */
@@ -567,7 +561,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend,
H5E_THROW(H5E_CANTCREATE, "unable to create data block page")
/* Mark data block page as initialized in super block */
- H5VM_bit_set(sblock->page_init, page_init_idx, TRUE);
+ H5VM__bit_set(sblock->page_init, page_init_idx, TRUE);
sblock_cache_flags |= H5AC__DIRTIED_FLAG;
} /* end if */
else
@@ -656,7 +650,6 @@ END_FUNC(STATIC) /* end H5EA__lookup_elmt() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -721,7 +714,6 @@ END_FUNC(PRIV) /* end H5EA_set() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -786,7 +778,6 @@ END_FUNC(PRIV) /* end H5EA_get() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* May 27 2009
*
*-------------------------------------------------------------------------
@@ -836,7 +827,6 @@ END_FUNC(PRIV) /* end H5EA_depend() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
@@ -937,7 +927,6 @@ END_FUNC(PRIV) /* end H5EA_close() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 28 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index affa127..f7534fb 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -15,7 +15,7 @@
*
* Created: H5EAcache.c
* Aug 26 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement extensible array metadata cache methods.
*
@@ -239,7 +239,6 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -305,7 +304,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -429,7 +427,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -459,7 +456,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -606,7 +602,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 16, 2013
*
*-------------------------------------------------------------------------
@@ -635,7 +630,6 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -708,7 +702,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -815,7 +808,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -845,7 +837,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -932,7 +923,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1001,7 +991,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1030,7 +1019,6 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1122,7 +1110,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1226,7 +1213,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1256,7 +1242,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1330,7 +1315,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 31 2009
*
*-------------------------------------------------------------------------
@@ -1414,7 +1398,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1443,7 +1426,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1536,7 +1518,6 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1639,7 +1620,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1672,7 +1652,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1744,7 +1723,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 31 2009
*
*-------------------------------------------------------------------------
@@ -1828,7 +1806,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1904,7 +1881,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -1970,7 +1946,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -2043,7 +2018,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -2073,7 +2047,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -2125,7 +2098,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 31 2009
*
*-------------------------------------------------------------------------
@@ -2209,7 +2181,6 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c
index 6dd2e98..ee5c904 100644
--- a/src/H5EAdblkpage.c
+++ b/src/H5EAdblkpage.c
@@ -15,7 +15,7 @@
*
* Created: H5EAdblkpage.c
* Nov 20 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Data block page routines for extensible arrays.
*
@@ -91,7 +91,6 @@ H5FL_DEFINE_STATIC(H5EA_dblk_page_t);
* Return: Non-NULL pointer to data block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -141,7 +140,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */
* Return: Valid file address on success/HADDR_UNDEF on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -206,7 +204,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */
* Return: Non-NULL pointer to data block page on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -267,7 +264,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
@@ -298,7 +294,6 @@ END_FUNC(PKG) /* end H5EA__dblk_page_unprotect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 20 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c
index d926fd5..c72dc7c 100644
--- a/src/H5EAdblock.c
+++ b/src/H5EAdblock.c
@@ -15,7 +15,7 @@
*
* Created: H5EAdblock.c
* Sep 11 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Data block routines for extensible arrays.
*
@@ -92,7 +92,6 @@ H5FL_DEFINE_STATIC(H5EA_dblock_t);
* Return: Non-NULL pointer to data block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -153,7 +152,6 @@ END_FUNC(PKG) /* end H5EA__dblock_alloc() */
* Return: Valid file address on success/HADDR_UNDEF on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -248,7 +246,6 @@ END_FUNC(PKG) /* end H5EA__dblock_create() */
* Return: Super block index on success/Can't fail
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -269,7 +266,7 @@ H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx))
/* Determine the superblock information for the index */
H5_CHECK_OVERFLOW(idx, /*From:*/hsize_t, /*To:*/uint64_t);
- sblk_idx = H5VM_log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1));
+ sblk_idx = H5VM__log2_gen((uint64_t)((idx / hdr->cparam.data_blk_min_elmts) + 1));
/* Set return value */
ret_value = sblk_idx;
@@ -285,7 +282,6 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */
* Return: Non-NULL pointer to data block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 18 2008
*
*-------------------------------------------------------------------------
@@ -348,7 +344,6 @@ END_FUNC(PKG) /* end H5EA__dblock_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
@@ -379,7 +374,6 @@ END_FUNC(PKG) /* end H5EA__dblock_unprotect() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 22 2008
*
*-------------------------------------------------------------------------
@@ -442,7 +436,6 @@ END_FUNC(PKG) /* end H5EA__dblock_delete() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index ec40298..07330c1 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -15,7 +15,7 @@
*
* Created: H5EAhdr.c
* Aug 26 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Array header routines for extensible arrays.
*
@@ -110,7 +110,6 @@ H5FL_SEQ_DEFINE_STATIC(H5EA_sblk_info_t);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -180,7 +179,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 18 2008
*
*-------------------------------------------------------------------------
@@ -201,7 +199,7 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata))
HDassert(hdr->cparam.sup_blk_min_data_ptrs);
/* Compute general information */
- hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts));
+ hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM__log2_of2(hdr->cparam.data_blk_min_elmts));
hdr->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits;
hdr->arr_off_size = (unsigned char)H5EA_SIZEOF_OFFSET_BITS(hdr->cparam.max_nelmts_bits);
@@ -245,7 +243,6 @@ END_FUNC(PKG) /* end H5EA__hdr_init() */
* Return: Non-NULL pointer to buffer for elements on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 16 2008
*
*-------------------------------------------------------------------------
@@ -264,7 +261,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
+ idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
/* Check for needing to increase size of array of factories */
if(idx >= hdr->elmt_fac.nalloc) {
@@ -312,7 +309,6 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc_elmts() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 18 2008
*
*-------------------------------------------------------------------------
@@ -331,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
+ idx = H5VM__log2_of2((uint32_t)nelmts) - H5VM__log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
/* Free buffer for elements in index block */
HDassert(idx < hdr->elmt_fac.nalloc);
@@ -349,7 +345,6 @@ END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 17 2008
*
*-------------------------------------------------------------------------
@@ -464,7 +459,6 @@ END_FUNC(PKG) /* end H5EA__hdr_create() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -497,7 +491,6 @@ END_FUNC(PKG) /* end H5EA__hdr_incr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -533,7 +526,6 @@ END_FUNC(PKG) /* end H5EA__hdr_decr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -559,7 +551,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_incr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -589,7 +580,6 @@ END_FUNC(PKG) /* end H5EA__hdr_fuse_decr() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -619,7 +609,6 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */
* Return: Non-NULL pointer to header on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jul 31 2013
*
*-------------------------------------------------------------------------
@@ -677,7 +666,6 @@ END_FUNC(PKG) /* end H5EA__hdr_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 1 2013
*
*-------------------------------------------------------------------------
@@ -708,7 +696,6 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 26 2008
*
*-------------------------------------------------------------------------
@@ -765,7 +752,6 @@ END_FUNC(PKG) /* end H5EA__hdr_delete() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c
index 1b5957a..c45d15a 100644
--- a/src/H5EAiblock.c
+++ b/src/H5EAiblock.c
@@ -15,7 +15,7 @@
*
* Created: H5EAiblock.c
* Sep 9 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Index block routines for extensible arrays.
*
@@ -42,7 +42,7 @@
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File memory management */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
@@ -98,7 +98,6 @@ H5FL_SEQ_DEFINE_STATIC(haddr_t);
* Return: Non-NULL pointer to index block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -129,11 +128,6 @@ H5EA__iblock_alloc(H5EA_hdr_t *hdr))
iblock->nsblks = H5EA_SBLK_FIRST_IDX(hdr->cparam.sup_blk_min_data_ptrs);
iblock->ndblk_addrs = 2 * ((size_t)hdr->cparam.sup_blk_min_data_ptrs - 1);
iblock->nsblk_addrs = hdr->nsblks - iblock->nsblks;
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock->nsblks = %u\n", FUNC, iblock->nsblks);
-HDfprintf(stderr, "%s: iblock->ndblk_addrs = %Zu\n", FUNC, iblock->ndblk_addrs);
-HDfprintf(stderr, "%s: iblock->nsblk_addrs = %Zu\n", FUNC, iblock->nsblk_addrs);
-#endif /* QAK */
/* Allocate buffer for elements in index block */
if(hdr->cparam.idx_blk_elmts > 0)
@@ -169,7 +163,6 @@ END_FUNC(PKG) /* end H5EA__iblock_alloc() */
* Return: Valid file address on success/HADDR_UNDEF on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -183,10 +176,6 @@ H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed))
haddr_t iblock_addr; /* Extensible array index block address */
hbool_t inserted = FALSE; /* Whether the header was inserted into cache */
-#ifdef QAK
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Sanity check */
HDassert(hdr);
HDassert(stats_changed);
@@ -197,9 +186,6 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
/* Set size of index block on disk */
iblock->size = H5EA_IBLOCK_SIZE(iblock);
-#ifdef QAK
-HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size);
-#endif /* QAK */
/* Allocate space for the index block on disk */
if(HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, (hsize_t)iblock->size)))
@@ -284,7 +270,6 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */
* Return: Non-NULL pointer to index block on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -296,10 +281,6 @@ H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags))
/* Local variables */
H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
-#ifdef QAK
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Sanity check */
HDassert(hdr);
@@ -340,7 +321,6 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -351,10 +331,6 @@ H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags))
/* Local variables */
-#ifdef QAK
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Sanity check */
HDassert(iblock);
@@ -375,7 +351,6 @@ END_FUNC(PKG) /* end H5EA__iblock_unprotect() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2008
*
*-------------------------------------------------------------------------
@@ -387,10 +362,6 @@ H5EA__iblock_delete(H5EA_hdr_t *hdr))
/* Local variables */
H5EA_iblock_t *iblock = NULL; /* Pointer to index block */
-#ifdef QAK
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/* Sanity check */
HDassert(hdr);
HDassert(H5F_addr_defined(hdr->idx_blk_addr));
@@ -459,7 +430,6 @@ END_FUNC(PKG) /* end H5EA__iblock_delete() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5EAint.c b/src/H5EAint.c
index 2baf1f4..ef8cd7a 100644
--- a/src/H5EAint.c
+++ b/src/H5EAint.c
@@ -15,7 +15,7 @@
*
* Created: H5EAint.c
* Jun 17 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Internal routines for extnsible arrays.
*
@@ -86,7 +86,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26 2009
*
*-------------------------------------------------------------------------
@@ -116,7 +115,6 @@ END_FUNC(PKG) /* end H5EA__create_flush_depend() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Mar 26 2009
*
*-------------------------------------------------------------------------
diff --git a/src/H5EApkg.h b/src/H5EApkg.h
index b70231d..ad1fdfc 100644
--- a/src/H5EApkg.h
+++ b/src/H5EApkg.h
@@ -146,7 +146,7 @@
#define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8)
/* Compute the first super block index that will hold a certain # of data block pointers */
-#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM_log2_of2((uint32_t)m))
+#define H5EA_SBLK_FIRST_IDX(m) (2 * H5VM__log2_of2((uint32_t)m))
/****************************/
/* Package Private Typedefs */
diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c
index fb7c458..b5b9d94 100644
--- a/src/H5EAsblock.c
+++ b/src/H5EAsblock.c
@@ -42,7 +42,7 @@
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
#include "H5MFprivate.h" /* File memory management */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5VMprivate.h" /* Vectors and arrays */
/****************/
diff --git a/src/H5EAstat.c b/src/H5EAstat.c
index 509d3f8..68e0b1e 100644
--- a/src/H5EAstat.c
+++ b/src/H5EAstat.c
@@ -15,7 +15,7 @@
*
* Created: H5EAstat.c
* Sep 11 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Extensible array metadata statistics functions.
*
@@ -87,7 +87,6 @@
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 21 2008
*
*-------------------------------------------------------------------------
@@ -98,10 +97,6 @@ H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats))
/* Local variables */
-#ifdef QAK
-HDfprintf(stderr, "%s: Called\n", FUNC);
-#endif /* QAK */
-
/*
* Check arguments.
*/
diff --git a/src/H5EAtest.c b/src/H5EAtest.c
index 8926d6a..a0802bc 100644
--- a/src/H5EAtest.c
+++ b/src/H5EAtest.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@hdfgroup.org>
+/* Programmer: Quincey Koziol
* Thursday, August 28, 2008
*
* Purpose: Extensible array testing functions.
@@ -38,7 +38,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5EApkg.h" /* Extensible Arrays */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c
index 4462303..437c431 100644
--- a/src/H5Edeprec.c
+++ b/src/H5Edeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Edeprec.c
* April 11 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5E interface. These
* functions are here for compatibility purposes and may be
diff --git a/src/H5Eint.c b/src/H5Eint.c
index 2371a5f..cf1d649 100644
--- a/src/H5Eint.c
+++ b/src/H5Eint.c
@@ -15,7 +15,7 @@
*
* Created: H5Eint.c
* April 11 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: General use, "internal" routines for error handling.
*
diff --git a/src/H5Emodule.h b/src/H5Emodule.h
index 2d1bcd0..fbfc262 100644
--- a/src/H5Emodule.h
+++ b/src/H5Emodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5Epkg.h b/src/H5Epkg.h
index 83f3816..eac5829 100644
--- a/src/H5Epkg.h
+++ b/src/H5Epkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Wednesday, April 11, 2007
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5FA.c b/src/H5FA.c
index f8bb094..871793e 100644
--- a/src/H5FA.c
+++ b/src/H5FA.c
@@ -15,7 +15,7 @@
*
* Created: H5FA.c
* April 2009
- * Vailin Choi <vchoi@hdfgroup.org>
+ * Vailin Choi
*
* Purpose: Implements a Fixed Array for storing elements
* of datasets with fixed dimensions.
@@ -112,7 +112,6 @@ H5FL_BLK_DEFINE(fa_native_elmt);
* NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 17 2016
*
*-------------------------------------------------------------------------
@@ -396,13 +395,13 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt))
dblk_page_nelmts = dblock->dblk_page_nelmts;
/* Check if the page has been created yet */
- if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
+ if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) {
/* Create the data block page */
if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0)
H5E_THROW(H5E_CANTCREATE, "unable to create data block page")
/* Mark data block page as initialized in data block */
- H5VM_bit_set(dblock->dblk_page_init, page_idx, TRUE);
+ H5VM__bit_set(dblock->dblk_page_init, page_idx, TRUE);
dblock_cache_flags |= H5AC__DIRTIED_FLAG;
} /* end if */
@@ -483,7 +482,7 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt))
page_idx = (size_t)(idx / dblock->dblk_page_nelmts);
/* Check if the page is defined yet */
- if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
+ if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) {
/* Call the class's 'fill' callback */
if((hdr->cparam.cls->fill)(elmt, (size_t)1) < 0)
H5E_THROW(H5E_CANTSET, "can't set element to class's fill value")
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 8f5e696..90770fb 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -15,7 +15,7 @@
*
* Created: H5FAcache.c
* Jul 2 2009
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement fixed array metadata cache methods.
*
@@ -180,7 +180,6 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 31, 2013
*
*-------------------------------------------------------------------------
@@ -246,7 +245,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -359,7 +357,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -389,7 +386,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -527,7 +523,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_notify() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -556,7 +551,6 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_free_icr() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 12, 2013
*
*-------------------------------------------------------------------------
@@ -644,7 +638,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -744,7 +737,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -777,7 +769,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_image_len() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -924,7 +915,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_notify() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1001,7 +991,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_fsf_size() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1068,7 +1057,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_verify_chksum() */
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1141,7 +1129,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1171,7 +1158,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1223,7 +1209,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_serialize() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* Oct 17 2016
*
*-------------------------------------------------------------------------
@@ -1286,7 +1271,6 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_notify() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c
index b578cf2..431e6fa 100644
--- a/src/H5FAdbg.c
+++ b/src/H5FAdbg.c
@@ -229,7 +229,7 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent,
/* Read and print each page's elements in the data block */
for(page_idx = 0; page_idx < dblock->npages; page_idx++) {
- if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) {
+ if(!H5VM__bit_get(dblock->dblk_page_init, page_idx)) {
HDfprintf(stream, "%*s%-*s %Hu %s\n", indent, "", fwidth,
"Page %Zu:", page_idx, "empty");
diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c
index 506c767..b25d50b 100644
--- a/src/H5FAhdr.c
+++ b/src/H5FAhdr.c
@@ -414,7 +414,6 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */
* Return: Non-NULL pointer to header on success/NULL on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2013
*
*-------------------------------------------------------------------------
@@ -471,7 +470,6 @@ END_FUNC(PKG) /* end H5FA__hdr_protect() */
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Aug 12 2013
*
*-------------------------------------------------------------------------
@@ -491,7 +489,7 @@ H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags))
CATCH
-END_FUNC(PKG) /* end H5EA__hdr_unprotect() */
+END_FUNC(PKG) /* end H5FA__hdr_unprotect() */
/*-------------------------------------------------------------------------
diff --git a/src/H5FAint.c b/src/H5FAint.c
index 9d3bce8..3a1375a 100644
--- a/src/H5FAint.c
+++ b/src/H5FAint.c
@@ -15,7 +15,7 @@
*
* Created: H5FAint.c
* Fall 2012
- * Dana Robinson <derobins@hdfgroup.org>
+ * Dana Robinson
*
* Purpose: Internal routines for fixed arrays.
*
diff --git a/src/H5FAmodule.h b/src/H5FAmodule.h
index f675faf..57a85b1 100644
--- a/src/H5FAmodule.h
+++ b/src/H5FAmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5FAstat.c b/src/H5FAstat.c
index 49a56a9..882da99 100644
--- a/src/H5FAstat.c
+++ b/src/H5FAstat.c
@@ -35,9 +35,9 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FApkg.h" /* Fixed Arrays */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FApkg.h" /* Fixed Arrays */
#include "H5MMprivate.h" /* Memory management */
diff --git a/src/H5FAtest.c b/src/H5FAtest.c
index e55d408..2bcdc01 100644
--- a/src/H5FAtest.c
+++ b/src/H5FAtest.c
@@ -36,7 +36,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5FApkg.h" /* Fixed Arrays */
#include "H5FLprivate.h" /* Free Lists */
-#include "H5VMprivate.h" /* Vector functions */
+#include "H5VMprivate.h" /* Vector functions */
/****************/
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 0551dd0..2afe7ea 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Tuesday, August 10, 1999
*
* Purpose: A driver which stores the HDF5 data in main memory using
@@ -144,8 +144,8 @@ static herr_t H5FD__core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, ha
size_t size, const void *buf);
static herr_t H5FD__core_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_core_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_core_unlock(H5FD_t *_file);
+static herr_t H5FD__core_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__core_unlock(H5FD_t *_file);
static const H5FD_class_t H5FD_core_g = {
"core", /* name */
@@ -177,8 +177,8 @@ static const H5FD_class_t H5FD_core_g = {
H5FD__core_write, /* write */
H5FD__core_flush, /* flush */
H5FD__core_truncate, /* truncate */
- H5FD_core_lock, /* lock */
- H5FD_core_unlock, /* unlock */
+ H5FD__core_lock, /* lock */
+ H5FD__core_unlock, /* unlock */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -345,7 +345,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size)
HDoff_t offset = (HDoff_t)addr; /* Offset to write at */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -414,7 +414,7 @@ H5FD__init_package(void)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(H5FD_core_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize core VFD")
@@ -1581,7 +1581,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_core_lock
+ * Function: H5FD__core_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -1595,13 +1595,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_core_lock(H5FD_t *_file, hbool_t rw)
+H5FD__core_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */
int lock_flags; /* file locking flags */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1609,7 +1609,6 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw)
* descriptor, this is a no-op.
*/
if(file->fd >= 0) {
-
/* Set exclusive or shared lock based on rw status */
lock_flags = rw ? LOCK_EX : LOCK_SH;
@@ -1620,16 +1619,15 @@ H5FD_core_lock(H5FD_t *_file, hbool_t rw)
else
HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file")
} /* end if */
-
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_core_lock() */
+} /* end H5FD__core_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_core_unlock
+ * Function: H5FD__core_unlock
*
* Purpose: To remove the existing lock on the file
*
@@ -1640,17 +1638,16 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_core_unlock(H5FD_t *_file)
+H5FD__core_unlock(H5FD_t *_file)
{
H5FD_core_t *file = (H5FD_core_t*)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
- if(file->fd >= 0) {
-
+ if(file->fd >= 0)
if(HDflock(file->fd, LOCK_UN) < 0) {
if(ENOSYS == errno)
HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "file locking disabled on this file system (use HDF5_USE_FILE_LOCKING environment variable to override)")
@@ -1658,9 +1655,7 @@ H5FD_core_unlock(H5FD_t *_file)
HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file")
} /* end if */
- } /* end if */
-
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_core_unlock() */
+} /* end H5FD__core_unlock() */
diff --git a/src/H5FDcore.h b/src/H5FDcore.h
index 5fe2912..63b6f27 100644
--- a/src/H5FDcore.h
+++ b/src/H5FDcore.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the core driver.
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 34c4346..1dbf857 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <slu@hdfgroup.uiuc.edu>
+ * Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
* Purpose: The Direct I/O file driver forces the data to be written to
@@ -23,15 +23,15 @@
#include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fprivate.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FDdirect.h" /* Direct file driver */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Pprivate.h" /* Property lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fprivate.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FDdirect.h" /* Direct file driver */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
#ifdef H5_HAVE_DIRECT
@@ -109,69 +109,68 @@ typedef struct H5FD_direct_t {
* which can be addressed entirely by the second
* argument of the file seek function.
*/
-#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
-#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \
- ((A) & ~(haddr_t)MAXADDR))
+#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
+#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR))
#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR)
-#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \
- HADDR_UNDEF==(A)+(Z) || \
- (HDoff_t)((A)+(Z))<(HDoff_t)(A))
+#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \
+ HADDR_UNDEF == (A) + (Z) || \
+ (HDoff_t)((A) + (Z)) < (HDoff_t)(A))
/* Prototypes */
-static herr_t H5FD_direct_term(void);
-static void *H5FD_direct_fapl_get(H5FD_t *file);
-static void *H5FD_direct_fapl_copy(const void *_old_fa);
-static H5FD_t *H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id,
+static herr_t H5FD__direct_term(void);
+static void *H5FD__direct_fapl_get(H5FD_t *file);
+static void *H5FD__direct_fapl_copy(const void *_old_fa);
+static H5FD_t *H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
-static herr_t H5FD_direct_close(H5FD_t *_file);
-static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_direct_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
-static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
+static herr_t H5FD__direct_close(H5FD_t *_file);
+static int H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__direct_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__direct_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
+static herr_t H5FD__direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, void *buf);
-static herr_t H5FD_direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
+static herr_t H5FD__direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, const void *buf);
-static herr_t H5FD_direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_direct_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_direct_unlock(H5FD_t *_file);
+static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__direct_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__direct_unlock(H5FD_t *_file);
static const H5FD_class_t H5FD_direct_g = {
- "direct", /*name */
- MAXADDR, /*maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_direct_term, /*terminate */
- NULL, /*sb_size */
- NULL, /*sb_encode */
- NULL, /*sb_decode */
- sizeof(H5FD_direct_fapl_t), /*fapl_size */
- H5FD_direct_fapl_get, /*fapl_get */
- H5FD_direct_fapl_copy, /*fapl_copy */
- NULL, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_direct_open, /*open */
- H5FD_direct_close, /*close */
- H5FD_direct_cmp, /*cmp */
- H5FD_direct_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD_direct_get_eoa, /*get_eoa */
- H5FD_direct_set_eoa, /*set_eoa */
- H5FD_direct_get_eof, /*get_eof */
- H5FD_direct_get_handle, /*get_handle */
- H5FD_direct_read, /*read */
- H5FD_direct_write, /*write */
- NULL, /*flush */
- H5FD_direct_truncate, /*truncate */
- H5FD_direct_lock, /*lock */
- H5FD_direct_unlock, /*unlock */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ "direct", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__direct_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ sizeof(H5FD_direct_fapl_t), /* fapl_size */
+ H5FD__direct_fapl_get, /* fapl_get */
+ H5FD__direct_fapl_copy, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__direct_open, /* open */
+ H5FD__direct_close, /* close */
+ H5FD__direct_cmp, /* cmp */
+ H5FD__direct_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__direct_get_eoa, /* get_eoa */
+ H5FD__direct_set_eoa, /* set_eoa */
+ H5FD__direct_get_eof, /* get_eof */
+ H5FD__direct_get_handle, /* get_handle */
+ H5FD__direct_read, /* read */
+ H5FD__direct_write, /* write */
+ NULL, /* flush */
+ H5FD__direct_truncate, /* truncate */
+ H5FD__direct_lock, /* lock */
+ H5FD__direct_unlock, /* unlock */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/* Declare a free list to manage the H5FD_direct_t struct */
@@ -238,7 +237,7 @@ done:
/*---------------------------------------------------------------------------
- * Function: H5FD_direct_term
+ * Function: H5FD__direct_term
*
* Purpose: Shut down the VFD
*
@@ -250,15 +249,15 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_term(void)
+H5FD__direct_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_DIRECT_g=0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_direct_term() */
+} /* end H5FD__direct_term() */
/*-------------------------------------------------------------------------
@@ -361,7 +360,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_fapl_get
+ * Function: H5FD__direct_fapl_get
*
* Purpose: Returns a file access property list which indicates how the
* specified file is being accessed. The return list could be
@@ -375,28 +374,26 @@ done:
* Programmer: Raymond Lu
* Wednesday, 18 October 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_direct_fapl_get(H5FD_t *_file)
+H5FD__direct_fapl_get(H5FD_t *_file)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file;
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Set return value */
- ret_value= H5FD_direct_fapl_copy(&(file->fa));
+ ret_value= H5FD__direct_fapl_copy(&(file->fa));
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_fapl_get() */
+} /* end H5FD__direct_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_fapl_copy
+ * Function: H5FD__direct_fapl_copy
*
* Purpose: Copies the direct-specific file access properties.
*
@@ -407,17 +404,15 @@ done:
* Programmer: Raymond Lu
* Wednesday, 18 October 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_direct_fapl_copy(const void *_old_fa)
+H5FD__direct_fapl_copy(const void *_old_fa)
{
const H5FD_direct_fapl_t *old_fa = (const H5FD_direct_fapl_t*)_old_fa;
H5FD_direct_fapl_t *new_fa = H5MM_calloc(sizeof(H5FD_direct_fapl_t));
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(new_fa);
@@ -425,11 +420,11 @@ H5FD_direct_fapl_copy(const void *_old_fa)
H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t));
FUNC_LEAVE_NOAPI(new_fa)
-} /* end H5FD_direct_fapl_copy() */
+} /* end H5FD__direct_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_open
+ * Function: H5FD__direct_open
*
* Purpose: Create and/or opens a Unix file for direct I/O as an HDF5 file.
*
@@ -442,12 +437,10 @@ H5FD_direct_fapl_copy(const void *_old_fa)
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
int o_flags;
int fd=(-1);
@@ -462,7 +455,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd
void *buf1, *buf2;
H5FD_t *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check on file offsets */
HDassert(sizeof(HDoff_t)>=sizeof(size_t));
@@ -577,7 +570,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_close
+ * Function: H5FD__direct_close
*
* Purpose: Closes the file.
*
@@ -588,17 +581,15 @@ done:
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_close(H5FD_t *_file)
+H5FD__direct_close(H5FD_t *_file)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if (HDclose(file->fd)<0)
HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file")
@@ -611,7 +602,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_cmp
+ * Function: H5FD__direct_cmp
*
* Purpose: Compares two files belonging to this driver using an
* arbitrary (but consistent) ordering.
@@ -624,18 +615,16 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
-H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_direct_t *f1 = (const H5FD_direct_t*)_f1;
const H5FD_direct_t *f2 = (const H5FD_direct_t*)_f2;
int ret_value=0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#ifdef H5_HAVE_WIN32_API
if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1)
@@ -668,7 +657,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_query
+ * Function: H5FD__direct_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -680,14 +669,12 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_query(const H5FD_t H5_ATTR_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
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
if(flags) {
@@ -704,7 +691,7 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_get_eoa
+ * Function: H5FD__direct_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -717,26 +704,21 @@ H5FD_direct_query(const H5FD_t H5_ATTR_UNUSED * _f, unsigned long *flags /* out
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- * Raymond Lu
- * 21 Dec. 2006
- * Added the parameter TYPE. It's only used for MULTI driver.
- *
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_set_eoa
+ * Function: H5FD__direct_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -749,19 +731,14 @@ H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- * Raymond Lu
- * 21 Dec. 2006
- * Added the parameter TYPE. It's only used for MULTI driver.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
file->eoa = addr;
@@ -770,7 +747,7 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_get_eof
+ * Function: H5FD__direct_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the Unix end-of-file or the HDF5 end-of-address
@@ -785,16 +762,14 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
* Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
FUNC_LEAVE_NOAPI(file->eof)
}
@@ -810,17 +785,15 @@ H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
* Programmer: Raymond Lu
* 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_get_handle(H5FD_t *_file, hid_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
@@ -832,7 +805,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_read
+ * Function: H5FD__direct_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
* into buffer BUF according to data transfer properties in
@@ -846,12 +819,10 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_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;
@@ -867,7 +838,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
size_t copy_size = size; /* Size remaining to read when using copy buffer */
size_t copy_offset; /* Offset into copy buffer of the requested data */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -1018,7 +989,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_write
+ * Function: H5FD__direct_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -1031,12 +1002,10 @@ done:
* Programmer: Raymond Lu
* Thursday, 21 September 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_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;
@@ -1055,7 +1024,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U
size_t copy_size = size; /* Size remaining to write when using copy buffer */
size_t copy_offset; /* Offset into copy buffer of the data to write */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -1253,7 +1222,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_truncate
+ * Function: H5FD__direct_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -1268,12 +1237,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_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 */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1314,11 +1283,11 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATT
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_truncate() */
+} /* end H5FD__direct_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_lock
+ * Function: H5FD__direct_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -1332,13 +1301,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_lock(H5FD_t *_file, hbool_t rw)
+H5FD__direct_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */
const int lock = rw ? LOCK_EX : LOCK_SH;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1348,11 +1317,11 @@ H5FD_direct_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_lock() */
+} /* end H5FD__direct_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_direct_unlock
+ * Function: H5FD__direct_unlock
*
* Purpose: To remove the existing lock on the file
*
@@ -1363,12 +1332,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_direct_unlock(H5FD_t *_file)
+H5FD__direct_unlock(H5FD_t *_file)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1377,7 +1346,7 @@ H5FD_direct_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_direct_unlock() */
+} /* end H5FD__direct_unlock() */
#endif /* H5_HAVE_DIRECT */
diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h
index 805f3be..630a1e6 100644
--- a/src/H5FDdirect.h
+++ b/src/H5FDdirect.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu <slu@hdfgroup.uiuc.edu>
+ * Programmer: Raymond Lu
* Wednesday, 20 September 2006
*
* Purpose: The public header file for the direct driver.
diff --git a/src/H5FDdrvr_module.h b/src/H5FDdrvr_module.h
index 59a419e..34beb32 100644
--- a/src/H5FDdrvr_module.h
+++ b/src/H5FDdrvr_module.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index d110ef7..aa604c2 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, November 10, 1997
*
* Purpose: Implements a family of files that acts as a single hdf5
@@ -79,67 +79,67 @@ typedef struct H5FD_family_fapl_t {
} H5FD_family_fapl_t;
/* Callback prototypes */
-static herr_t H5FD_family_term(void);
-static void *H5FD_family_fapl_get(H5FD_t *_file);
-static void *H5FD_family_fapl_copy(const void *_old_fa);
-static herr_t H5FD_family_fapl_free(void *_fa);
-static hsize_t H5FD_family_sb_size(H5FD_t *_file);
-static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/,
+static herr_t H5FD__family_term(void);
+static void *H5FD__family_fapl_get(H5FD_t *_file);
+static void *H5FD__family_fapl_copy(const void *_old_fa);
+static herr_t H5FD__family_fapl_free(void *_fa);
+static hsize_t H5FD__family_sb_size(H5FD_t *_file);
+static herr_t 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 *name,
+static herr_t H5FD__family_sb_decode(H5FD_t *_file, const char *name,
const unsigned char *buf);
-static H5FD_t *H5FD_family_open(const char *name, unsigned flags,
+static H5FD_t *H5FD__family_open(const char *name, unsigned flags,
hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_family_close(H5FD_t *_file);
-static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa);
-static haddr_t H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
-static herr_t H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+static herr_t H5FD__family_close(H5FD_t *_file);
+static int H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__family_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa);
+static haddr_t H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
+static herr_t H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
size_t size, void *_buf/*out*/);
-static herr_t H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
+static herr_t H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
size_t size, const void *_buf);
-static herr_t H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_family_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_family_unlock(H5FD_t *_file);
+static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__family_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__family_unlock(H5FD_t *_file);
/* The class struct */
static const H5FD_class_t H5FD_family_g = {
- "family", /*name */
- HADDR_MAX, /*maxaddr */
- H5F_CLOSE_WEAK, /*fc_degree */
- H5FD_family_term, /*terminate */
- H5FD_family_sb_size, /*sb_size */
- H5FD_family_sb_encode, /*sb_encode */
- H5FD_family_sb_decode, /*sb_decode */
- sizeof(H5FD_family_fapl_t), /*fapl_size */
- H5FD_family_fapl_get, /*fapl_get */
- H5FD_family_fapl_copy, /*fapl_copy */
- H5FD_family_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_family_open, /*open */
- H5FD_family_close, /*close */
- H5FD_family_cmp, /*cmp */
- H5FD_family_query, /*query */
- NULL, /*get_type_map */
- NULL, /*alloc */
- NULL, /*free */
- H5FD_family_get_eoa, /*get_eoa */
- H5FD_family_set_eoa, /*set_eoa */
- H5FD_family_get_eof, /*get_eof */
- H5FD_family_get_handle, /*get_handle */
- H5FD_family_read, /*read */
- H5FD_family_write, /*write */
- H5FD_family_flush, /*flush */
- H5FD_family_truncate, /*truncate */
- H5FD_family_lock, /*lock */
- H5FD_family_unlock, /*unlock */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ "family", /* name */
+ HADDR_MAX, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__family_term, /* terminate */
+ H5FD__family_sb_size, /* sb_size */
+ H5FD__family_sb_encode, /* sb_encode */
+ H5FD__family_sb_decode, /* sb_decode */
+ sizeof(H5FD_family_fapl_t), /* fapl_size */
+ H5FD__family_fapl_get, /* fapl_get */
+ H5FD__family_fapl_copy, /* fapl_copy */
+ H5FD__family_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__family_open, /* open */
+ H5FD__family_close, /* close */
+ H5FD__family_cmp, /* cmp */
+ H5FD__family_query, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ H5FD__family_get_eoa, /* get_eoa */
+ H5FD__family_set_eoa, /* set_eoa */
+ H5FD__family_get_eof, /* get_eof */
+ H5FD__family_get_handle, /* get_handle */
+ H5FD__family_read, /* read */
+ H5FD__family_write, /* write */
+ H5FD__family_flush, /* flush */
+ H5FD__family_truncate, /* truncate */
+ H5FD__family_lock, /* lock */
+ H5FD__family_unlock, /* unlock */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -203,7 +203,7 @@ done:
/*---------------------------------------------------------------------------
- * Function: H5FD_family_term
+ * Function: H5FD__family_term
*
* Purpose: Shut down the VFD
*
@@ -215,15 +215,15 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_term(void)
+H5FD__family_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_FAMILY_g=0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_family_term() */
+} /* end H5FD__family_term() */
/*-------------------------------------------------------------------------
@@ -242,13 +242,6 @@ H5FD_family_term(void)
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -296,13 +289,6 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
- * Raymond Lu
- * Tuesday, Oct 23, 2001
- * Changed the file access list to the new generic property
- * list.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -335,7 +321,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_get
+ * Function: H5FD__family_fapl_get
*
* Purpose: Gets a file access property list which could be used to
* create an identical file.
@@ -347,19 +333,17 @@ done:
* Programmer: Robb Matzke
* Friday, August 13, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_family_fapl_get(H5FD_t *_file)
+H5FD__family_fapl_get(H5FD_t *_file)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
H5FD_family_fapl_t *fa = NULL;
H5P_genplist_t *plist; /* Property list pointer */
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(NULL == (fa = (H5FD_family_fapl_t *)H5MM_calloc(sizeof(H5FD_family_fapl_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -373,16 +357,16 @@ H5FD_family_fapl_get(H5FD_t *_file)
ret_value=fa;
done:
- if(ret_value==NULL) {
+ if(ret_value==NULL)
if(fa!=NULL)
H5MM_xfree(fa);
- } /* end if */
+
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_copy
+ * Function: H5FD__family_fapl_copy
*
* Purpose: Copies the family-specific file access properties.
*
@@ -393,19 +377,17 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_family_fapl_copy(const void *_old_fa)
+H5FD__family_fapl_copy(const void *_old_fa)
{
const H5FD_family_fapl_t *old_fa = (const H5FD_family_fapl_t*)_old_fa;
H5FD_family_fapl_t *new_fa = NULL;
H5P_genplist_t *plist; /* Property list pointer */
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(NULL == (new_fa = (H5FD_family_fapl_t *)H5MM_malloc(sizeof(H5FD_family_fapl_t))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -428,16 +410,16 @@ H5FD_family_fapl_copy(const void *_old_fa)
ret_value=new_fa;
done:
- if(ret_value==NULL) {
+ if(ret_value==NULL)
if(new_fa!=NULL)
H5MM_xfree(new_fa);
- } /* end if */
+
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_fapl_free
+ * Function: H5FD__family_fapl_free
*
* Purpose: Frees the family-specific file access properties.
*
@@ -448,17 +430,15 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_fapl_free(void *_fa)
+H5FD__family_fapl_free(void *_fa)
{
H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(H5I_dec_ref(fa->memb_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID")
@@ -470,7 +450,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_size
+ * Function: H5FD__family_sb_size
*
* Purpose: Returns the size of the private information to be stored in
* the superblock.
@@ -482,14 +462,12 @@ done:
* Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static hsize_t
-H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
+H5FD__family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* 8 bytes field for the size of member file size field should be
* enough for now. */
@@ -498,7 +476,7 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_encode
+ * Function: H5FD__family_sb_encode
*
* Purpose: Encode driver information for the superblock. The NAME
* argument is a nine-byte buffer which will be initialized with
@@ -513,16 +491,14 @@ H5FD_family_sb_size(H5FD_t H5_ATTR_UNUSED *_file)
* Programmer: Raymond Lu
* Tuesday, May 10, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/)
+H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Name and version number */
HDstrncpy(name, "NCSAfami", (size_t)9);
@@ -532,18 +508,18 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*
* This is to guarantee backward compatibility. If a file is created with
* v1.6 library and the driver info isn't saved in the superblock. We open
* it with v1.8, the FILE->MEMB_SIZE will be the actual size of the first
- * member file (see H5FD_family_open). So it isn't safe to use FILE->MEMB_SIZE.
+ * member file (see H5FD__family_open). So it isn't safe to use FILE->MEMB_SIZE.
* If the file is created with v1.8, the correctness of FILE->PMEM_SIZE is
- * checked in H5FD_family_sb_decode. SLU - 2009/3/21
+ * checked in H5FD__family_sb_decode. SLU - 2009/3/21
*/
UINT64ENCODE(buf, (uint64_t)file->pmem_size);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_family_sb_encode() */
+} /* end H5FD__family_sb_encode() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_sb_decode
+ * Function: H5FD__family_sb_decode
*
* Purpose: This function has 2 separate purpose. One is to decodes the
* superblock information for this driver. The NAME argument is
@@ -561,13 +537,13 @@ 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 H5_ATTR_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;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Read member file size. Skip name template for now although it's saved. */
UINT64DECODE(buf, msize);
@@ -594,11 +570,11 @@ H5FD_family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsi
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_sb_decode() */
+} /* end H5FD__family_sb_decode() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_open
+ * Function: H5FD__family_open
*
* Purpose: Creates and/or opens a family of files as an HDF5 file.
*
@@ -621,7 +597,7 @@ done:
*/
H5_GCC_DIAG_OFF(format-nonliteral)
static H5FD_t *
-H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
+H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr)
{
H5FD_family_t *file = NULL;
@@ -630,7 +606,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
unsigned t_flags = flags & ~H5F_ACC_CREAT;
H5FD_t *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments */
if(!name || !*name)
@@ -769,12 +745,12 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_open() */
+} /* end H5FD__family_open() */
H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
- * Function: H5FD_family_close
+ * Function: H5FD__family_close
*
* Purpose: Closes a family of files.
*
@@ -790,14 +766,14 @@ H5_GCC_DIAG_ON(format-nonliteral)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_close(H5FD_t *_file)
+H5FD__family_close(H5FD_t *_file)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
unsigned nerrors = 0; /* Number of errors while closing member files */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Close as many members as possible. Use private function here to avoid clearing
* the error stack. We need the error message to indicate wrong member file size. */
@@ -822,11 +798,11 @@ H5FD_family_close(H5FD_t *_file)
H5MM_xfree(file);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_close() */
+} /* end H5FD__family_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_cmp
+ * Function: H5FD__family_cmp
*
* Purpose: Compares two file families to see if they are the same. It
* does this by comparing the first member of the two families.
@@ -839,18 +815,16 @@ H5FD_family_close(H5FD_t *_file)
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
-H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_family_t *f1 = (const H5FD_family_t*)_f1;
const H5FD_family_t *f2 = (const H5FD_family_t*)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(f1->nmembs >= 1 && f1->memb[0]);
HDassert(f2->nmembs >= 1 && f2->memb[0]);
@@ -858,11 +832,11 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
ret_value = H5FDcmp(f1->memb[0], f2->memb[0]);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_cmp() */
+} /* end H5FD__family_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_query
+ * Function: H5FD__family_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -876,11 +850,11 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */)
+H5FD__family_query(const H5FD_t * _file, unsigned long *flags /* out */)
{
const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
if(flags) {
@@ -896,11 +870,11 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */)
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_family_query() */
+} /* end H5FD__family_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_eoa
+ * Function: H5FD__family_get_eoa
*
* Purpose: Returns the end-of-address marker for the file. The EOA
* marker is the first address past the last byte allocated in
@@ -913,26 +887,21 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */)
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- * Raymond Lu
- * 21 Dec. 2006
- * Added the parameter TYPE. It's only used for MULTI driver.
- *
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
}
/*-------------------------------------------------------------------------
- * Function: H5FD_family_set_eoa
+ * Function: H5FD__family_set_eoa
*
* Purpose: Set the end-of-address marker for the file.
*
@@ -943,11 +912,6 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- * Raymond Lu
- * 21 Dec. 2006
- * Added the parameter TYPE. It's only used for MULTI driver.
- *
*-------------------------------------------------------------------------
*/
/* Disable warning for "format not a string literal" here -QAK */
@@ -958,7 +922,7 @@ H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*/
H5_GCC_DIAG_OFF(format-nonliteral)
static herr_t
-H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
+H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
haddr_t addr = abs_eoa;
@@ -966,7 +930,7 @@ H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa)
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Allocate space for the member name buffer */
if(NULL == (memb_name = (char *)H5MM_malloc(H5FD_FAM_MEMB_NAME_BUF_SIZE)))
@@ -1027,7 +991,7 @@ H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_eof
+ * Function: H5FD__family_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the total family size or the current EOA marker.
@@ -1041,19 +1005,17 @@ H5_GCC_DIAG_ON(format-nonliteral)
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
+H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
{
const H5FD_family_t *file = (const H5FD_family_t*)_file;
haddr_t eof=0;
int i; /* Local index variable */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/*
* Find the last member that has a non-zero EOF and break out of the loop
@@ -1085,7 +1047,7 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
/*-------------------------------------------------------------------------
- * Function: H5FD_family_get_handle
+ * Function: H5FD__family_get_handle
*
* Purpose: Returns the file handle of FAMILY file driver.
*
@@ -1094,12 +1056,10 @@ H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type)
* Programmer: Raymond Lu
* Sept. 16, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
+H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
{
H5FD_family_t *file = (H5FD_family_t *)_file;
H5P_genplist_t *plist;
@@ -1107,7 +1067,7 @@ H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
int memb;
herr_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Get the plist structure and family offset */
if(NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS)))
@@ -1127,7 +1087,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_family_read
+ * Function: H5FD__family_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
* into buffer BUF according to data transfer properties in
@@ -1141,12 +1101,10 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
void *_buf/*out*/)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
@@ -1158,7 +1116,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Get the member data transfer property list. If the transfer property
@@ -1197,7 +1155,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_family_write
+ * Function: H5FD__family_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -1210,12 +1168,10 @@ done:
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
+H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size,
const void *_buf)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
@@ -1227,7 +1183,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Get the member data transfer property list. If the transfer property
@@ -1266,7 +1222,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_family_flush
+ * Function: H5FD__family_flush
*
* Purpose: Flushes all family members.
*
@@ -1279,13 +1235,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
+H5FD__family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
unsigned u, nerrors = 0;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
for(u = 0; u < file->nmembs; u++)
if(file->memb[u] && H5FD_flush(file->memb[u], closing) < 0)
@@ -1296,11 +1252,11 @@ H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_flush() */
+} /* end H5FD__family_flush() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_truncate
+ * Function: H5FD__family_truncate
*
* Purpose: Truncates all family members.
*
@@ -1314,13 +1270,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
+H5FD__family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
unsigned u, nerrors = 0;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
for(u = 0; u < file->nmembs; u++)
if(file->memb[u] && H5FD_truncate(file->memb[u], closing) < 0)
@@ -1331,11 +1287,11 @@ H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closin
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_truncate() */
+} /* end H5FD__family_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_lock
+ * Function: H5FD__family_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -1349,13 +1305,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_lock(H5FD_t *_file, hbool_t rw)
+H5FD__family_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Place the lock on all the member files */
for(u = 0; u < file->nmembs; u++)
@@ -1379,11 +1335,11 @@ H5FD_family_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_lock() */
+} /* end H5FD__family_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_family_unlock
+ * Function: H5FD__family_unlock
*
* Purpose: To remove the existing lock on the file
*
@@ -1394,13 +1350,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_unlock(H5FD_t *_file)
+H5FD__family_unlock(H5FD_t *_file)
{
H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Remove the lock on the member files */
for(u = 0; u < file->nmembs; u++)
@@ -1410,5 +1366,5 @@ H5FD_family_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_family_unlock() */
+} /* end H5FD__family_unlock() */
diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h
index 1584cf6..45bdccc 100644
--- a/src/H5FDfamily.h
+++ b/src/H5FDfamily.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 4, 1999
*
* Purpose: The public header file for the family driver.
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index 3d086ea..29d032e 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -20,9 +20,6 @@
* File System (HDFS).
*/
-/* This source code file is part of the H5FD driver module */
-#include "H5FDdrvr_module.h"
-
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5FDprivate.h" /* File drivers */
@@ -32,8 +29,12 @@
#include "H5MMprivate.h" /* Memory management */
#ifdef H5_HAVE_LIBHDFS
+
+/* This source code file is part of the H5FD driver module */
+#include "H5FDdrvr_module.h"
+
+/* HDFS routines */
#include "hdfs.h"
-#endif
/* toggle function call prints: 1 turns on */
#define HDFS_DEBUG 0
@@ -74,7 +75,7 @@ static hid_t H5FD_HDFS_g = 0;
#define HDFS_STATS_POW(bin_i, out_ptr) { \
unsigned long long donotshadowresult = 1; \
unsigned donotshadowindex = 0; \
- for (donotshadowindex = 0; \
+ for(donotshadowindex = 0; \
donotshadowindex < (((bin_i) * HDFS_STATS_INTERVAL) + \
HDFS_STATS_START_POWER); \
donotshadowindex++) \
@@ -118,8 +119,6 @@ static unsigned long long hdfs_stats_boundaries[HDFS_STATS_BIN_COUNT];
*
* Programmer: Jacob Smith
*
- * Changes: None
- *
***************************************************************************/
typedef struct {
unsigned long long count;
@@ -130,7 +129,6 @@ typedef struct {
#endif /* HDFS_STATS */
-#ifdef H5_HAVE_LIBHDFS
/* "unique" identifier for `hdfs_t` structures.
* Randomly generated by unweighted dice rolls.
@@ -146,9 +144,7 @@ typedef struct {
*
* Contain/retain information associated with a file hosted on Hadoop
* Distributed File System (HDFS). Instantiated and populated via
- * `H5FD_hdfs_handle_open()` and cleaned up via `H5FD_hdfs_handle_close()`.
- *
- *
+ * `H5FD__hdfs_handle_open()` and cleaned up via `H5FD__hdfs_handle_close()`.
*
* `magic` (unisgned long)
*
@@ -175,8 +171,6 @@ typedef struct {
* Programmer: Jacob Smith
* May 2018
*
- * Changes: None
- *
***************************************************************************
*/
typedef struct {
@@ -187,194 +181,6 @@ typedef struct {
} hdfs_t;
-/*--------------------------------------------------------------------------
- * Function: H5FD_hdfs_handle_open
- *
- * Purpose: Create a HDFS file handle, 'opening' the target file.
- *
- * Return: Success: Pointer to HDFS container/handle of opened file.
- * Failure: NULL
- *
- * Programmer: Gerd Herber
- * May 2018
- *
- * Changes: None.
- *--------------------------------------------------------------------------
- */
-static hdfs_t *
-H5FD_hdfs_handle_open(
- const char *path,
- const char *namenode_name,
- const int32_t namenode_port,
- const char *user_name,
- const char *kerberos_ticket_cache,
- const int32_t stream_buffer_size)
-{
- struct hdfsBuilder *builder = NULL;
- hdfs_t *handle = NULL;
- hdfs_t *ret_value = NULL;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "called H5FD_hdfs_handle_open.\n");
-#endif
-
- if (path == NULL || path[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "path cannot be null.\n")
- }
- if (namenode_name == NULL /* || namenode_name[0] == '\0' */ ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "namenode name cannot be null.\n")
- }
- if (namenode_port < 0 || namenode_port > 65535) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "namenode port must be non-negative and <= 65535.\n")
- }
- if (stream_buffer_size < 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "buffer size must non-negative.\n")
- }
-
- handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t));
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
- "could not malloc space for handle.\n")
- }
-
- handle->magic = (unsigned long)HDFS_HDFST_MAGIC;
- handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */
- handle->fileinfo = NULL;
- handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */
-
- builder = hdfsNewBuilder();
- if (!builder) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "(hdfs) failed to create builder")
- }
- hdfsBuilderSetNameNode(builder, namenode_name);
- hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port);
- if (user_name != NULL && user_name[0] != '\0') {
- hdfsBuilderSetUserName(builder, user_name);
- }
- if (kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0') {
- hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache);
- }
- /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */
- handle->filesystem = hdfsBuilderConnect(builder);
- if (!handle->filesystem) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "(hdfs) could not connect to default namenode")
- }
- handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path);
- if (!handle->fileinfo) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "hdfsGetPathInfo failed")
- }
- handle->file = hdfsOpenFile(
- handle->filesystem,
- path,
- O_RDONLY,
- stream_buffer_size,
- 0,
- 0);
- if (!handle->file) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL,
- "(hdfs) could not open")
- }
-
- ret_value = handle;
-
-done:
- if (ret_value == NULL && handle != NULL) {
- /* error; clean up */
- HDassert(handle->magic == HDFS_HDFST_MAGIC);
- handle->magic++;
- if (handle->file != NULL) {
- if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
- "unable to close hdfs file handle")
- }
- }
- if (handle->fileinfo != NULL) {
- hdfsFreeFileInfo(handle->fileinfo, 1);
- }
- if (handle->filesystem != NULL) {
- if (FAIL == (hdfsDisconnect(handle->filesystem))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
- "unable to disconnect from hdfs")
- }
- }
- H5MM_xfree(handle);
- }
-
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_hdfs_handle_open() */
-
-
-/*--------------------------------------------------------------------------
- * Function: H5FD_hdfs_handle_close
- *
- * Purpose: 'Close' an HDFS file container/handle, releasing underlying
- * resources.
- *
- * Return: Success: `SUCCEED` (0)
- * Failure: `FAIL` (-1)
- *
- * Programmer: Gerd Herber
- * May 2018
- *
- * Changes: None.
- *--------------------------------------------------------------------------
- */
-static herr_t
-H5FD_hdfs_handle_close(hdfs_t *handle)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "called H5FD_hdfs_close.\n");
-#endif
-
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle cannot be null.\n")
- }
- if (handle->magic != HDFS_HDFST_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle has invalid magic.\n")
- }
-
- handle->magic++;
- if (handle->file != NULL) {
- if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "unable to close hdfs file handle")
- }
- }
- if (handle->fileinfo != NULL) {
- hdfsFreeFileInfo(handle->fileinfo, 1);
- }
- if (handle->filesystem != NULL) {
- if (FAIL == (hdfsDisconnect(handle->filesystem))) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "unable to disconnect hdfs file system")
- }
- }
-
- H5MM_xfree(handle);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_hdfs_close() */
-
-#endif /* H5_HAVE_LIBHDFS */
-
/***************************************************************************
*
@@ -432,17 +238,13 @@ done:
*
* Programmer: Jacob Smith
*
- * Changes: None.
- *
***************************************************************************
*/
typedef struct H5FD_hdfs_t {
H5FD_t pub;
H5FD_hdfs_fapl_t fa;
haddr_t eoa;
-#ifdef H5_HAVE_LIBHDFS
hdfs_t *hdfs_handle;
-#endif
#if HDFS_STATS
hdfs_statsbin meta[HDFS_STATS_BIN_COUNT + 1];
hdfs_statsbin raw[HDFS_STATS_BIN_COUNT + 1];
@@ -459,75 +261,72 @@ typedef struct H5FD_hdfs_t {
* Only included if HDFS code should compile.
*
*/
-#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
-#ifdef H5_HAVE_LIBHDFS
+#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
-#endif /* H5_HAVE_LIBHDFS */
/* Prototypes */
-static herr_t H5FD_hdfs_term(void);
-static void *H5FD_hdfs_fapl_get(H5FD_t *_file);
-static void *H5FD_hdfs_fapl_copy(const void *_old_fa);
-static herr_t H5FD_hdfs_fapl_free(void *_fa);
-static H5FD_t *H5FD_hdfs_open(const char *name, unsigned flags, hid_t fapl_id,
+static herr_t H5FD__hdfs_term(void);
+static void *H5FD__hdfs_fapl_get(H5FD_t *_file);
+static void *H5FD__hdfs_fapl_copy(const void *_old_fa);
+static herr_t H5FD__hdfs_fapl_free(void *_fa);
+static H5FD_t *H5FD__hdfs_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
-static herr_t H5FD_hdfs_close(H5FD_t *_file);
-static int H5FD_hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_hdfs_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_hdfs_get_handle(H5FD_t *_file, hid_t fapl,
+static herr_t H5FD__hdfs_close(H5FD_t *_file);
+static int H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__hdfs_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__hdfs_get_handle(H5FD_t *_file, hid_t fapl,
void** file_handle);
-static herr_t H5FD_hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+static herr_t H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
haddr_t addr, size_t size, void *buf);
-static herr_t H5FD_hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+static herr_t H5FD__hdfs_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
haddr_t addr, size_t size, const void *buf);
-static herr_t H5FD_hdfs_truncate(H5FD_t *_file, hid_t dxpl_id,
+static herr_t H5FD__hdfs_truncate(H5FD_t *_file, hid_t dxpl_id,
hbool_t closing);
-static herr_t H5FD_hdfs_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_hdfs_unlock(H5FD_t *_file);
-static herr_t H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa);
+static herr_t H5FD__hdfs_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__hdfs_unlock(H5FD_t *_file);
+
+static herr_t H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t * fa);
static const H5FD_class_t H5FD_hdfs_g = {
"hdfs", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_hdfs_term, /* terminate */
+ H5FD__hdfs_term, /* terminate */
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
sizeof(H5FD_hdfs_fapl_t), /* fapl_size */
- H5FD_hdfs_fapl_get, /* fapl_get */
- H5FD_hdfs_fapl_copy, /* fapl_copy */
- H5FD_hdfs_fapl_free, /* fapl_free */
+ H5FD__hdfs_fapl_get, /* fapl_get */
+ H5FD__hdfs_fapl_copy, /* fapl_copy */
+ H5FD__hdfs_fapl_free, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
- H5FD_hdfs_open, /* open */
- H5FD_hdfs_close, /* close */
- H5FD_hdfs_cmp, /* cmp */
- H5FD_hdfs_query, /* query */
+ H5FD__hdfs_open, /* open */
+ H5FD__hdfs_close, /* close */
+ H5FD__hdfs_cmp, /* cmp */
+ H5FD__hdfs_query, /* query */
NULL, /* get_type_map */
NULL, /* alloc */
NULL, /* free */
- H5FD_hdfs_get_eoa, /* get_eoa */
- H5FD_hdfs_set_eoa, /* set_eoa */
- H5FD_hdfs_get_eof, /* get_eof */
- H5FD_hdfs_get_handle, /* get_handle */
- H5FD_hdfs_read, /* read */
- H5FD_hdfs_write, /* write */
+ H5FD__hdfs_get_eoa, /* get_eoa */
+ H5FD__hdfs_set_eoa, /* set_eoa */
+ H5FD__hdfs_get_eof, /* get_eof */
+ H5FD__hdfs_get_handle, /* get_handle */
+ H5FD__hdfs_read, /* read */
+ H5FD__hdfs_write, /* write */
NULL, /* flush */
- H5FD_hdfs_truncate, /* truncate */
- H5FD_hdfs_lock, /* lock */
- H5FD_hdfs_unlock, /* unlock */
+ H5FD__hdfs_truncate, /* truncate */
+ H5FD__hdfs_lock, /* lock */
+ H5FD__hdfs_unlock, /* unlock */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
-#ifdef H5_HAVE_LIBHDFS
/* Declare a free list to manage the H5FD_hdfs_t struct */
H5FL_DEFINE_STATIC(H5FD_hdfs_t);
-#endif /* H5_HAVE_LIBHDFS */
/*-------------------------------------------------------------------------
@@ -537,9 +336,6 @@ H5FL_DEFINE_STATIC(H5FD_hdfs_t);
*
* Return: Non-negative on success/Negative on failure
*
- * Changes: Rename as appropriate for hdfs vfd.
- * Jacob Smith 2018
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -549,14 +345,11 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- if (H5FD_hdfs_init() < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL,
- "unable to initialize hdfs VFD")
- }
+ if(H5FD_hdfs_init() < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize hdfs VFD")
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5FD__init_package() */
@@ -584,11 +377,11 @@ H5FD_hdfs_init(void)
FUNC_ENTER_NOAPI(FAIL)
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_init() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
if(H5I_VFL != H5I_get_type(H5FD_HDFS_g))
- H5FD_HDFS_g = H5FD_register( &H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE);
+ H5FD_HDFS_g = H5FD_register(&H5FD_hdfs_g, sizeof(H5FD_class_t), FALSE);
#if HDFS_STATS
/* pre-compute statsbin boundaries
@@ -609,7 +402,7 @@ done:
/*---------------------------------------------------------------------------
- * Function: H5FD_hdfs_term
+ * Function: H5FD__hdfs_term
*
* Purpose: Shut down the VFD
*
@@ -618,82 +411,162 @@ done:
* Programmer: Quincey Koziol
* Friday, Jan 30, 2004
*
- * Changes: Rename as appropriate for hdfs vfd.
- * Jacob Smith 2018
- *
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_term(void)
+H5FD__hdfs_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_term() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
/* Reset VFL ID */
H5FD_HDFS_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_hdfs_term() */
+} /* end H5FD__hdfs_term() */
-/*-------------------------------------------------------------------------
- * Function: H5Pset_fapl_hdfs
- *
- * Purpose: Modify the file access property list to use the H5FD_HDFS
- * driver defined in this source file. All driver specfic
- * properties are passed in as a pointer to a suitably
- * initialized instance of H5FD_hdfs_fapl_t
+/*--------------------------------------------------------------------------
+ * Function: H5FD__hdfs_handle_open
*
- * Return: SUCCEED/FAIL
+ * Purpose: Create a HDFS file handle, 'opening' the target file.
*
- * Programmer: John Mainzer
- * 9/10/17
+ * Return: Success: Pointer to HDFS container/handle of opened file.
+ * Failure: NULL
*
- * Changes: Rename as appropriate for hdfs vfd.
- * Jacob Smith 2018
+ * Programmer: Gerd Herber
+ * May 2018
*
- *-------------------------------------------------------------------------
+ *--------------------------------------------------------------------------
*/
-herr_t
-H5Pset_fapl_hdfs(hid_t fapl_id,
- H5FD_hdfs_fapl_t *fa)
+static hdfs_t *
+H5FD__hdfs_handle_open(const char *path, const char *namenode_name,
+ const int32_t namenode_port, const char *user_name,
+ const char *kerberos_ticket_cache, const int32_t stream_buffer_size)
{
- H5P_genplist_t *plist = NULL; /* Property list pointer */
- herr_t ret_value = FAIL;
-
- FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*x", fapl_id, fa);
+ struct hdfsBuilder *builder = NULL;
+ hdfs_t *handle = NULL;
+ hdfs_t *ret_value = NULL;
- HDassert(fa != NULL);
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "H5Pset_fapl_hdfs() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \
- "not a file access property list")
- }
+ if(path == NULL || path[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "path cannot be null")
+ if(namenode_name == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode name cannot be null")
+ if(namenode_port < 0 || namenode_port > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "namenode port must be non-negative and <= 65535")
+ if(stream_buffer_size < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "buffer size must non-negative")
- if (FAIL == H5FD_hdfs_validate_config(fa)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "invalid hdfs config")
- }
+ handle = (hdfs_t *)H5MM_malloc(sizeof(hdfs_t));
+ if(handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle")
- ret_value = H5P_set_driver(plist, H5FD_HDFS, (void *)fa);
+ handle->magic = (unsigned long)HDFS_HDFST_MAGIC;
+ handle->filesystem = NULL; /* TODO: not a pointer; NULL may cause bug */
+ handle->fileinfo = NULL;
+ handle->file = NULL; /* TODO: not a pointer; NULL may cause bug */
+
+ builder = hdfsNewBuilder();
+ if(!builder)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) failed to create builder")
+ hdfsBuilderSetNameNode(builder, namenode_name);
+ hdfsBuilderSetNameNodePort(builder, (tPort)namenode_port);
+ if(user_name != NULL && user_name[0] != '\0')
+ hdfsBuilderSetUserName(builder, user_name);
+ if(kerberos_ticket_cache != NULL && kerberos_ticket_cache[0] != '\0')
+ hdfsBuilderSetKerbTicketCachePath(builder, kerberos_ticket_cache);
+
+ /* Call to `hdfsBuilderConnect` releases builder, regardless of success. */
+ handle->filesystem = hdfsBuilderConnect(builder);
+ if(!handle->filesystem)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "(hdfs) could not connect to default namenode")
+ handle->fileinfo = hdfsGetPathInfo(handle->filesystem, path);
+ if(!handle->fileinfo)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "hdfsGetPathInfo failed")
+ handle->file = hdfsOpenFile(handle->filesystem, path, O_RDONLY, stream_buffer_size, 0, 0);
+ if(!handle->file)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "(hdfs) could not open")
+
+ ret_value = handle;
done:
- FUNC_LEAVE_API(ret_value)
+ if(ret_value == NULL && handle != NULL) {
+ /* error; clean up */
+ HDassert(handle->magic == HDFS_HDFST_MAGIC);
+ handle->magic++;
+ if(handle->file != NULL)
+ if(FAIL == (hdfsCloseFile(handle->filesystem, handle->file)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close hdfs file handle")
+ if(handle->fileinfo != NULL)
+ hdfsFreeFileInfo(handle->fileinfo, 1);
+ if(handle->filesystem != NULL)
+ if(FAIL == (hdfsDisconnect(handle->filesystem)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to disconnect from hdfs")
+ H5MM_xfree(handle);
+ }
-} /* H5Pset_fapl_hdfs() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD__hdfs_handle_open() */
+
+
+/*--------------------------------------------------------------------------
+ * Function: H5FD__hdfs_handle_close
+ *
+ * Purpose: 'Close' an HDFS file container/handle, releasing underlying
+ * resources.
+ *
+ * Return: Success: `SUCCEED` (0)
+ * Failure: `FAIL` (-1)
+ *
+ * Programmer: Gerd Herber
+ * May 2018
+ *
+ *--------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__hdfs_handle_close(hdfs_t *handle)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "called %s.\n", FUNC);
+#endif
+
+ if(handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null")
+ if(handle->magic != HDFS_HDFST_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic")
+
+ handle->magic++;
+ if(handle->file != NULL)
+ if(FAIL == (hdfsCloseFile(handle->filesystem, handle->file)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close hdfs file handle")
+ if(handle->fileinfo != NULL)
+ hdfsFreeFileInfo(handle->fileinfo, 1);
+ if(handle->filesystem != NULL)
+ if(FAIL == (hdfsDisconnect(handle->filesystem)))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to disconnect hdfs file system")
+
+ H5MM_xfree(handle);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD__hdfs_handle_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_validate_config()
+ * Function: H5FD__hdfs_validate_config()
*
* Purpose: Test to see if the supplied instance of H5FD_hdfs_fapl_t
* contains internally consistant data. Return SUCCEED if so,
@@ -710,37 +583,70 @@ done:
* Programmer: Jacob Smith
* 9/10/17
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_validate_config(const H5FD_hdfs_fapl_t * fa)
+H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t * fa)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(fa != NULL);
- if ( fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Unknown H5FD_hdfs_fapl_t version");
- }
-
- if ( fa->namenode_port > 65535 ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Invalid namenode port number");
- }
- if ( fa->namenode_port < 0 ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Invalid namenode port number");
- }
+ if(fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_hdfs_fapl_t version");
+ if(fa->namenode_port > 65535)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number");
+ if(fa->namenode_port < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid namenode port number");
done:
FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD__hdfs_validate_config() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_fapl_hdfs
+ *
+ * Purpose: Modify the file access property list to use the H5FD_HDFS
+ * driver defined in this source file. All driver specfic
+ * properties are passed in as a pointer to a suitably
+ * initialized instance of H5FD_hdfs_fapl_t
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: John Mainzer
+ * 9/10/17
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa)
+{
+ H5P_genplist_t *plist = NULL; /* Property list pointer */
+ herr_t ret_value = FAIL;
-} /* H5FD_hdfs_validate_config() */
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", fapl_id, fa);
+
+ HDassert(fa != NULL);
+
+#if HDFS_DEBUG
+ HDfprintf(stdout, "called %s.\n", FUNC);
+#endif
+
+ plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
+ if(plist == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
+ if(FAIL == H5FD__hdfs_validate_config(fa))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid hdfs config")
+
+ ret_value = H5P_set_driver(plist, H5FD_HDFS, (void *)fa);
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* H5Pset_fapl_hdfs() */
/*-------------------------------------------------------------------------
@@ -756,13 +662,10 @@ done:
* Programmer: John Mainzer
* 9/10/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_fapl_hdfs(hid_t fapl_id,
- H5FD_hdfs_fapl_t *fa_out)
+H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out)
{
const H5FD_hdfs_fapl_t *fa = NULL;
H5P_genplist_t *plist = NULL;
@@ -772,40 +675,31 @@ H5Pget_fapl_hdfs(hid_t fapl_id,
H5TRACE2("e", "i*x", fapl_id, fa_out);
#if HDFS_DEBUG
- HDfprintf(stdout, "H5Pget_fapl_hdfs() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- if (fa_out == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "fa_out is NULL")
- }
+ if(fa_out == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
- "not a file access list")
- }
- if (H5FD_HDFS != H5P_peek_driver(plist)) {
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
- "incorrect VFL driver")
- }
+ if(plist == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
+ if(H5FD_HDFS != H5P_peek_driver(plist))
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
fa = (const H5FD_hdfs_fapl_t *)H5P_peek_driver_info(plist);
- if (fa == NULL) {
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL,
- "bad VFL driver info")
- }
+ if(fa == NULL)
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
/* Copy the hdfs fapl data out */
HDmemcpy(fa_out, fa, sizeof(H5FD_hdfs_fapl_t));
done:
FUNC_LEAVE_API(ret_value)
-
} /* H5Pget_fapl_hdfs() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_fapl_get
+ * Function: H5FD__hdfs_fapl_get
*
* Purpose: Gets a file access property list which could be used to
* create an identical file.
@@ -817,24 +711,20 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_hdfs_fapl_get(H5FD_t *_file)
+H5FD__hdfs_fapl_get(H5FD_t *_file)
{
H5FD_hdfs_t *file = (H5FD_hdfs_t*)_file;
H5FD_hdfs_fapl_t *fa = NULL;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
fa = (H5FD_hdfs_fapl_t *)H5MM_calloc(sizeof(H5FD_hdfs_fapl_t));
- if (fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed")
- }
+ if(fa == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed")
/* Copy the fields of the structure */
HDmemcpy(fa, &(file->fa), sizeof(H5FD_hdfs_fapl_t));
@@ -842,17 +732,15 @@ H5FD_hdfs_fapl_get(H5FD_t *_file)
ret_value = fa;
done:
- if (ret_value == NULL && fa != NULL) {
+ if(ret_value == NULL && fa != NULL)
H5MM_xfree(fa); /* clean up on error */
- }
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_hdfs_fapl_get() */
+} /* H5FD__hdfs_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_fapl_copy
+ * Function: H5FD__hdfs_fapl_copy
*
* Purpose: Copies the hdfs-specific file access properties.
*
@@ -863,40 +751,34 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_hdfs_fapl_copy(const void *_old_fa)
+H5FD__hdfs_fapl_copy(const void *_old_fa)
{
const H5FD_hdfs_fapl_t *old_fa = (const H5FD_hdfs_fapl_t*)_old_fa;
H5FD_hdfs_fapl_t *new_fa = NULL;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
new_fa = (H5FD_hdfs_fapl_t *)H5MM_malloc(sizeof(H5FD_hdfs_fapl_t));
- if (new_fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed")
- }
+ if(new_fa == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed")
HDmemcpy(new_fa, old_fa, sizeof(H5FD_hdfs_fapl_t));
ret_value = new_fa;
done:
- if (ret_value == NULL && new_fa != NULL) {
+ if(ret_value == NULL && new_fa != NULL)
H5MM_xfree(new_fa); /* clean up on error */
- }
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_hdfs_fapl_copy() */
+} /* H5FD__hdfs_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_fapl_free
+ * Function: H5FD__hdfs_fapl_free
*
* Purpose: Frees the hdfs-specific file access properties.
*
@@ -905,30 +787,27 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_fapl_free(void *_fa)
+H5FD__hdfs_fapl_free(void *_fa)
{
H5FD_hdfs_fapl_t *fa = (H5FD_hdfs_fapl_t*)_fa;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(fa != NULL); /* sanity check */
H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5FD__hdfs_fapl_free() */
-} /* H5FD_hdfs_fapl_free() */
#if HDFS_STATS
-
/*----------------------------------------------------------------------------
*
- * Function: hdfs_reset_stats()
+ * Function: hdfs__reset_stats()
*
* Purpose:
*
@@ -945,28 +824,24 @@ H5FD_hdfs_fapl_free(void *_fa)
* Programmer: Jacob Smith
* 2017-12-08
*
- * Changes: None.
- *
*----------------------------------------------------------------------------
*/
static herr_t
-hdfs_reset_stats(H5FD_hdfs_t *file)
+hdfs__reset_stats(H5FD_hdfs_t *file)
{
unsigned i = 0;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDprintf("hdfs_reset_stats() called\n");
+ HDprintf("hdfs__reset_stats() called\n");
#endif
- if (file == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "file was null")
- }
+ if(file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null")
- for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
file->raw[i].bytes = 0;
file->raw[i].count = 0;
file->raw[i].min = (unsigned long long)HDFS_STATS_STARTING_MIN;
@@ -981,13 +856,13 @@ hdfs_reset_stats(H5FD_hdfs_t *file)
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* hdfs_reset_stats */
+} /* hdfs__reset_stats */
#endif /* HDFS_STATS */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_open()
+ * Function: H5FD__hdfs_open()
*
* Purpose:
*
@@ -1006,137 +881,78 @@ done:
* Programmer: Jacob Smith
* 2017-11-02
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
static H5FD_t *
-H5FD_hdfs_open(
- const char *path,
- unsigned flags,
- hid_t fapl_id,
- haddr_t maxaddr)
+H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_t *ret_value = NULL;
H5FD_hdfs_t *file = NULL;
hdfs_t *handle = NULL;
H5FD_hdfs_fapl_t fa;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_open() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
/* Sanity check on file offsets */
HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
/* Check arguments */
- if (!path || !*path) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "invalid file name")
- }
- if (0 == maxaddr || HADDR_UNDEF == maxaddr) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL,
- "bogus maxaddr")
- }
- if (ADDR_OVERFLOW(maxaddr)) {
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL,
- "bogus maxaddr")
- }
- if (flags != H5F_ACC_RDONLY) {
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL,
- "only Read-Only access allowed")
- }
- if (fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "fapl cannot be H5P_DEFAULT")
- }
- if (FAIL == H5Pget_fapl_hdfs(fapl_id, &fa)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "can't get property list")
- }
-
- handle = H5FD_hdfs_handle_open(
- path,
- fa.namenode_name,
- fa.namenode_port,
- fa.user_name,
- fa.kerberos_ticket_cache,
- fa.stream_buffer_size);
-
- if (handle == NULL) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL,
- "could not open")
- }
+ if(!path || !*path)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
+ if(0 == maxaddr || HADDR_UNDEF == maxaddr)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
+ if(ADDR_OVERFLOW(maxaddr))
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
+ if(flags != H5F_ACC_RDONLY)
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed")
+ if(fapl_id == H5P_DEFAULT || fapl_id == H5P_FILE_ACCESS_DEFAULT)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "fapl cannot be H5P_DEFAULT")
+ if(FAIL == H5Pget_fapl_hdfs(fapl_id, &fa))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list")
+
+ handle = H5FD__hdfs_handle_open(path, fa.namenode_name, fa.namenode_port,
+ fa.user_name, fa.kerberos_ticket_cache, fa.stream_buffer_size);
+ if(handle == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open")
HDassert(handle->magic == HDFS_HDFST_MAGIC);
- /* create new file struct
- */
+ /* Create new file struct */
file = H5FL_CALLOC(H5FD_hdfs_t);
- if (file == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "unable to allocate file struct")
- }
+ if(file == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct")
file->hdfs_handle = handle;
HDmemcpy(&(file->fa), &fa, sizeof(H5FD_hdfs_fapl_t));
#if HDFS_STATS
- if (FAIL == hdfs_reset_stats(file)) {
- HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL,
- "unable to reset file statistics")
- }
+ if(FAIL == hdfs__reset_stats(file))
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, "unable to reset file statistics")
#endif /* HDFS_STATS */
ret_value = (H5FD_t*)file;
done:
- if (ret_value == NULL) {
- if (handle != NULL) {
- if (FAIL == H5FD_hdfs_handle_close(handle)) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
- "unable to close HDFS file handle")
- }
- }
- if (file != NULL) {
+ if(ret_value == NULL) {
+ if(handle != NULL)
+ if(FAIL == H5FD__hdfs_handle_close(handle))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close HDFS file handle")
+ if(file != NULL)
file = H5FL_FREE(H5FD_hdfs_t, file);
- }
} /* end if null return value (error) */
FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FD__hdfs_open() */
-} /* H5FD_hdfs_open() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static H5FD_t *
-H5FD_hdfs_open(
- const char H5_ATTR_UNUSED *path,
- unsigned H5_ATTR_UNUSED flags,
- hid_t H5_ATTR_UNUSED fapl_id,
- haddr_t H5_ATTR_UNUSED maxaddr)
-{
- H5FD_t *ret_value = NULL;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL,
- "Illegal open of unsupported virtual file (hdfs)");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_hdfs_open() */
-
-#endif /* H5_HAVE_LIBHDFS */
#if HDFS_STATS
/*----------------------------------------------------------------------------
*
- * Function: hdfs_fprint_stats()
+ * Function: hdfs__fprint_stats()
*
* Purpose:
*
@@ -1186,14 +1002,10 @@ done:
*
* Programmer: Jacob Smith
*
- * Changes: None.
- *
*----------------------------------------------------------------------------
*/
static herr_t
-hdfs_fprint_stats(
- FILE *stream,
- const H5FD_hdfs_t *file)
+hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file)
{
herr_t ret_value = SUCCEED;
parsed_url_t *purl = NULL;
@@ -1212,49 +1024,43 @@ hdfs_fprint_stats(
unsigned suffix_i = 0;
const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' };
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- if (stream == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "file stream cannot be null" )
- }
- if (file == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "file cannot be null")
- }
- if (file->hdfs_handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "hdfs handle cannot be null")
- }
- if (file->hdfs_handle->magic != HDFS_HDFST_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "hdfs handle has invalid magic")
- }
+ if(stream == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null")
+ if(file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null")
+ if(file->hdfs_handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle cannot be null")
+ if(file->hdfs_handle->magic != HDFS_HDFST_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hdfs handle has invalid magic")
/*******************
* AGGREGATE STATS *
*******************/
- for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
const hdfs_statsbin *r = &file->raw[i];
const hdfs_statsbin *m = &file->meta[i];
- if (m->min < min_meta) { min_meta = m->min; }
- if (r->min < min_raw) { min_raw = r->min; }
- if (m->max > max_meta) { max_meta = m->max; }
- if (r->max > max_raw) { max_raw = r->max; }
+ if(m->min < min_meta)
+ min_meta = m->min;
+ if(r->min < min_raw)
+ min_raw = r->min;
+ if(m->max > max_meta)
+ max_meta = m->max;
+ if(r->max > max_raw)
+ max_raw = r->max;
count_raw += r->count;
count_meta += m->count;
bytes_raw += r->bytes;
bytes_meta += m->bytes;
}
- if (count_raw > 0) {
+ if(count_raw > 0)
average_raw = (double)bytes_raw / (double)count_raw;
- }
- if (count_meta > 0) {
+ if(count_meta > 0)
average_meta = (double)bytes_meta / (double)count_meta;
- }
/******************
* PRINT OVERVIEW *
@@ -1265,9 +1071,8 @@ hdfs_fprint_stats(
HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n",
bytes_raw + bytes_meta, bytes_meta, bytes_raw);
- if (count_raw + count_meta == 0) {
+ if(count_raw + count_meta == 0)
goto done;
- }
/*************************
* PRINT AGGREGATE STATS *
@@ -1275,55 +1080,49 @@ hdfs_fprint_stats(
HDfprintf(stream, "SIZES meta raw\n");
HDfprintf(stream, " min ");
- if (count_meta == 0) {
+ if(count_meta == 0)
HDfprintf(stream, " 0.000 ");
- } else {
+ else {
re_dub = (double)min_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
}
- if (count_raw == 0) {
+ if(count_raw == 0)
HDfprintf(stream, " 0.000 \n");
- } else {
+ else {
re_dub = (double)min_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
}
HDfprintf(stream, " avg ");
re_dub = (double)average_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
re_dub = (double)average_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
HDfprintf(stream, " max ");
re_dub = (double)max_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
re_dub = (double)max_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
@@ -1336,7 +1135,7 @@ hdfs_fprint_stats(
HDfprintf(stream,
" up-to meta raw meta raw meta raw\n");
- for (i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
+ for(i = 0; i <= HDFS_STATS_BIN_COUNT; i++) {
const hdfs_statsbin *m;
const hdfs_statsbin *r;
unsigned long long range_end = 0;
@@ -1351,55 +1150,47 @@ hdfs_fprint_stats(
m = &file->meta[i];
r = &file->raw[i];
- if (r->count == 0 && m->count == 0) {
+ if(r->count == 0 && m->count == 0)
continue;
- }
range_end = hdfs_stats_boundaries[i];
- if (i == HDFS_STATS_BIN_COUNT) {
+ if(i == HDFS_STATS_BIN_COUNT) {
range_end = hdfs_stats_boundaries[i-1];
HDfprintf(stream, ">");
- } else {
- HDfprintf(stream, " ");
}
+ else
+ HDfprintf(stream, " ");
bm_val = (double)m->bytes;
- for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; bm_val >= 1024.0; suffix_i++)
bm_val /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
bm_suffix = suffixes[suffix_i];
br_val = (double)r->bytes;
- for (suffix_i = 0; br_val >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; br_val >= 1024.0; suffix_i++)
br_val /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
br_suffix = suffixes[suffix_i];
- if (m->count > 0) {
+ if(m->count > 0)
am_val = (double)(m->bytes) / (double)(m->count);
- }
- for (suffix_i = 0; am_val >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; am_val >= 1024.0; suffix_i++)
am_val /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
am_suffix = suffixes[suffix_i];
- if (r->count > 0) {
+ if(r->count > 0)
ar_val = (double)(r->bytes) / (double)(r->count);
- }
- for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; ar_val >= 1024.0; suffix_i++)
ar_val /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
ar_suffix = suffixes[suffix_i];
re_dub = (double)range_end;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) {
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
- }
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(
@@ -1412,18 +1203,18 @@ hdfs_fprint_stats(
br_val, br_suffix, /* rawdata bytes */
am_val, am_suffix, /* metadata average */
ar_val, ar_suffix); /* rawdata average */
- fflush(stream);
+ HDfflush(stream);
}
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* hdfs_fprint_stats */
+} /* hdfs__fprint_stats */
#endif /* HDFS_STATS */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_close()
+ * Function: H5FD__hdfs_close()
*
* Purpose:
*
@@ -1436,77 +1227,47 @@ done:
* Programmer: Jacob Smith
* 2017-11-02
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
-H5FD_hdfs_close(H5FD_t *_file)
+H5FD__hdfs_close(H5FD_t *_file)
{
herr_t ret_value = SUCCEED;
H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_close() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- /* Sanity checks
- */
+ /* Sanity checks */
HDassert(file != NULL);
HDassert(file->hdfs_handle != NULL);
HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC);
- /* Close the underlying request handle
- */
- if (file->hdfs_handle != NULL) {
- if (FAIL == H5FD_hdfs_handle_close(file->hdfs_handle)) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "unable to close HDFS file handle")
- }
- }
+ /* Close the underlying request handle */
+ if(file->hdfs_handle != NULL)
+ if(FAIL == H5FD__hdfs_handle_close(file->hdfs_handle))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close HDFS file handle")
#if HDFS_STATS
/* TODO: mechanism to re-target stats printout */
- if (FAIL == hdfs_fprint_stats(stdout, file)) {
- HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL,
- "problem while writing file statistics")
- }
+ if(FAIL == hdfs__fprint_stats(stdout, file))
+ HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics")
#endif /* HDFS_STATS */
- /* Release the file info
- */
+ /* Release the file info */
file = H5FL_FREE(H5FD_hdfs_t, file);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_close() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_close(H5FD_t H5_ATTR_UNUSED *_file)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
- HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "Illegal close of unsupported Virtual File (hdfs)")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_close() */
-
-#endif /* H5_HAVE_LIBHDFS */
+} /* end H5FD__hdfs_close() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_cmp()
+ * Function: H5FD__hdfs_cmp()
*
* Purpose:
*
@@ -1520,19 +1281,10 @@ done:
* Programmer: Gerd Herber
* May 2018
*
- * Changes:
- *
- * + Replace `if (ret_value == 0)` chain with `HGOTO_DONE` jumps.
- * Jacob Smith 17 May 2018
- *
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static int
-H5FD_hdfs_cmp(
- const H5FD_t *_f1,
- const H5FD_t *_f2)
+H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
int ret_value = 0;
const H5FD_hdfs_t *f1 = (const H5FD_hdfs_t *)_f1;
@@ -1540,10 +1292,10 @@ H5FD_hdfs_cmp(
hdfsFileInfo *finfo1 = NULL;
hdfsFileInfo *finfo2 = NULL;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_cmp() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
HDassert(f1->hdfs_handle != NULL);
@@ -1556,40 +1308,24 @@ H5FD_hdfs_cmp(
HDassert(finfo1 != NULL);
HDassert(finfo2 != NULL);
- if (finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); }
- if (finfo1->mName != finfo2->mName) { HGOTO_DONE(-1); }
- if (finfo1->mLastMod != finfo2->mLastMod) { HGOTO_DONE(-1); }
- if (finfo1->mSize != finfo2->mSize) { HGOTO_DONE(-1); }
- if (finfo1->mReplication != finfo2->mReplication) { HGOTO_DONE(-1); }
- if (finfo1->mBlockSize != finfo2->mBlockSize) { HGOTO_DONE(-1); }
- if (strcmp(finfo1->mOwner, finfo2->mOwner)) { HGOTO_DONE(-1); }
- if (strcmp(finfo1->mGroup, finfo2->mGroup)) { HGOTO_DONE(-1); }
- if (finfo1->mPermissions != finfo2->mPermissions) { HGOTO_DONE(-1); }
- if (finfo1->mLastAccess != finfo2->mLastAccess) { HGOTO_DONE(-1); }
+ if(finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); }
+ if(finfo1->mName != finfo2->mName) { HGOTO_DONE(-1); }
+ if(finfo1->mLastMod != finfo2->mLastMod) { HGOTO_DONE(-1); }
+ if(finfo1->mSize != finfo2->mSize) { HGOTO_DONE(-1); }
+ if(finfo1->mReplication != finfo2->mReplication) { HGOTO_DONE(-1); }
+ if(finfo1->mBlockSize != finfo2->mBlockSize) { HGOTO_DONE(-1); }
+ if(HDstrcmp(finfo1->mOwner, finfo2->mOwner)) { HGOTO_DONE(-1); }
+ if(HDstrcmp(finfo1->mGroup, finfo2->mGroup)) { HGOTO_DONE(-1); }
+ if(finfo1->mPermissions != finfo2->mPermissions) { HGOTO_DONE(-1); }
+ if(finfo1->mLastAccess != finfo2->mLastAccess) { HGOTO_DONE(-1); }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_cmp() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static int
-H5FD_hdfs_cmp(
- const H5FD_t H5_ATTR_UNUSED *_f1,
- const H5FD_t H5_ATTR_UNUSED *_f2)
-{
- int ret_value = 0;
-
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_cmp() */
-
-#endif /* H5_HAVE_LIBHDFS */
+} /* H5FD__hdfs_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_hdfs_query
+ * Function: H5FD__hdfs_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -1608,28 +1344,26 @@ H5FD_hdfs_cmp(
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_query(
- const H5FD_t H5_ATTR_UNUSED *_file,
- unsigned long *flags) /* out variable */
+H5FD__hdfs_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_query() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- if (flags) {
+ if(flags) {
*flags = 0;
*flags |= H5FD_FEAT_DATA_SIEVE;
}
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5FD_hdfs_query() */
+} /* H5FD__hdfs_query() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_get_eoa()
+ * Function: H5FD__hdfs_get_eoa()
*
* Purpose:
*
@@ -1644,50 +1378,26 @@ H5FD_hdfs_query(
* Programmer: Jacob Smith
* 2017-11-02
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static haddr_t
-H5FD_hdfs_get_eoa(
- const H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__hdfs_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
FUNC_LEAVE_NOAPI(file->eoa)
-} /* end H5FD_hdfs_get_eoa() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static haddr_t
-H5FD_hdfs_get_eoa(
- const H5FD_t H5_ATTR_UNUSED *_file,
- H5FD_mem_t H5_ATTR_UNUSED type)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eoa() called.\n");
-#endif
-
- FUNC_LEAVE_NOAPI(0)
-} /* end H5FD_hdfs_get_eoa() */
-
-#endif /* H5_HAVE_LIBHDFS */
+} /* end H5FD__hdfs_get_eoa() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_set_eoa()
+ * Function: H5FD__hdfs_set_eoa()
*
* Purpose:
*
@@ -1700,54 +1410,28 @@ H5FD_hdfs_get_eoa(
* Programmer: Jacob Smith
* 2017-11-03
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
-H5FD_hdfs_set_eoa(
- H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- haddr_t addr)
+H5FD__hdfs_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5FD_hdfs_set_eoa() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_set_eoa(
- H5FD_t H5_ATTR_UNUSED *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- haddr_t H5_ATTR_UNUSED addr)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_set_eoa() called.\n");
-#endif
-
- FUNC_LEAVE_NOAPI(FAIL)
-} /* H5FD_hdfs_set_eoa() */
-
-#endif /* H5_HAVE_LIBHDFS */
+} /* H5FD__hdfs_set_eoa() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_get_eof()
+ * Function: H5FD__hdfs_get_eof()
*
* Purpose:
*
@@ -1763,49 +1447,27 @@ H5FD_hdfs_set_eoa(
*
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static haddr_t
-H5FD_hdfs_get_eof(
- const H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_hdfs_t *file = (const H5FD_hdfs_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
HDassert(file->hdfs_handle != NULL);
HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC);
FUNC_LEAVE_NOAPI((size_t) file->hdfs_handle->fileinfo->mSize)
-} /* end H5FD_hdfs_get_eof() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static haddr_t
-H5FD_hdfs_get_eof(
- const H5FD_t H5_ATTR_UNUSED *_file,
- H5FD_mem_t H5_ATTR_UNUSED type)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_eof() called.\n");
-#endif
-
- FUNC_LEAVE_NOAPI((size_t)0)
-} /* end H5FD_hdfs_get_eof() */
-
-#endif /* H5_HAVE_LIBHDFS */
+} /* end H5FD__hdfs_get_eof() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_get_handle()
+ * Function: H5FD__hdfs_get_handle()
*
* Purpose:
*
@@ -1818,67 +1480,33 @@ H5FD_hdfs_get_eof(
* Programmer: Jacob Smith
* 2017-11-02
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
-H5FD_hdfs_get_handle(
- H5FD_t *_file,
- hid_t H5_ATTR_UNUSED fapl,
- void **file_handle)
+H5FD__hdfs_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle)
{
herr_t ret_value = SUCCEED;
H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
- if (!file_handle) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "file handle not valid")
- }
+ if(!file_handle)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
*file_handle = file->hdfs_handle;
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_get_handle() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_get_handle(
- H5FD_t H5_ATTR_UNUSED *_file,
- hid_t H5_ATTR_UNUSED fapl,
- void H5_ATTR_UNUSED **file_handle)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_get_handle() called.\n");
-#endif /* HDFS_DEBUG */
-
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
- "Illegal get-handle of unsupported virtual file (hdfs)");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_get_handle() */
-
-#endif /* H5_HAVE_LIBHDFS */
+} /* end H5FD__hdfs_get_handle() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_read()
+ * Function: H5FD__hdfs_read()
*
* Purpose:
*
@@ -1896,20 +1524,11 @@ done:
* Programmer: Jacob Smith
* 2017-11-??
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
-#ifdef H5_HAVE_LIBHDFS
-
static herr_t
-H5FD_hdfs_read(
- H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t addr, /* start offset */
- size_t size, /* length of read */
- void *buf) /* out */
+H5FD__hdfs_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)
{
herr_t ret_value = SUCCEED;
H5FD_hdfs_t *file = (H5FD_hdfs_t *)_file;
@@ -1920,10 +1539,10 @@ H5FD_hdfs_read(
unsigned bin_i = 0;
#endif /* HDFS_STATS */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_read() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif /* HDFS_DEBUG */
HDassert(file != NULL);
@@ -1933,44 +1552,33 @@ H5FD_hdfs_read(
filesize = (size_t) file->hdfs_handle->fileinfo->mSize;
- if ((addr > filesize) || ((addr + size) > filesize)) {
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL,
- "range exceeds file address")
- }
+ if((addr > filesize) || ((addr + size) > filesize))
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address")
- if (FAIL == hdfsPread(
- file->hdfs_handle->filesystem,
- file->hdfs_handle->file,
- (tOffset)addr,
- buf,
- (tSize)size))
- {
- HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL,
- "unable to execute read")
- }
+ if(FAIL == hdfsPread(file->hdfs_handle->filesystem, file->hdfs_handle->file,
+ (tOffset)addr, buf, (tSize)size))
+ HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read")
#if HDFS_STATS
- /* Find which "bin" this read fits in. Can be "overflow" bin.
- */
- for (bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++) {
- if ((unsigned long long)size < hdfs_stats_boundaries[bin_i]) {
+ /* Find which "bin" this read fits in. Can be "overflow" bin. */
+ for(bin_i = 0; bin_i < HDFS_STATS_BIN_COUNT; bin_i++)
+ if((unsigned long long)size < hdfs_stats_boundaries[bin_i])
break;
- }
- }
bin = (type == H5FD_MEM_DRAW)
? &file->raw[bin_i]
: &file->meta[bin_i];
- /* Store collected stats in appropriate bin
- */
- if (bin->count == 0) {
+ /* Store collected stats in appropriate bin */
+ if(bin->count == 0) {
bin->min = size;
bin->max = size;
}
else {
- if (size < bin->min) { bin->min = size; }
- if (size > bin->max) { bin->max = size; }
+ if(size < bin->min)
+ bin->min = size;
+ if(size > bin->max)
+ bin->max = size;
}
bin->count++;
bin->bytes += (unsigned long long)size;
@@ -1979,40 +1587,12 @@ H5FD_hdfs_read(
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_read() */
-
-#else /* H5_HAVE_LIBHDFS not defined */
-
-static herr_t
-H5FD_hdfs_read(
- H5FD_t H5_ATTR_UNUSED *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t H5_ATTR_UNUSED addr,
- size_t H5_ATTR_UNUSED size,
- void H5_ATTR_UNUSED *buf)
-{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI_NOINIT
-
-#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_read() called.\n");
-#endif /* HDFS_DEBUG */
-
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
- "Illegal get-handle of unsupported virtual file (hdfs)");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_read() */
-
-#endif /* H5_HAVE_LIBHDFS */
+} /* end H5FD__hdfs_read() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_write()
+ * Function: H5FD__hdfs_write()
*
* Purpose:
*
@@ -2026,38 +1606,31 @@ done:
* Programmer: Jacob Smith
* 2017-10-23
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_write(
- H5FD_t H5_ATTR_UNUSED *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t H5_ATTR_UNUSED addr,
- size_t H5_ATTR_UNUSED size,
- const void H5_ATTR_UNUSED *buf)
+H5FD__hdfs_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size,
+ const void H5_ATTR_UNUSED *buf)
{
herr_t ret_value = FAIL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_write() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
- "cannot write to read-only file.")
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD_hdfs_write() */
+} /* H5FD__hdfs_write() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_truncate()
+ * Function: H5FD__hdfs_truncate()
*
* Purpose:
*
@@ -2073,35 +1646,30 @@ done:
* Programmer: Jacob Smith
* 2017-10-23
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_truncate(
- H5FD_t H5_ATTR_UNUSED *_file,
- hid_t H5_ATTR_UNUSED dxpl_id,
- hbool_t H5_ATTR_UNUSED closing)
+H5FD__hdfs_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id,
+ hbool_t H5_ATTR_UNUSED closing)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if HDFS_DEBUG
- HDfprintf(stdout, "H5FD_hdfs_truncate() called.\n");
+ HDfprintf(stdout, "called %s.\n", FUNC);
#endif
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
- "cannot truncate read-only file.")
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_hdfs_truncate() */
+} /* end H5FD__hdfs_truncate() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_lock()
+ * Function: H5FD__hdfs_lock()
*
* Purpose:
*
@@ -2118,23 +1686,22 @@ done:
* Programmer: Jacob Smith
* 2017-11-03
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_lock(
+H5FD__hdfs_lock(
H5FD_t H5_ATTR_UNUSED *_file,
hbool_t H5_ATTR_UNUSED rw)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
+
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_hdfs_lock() */
+} /* end H5FD__hdfs_lock() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_hdfs_unlock()
+ * Function: H5FD__hdfs_unlock()
*
* Purpose:
*
@@ -2148,14 +1715,14 @@ H5FD_hdfs_lock(
* Programmer: Jacob Smith
* 2017-11-03
*
- * Changes: None.
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file)
+H5FD__hdfs_unlock(H5FD_t H5_ATTR_UNUSED *_file)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
+
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_hdfs_unlock() */
+} /* end H5FD__hdfs_unlock() */
+#endif /* H5_HAVE_LIBHDFS */
diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h
index 37252f0..d67ab9e 100644
--- a/src/H5FDhdfs.h
+++ b/src/H5FDhdfs.h
@@ -22,8 +22,13 @@
#ifndef H5FDhdfs_H
#define H5FDhdfs_H
-#define H5FD_HDFS (H5FD_hdfs_init())
+#ifdef H5_HAVE_LIBHDFS
+#define H5FD_HDFS (H5FD_hdfs_init())
+#else /* H5_HAVE_LIBHDFS */
+#define H5FD_HDFS (-1)
+#endif /* H5_HAVE_LIBHDFS */
+#ifdef H5_HAVE_LIBHDFS
#ifdef __cplusplus
extern "C" {
#endif
@@ -90,8 +95,6 @@ extern "C" {
* Programmer: Jacob Smith
* 2018-04-23
*
- * Changes: None
- *
****************************************************************************/
#define H5FD__CURR_HDFS_FAPL_T_VERSION 1
@@ -116,7 +119,7 @@ H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa);
#ifdef __cplusplus
}
#endif
+#endif /* H5_HAVE_LIBHDFS */
#endif /* ifndef H5FDhdfs_H */
-
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 78b7742..8793a76 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Monday, April 17, 2000
*
* Purpose: The POSIX unbuffered file driver using only the HDF5 public
@@ -151,71 +151,71 @@ typedef struct H5FD_log_t {
* which can be addressed entirely by the second
* argument of the file seek function.
*/
-#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
-#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
+#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
+#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR))
#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR)
#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \
- HADDR_UNDEF==(A)+(Z) || \
- (HDoff_t)((A)+(Z))<(HDoff_t)(A))
+ HADDR_UNDEF == (A) + (Z) || \
+ (HDoff_t)((A) + (Z)) < (HDoff_t)(A))
/* Prototypes */
-static herr_t H5FD_log_term(void);
-static void *H5FD_log_fapl_get(H5FD_t *file);
-static void *H5FD_log_fapl_copy(const void *_old_fa);
-static herr_t H5FD_log_fapl_free(void *_fa);
-static H5FD_t *H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id,
+static herr_t H5FD__log_term(void);
+static void *H5FD__log_fapl_get(H5FD_t *file);
+static void *H5FD__log_fapl_copy(const void *_old_fa);
+static herr_t H5FD__log_fapl_free(void *_fa);
+static H5FD_t *H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
-static herr_t H5FD_log_close(H5FD_t *_file);
-static int H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_log_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
+static herr_t H5FD__log_close(H5FD_t *_file);
+static int H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__log_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
static herr_t H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
hsize_t size);
-static haddr_t H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t 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 type);
-static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
-static herr_t H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
+static haddr_t H5FD__log_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t 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 type);
+static herr_t H5FD__log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
+static herr_t H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, void *buf);
-static herr_t H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
+static herr_t H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, const void *buf);
-static herr_t H5FD_log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_log_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_log_unlock(H5FD_t *_file);
+static herr_t H5FD__log_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__log_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__log_unlock(H5FD_t *_file);
static const H5FD_class_t H5FD_log_g = {
- "log", /*name */
- MAXADDR, /*maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_log_term, /*terminate */
- NULL, /*sb_size */
- NULL, /*sb_encode */
- NULL, /*sb_decode */
- sizeof(H5FD_log_fapl_t), /*fapl_size */
- H5FD_log_fapl_get, /*fapl_get */
- H5FD_log_fapl_copy, /*fapl_copy */
- H5FD_log_fapl_free, /*fapl_free */
- 0, /*dxpl_size */
- NULL, /*dxpl_copy */
- NULL, /*dxpl_free */
- H5FD_log_open, /*open */
- H5FD_log_close, /*close */
- H5FD_log_cmp, /*cmp */
- H5FD_log_query, /*query */
- NULL, /*get_type_map */
- H5FD_log_alloc, /*alloc */
- H5FD__log_free, /*free */
- H5FD_log_get_eoa, /*get_eoa */
- H5FD_log_set_eoa, /*set_eoa */
- H5FD_log_get_eof, /*get_eof */
- H5FD_log_get_handle, /*get_handle */
- H5FD_log_read, /*read */
- H5FD_log_write, /*write */
- NULL, /*flush */
- H5FD_log_truncate, /*truncate */
- H5FD_log_lock, /*lock */
- H5FD_log_unlock, /*unlock */
- H5FD_FLMAP_DICHOTOMY /*fl_map */
+ "log", /* name */
+ MAXADDR, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ H5FD__log_term, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ sizeof(H5FD_log_fapl_t), /* fapl_size */
+ H5FD__log_fapl_get, /* fapl_get */
+ H5FD__log_fapl_copy, /* fapl_copy */
+ H5FD__log_fapl_free, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ H5FD__log_open, /* open */
+ H5FD__log_close, /* close */
+ H5FD__log_cmp, /* cmp */
+ H5FD__log_query, /* query */
+ NULL, /* get_type_map */
+ H5FD__log_alloc, /* alloc */
+ H5FD__log_free, /* free */
+ H5FD__log_get_eoa, /* get_eoa */
+ H5FD__log_set_eoa, /* set_eoa */
+ H5FD__log_get_eof, /* get_eof */
+ H5FD__log_get_handle, /* get_handle */
+ H5FD__log_read, /* read */
+ H5FD__log_write, /* write */
+ NULL, /* flush */
+ H5FD__log_truncate, /* truncate */
+ H5FD__log_lock, /* lock */
+ H5FD__log_unlock, /* unlock */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/* Declare a free list to manage the H5FD_log_t struct */
@@ -279,7 +279,7 @@ done:
/*---------------------------------------------------------------------------
- * Function: H5FD_log_term
+ * Function: H5FD__log_term
*
* Purpose: Shut down the VFD
*
@@ -291,15 +291,15 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_term(void)
+H5FD__log_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_LOG_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_term() */
+} /* end H5FD__log_term() */
/*-------------------------------------------------------------------------
@@ -352,7 +352,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_log_fapl_get
+ * Function: H5FD__log_fapl_get
*
* Purpose: Returns a file access property list which indicates how the
* specified file is being accessed. The return list could be
@@ -368,22 +368,22 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5FD_log_fapl_get(H5FD_t *_file)
+H5FD__log_fapl_get(H5FD_t *_file)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
- ret_value = H5FD_log_fapl_copy(&(file->fa));
+ ret_value = H5FD__log_fapl_copy(&(file->fa));
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_fapl_get() */
+} /* end H5FD__log_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_fapl_copy
+ * Function: H5FD__log_fapl_copy
*
* Purpose: Copies the log-specific file access properties.
*
@@ -396,13 +396,13 @@ H5FD_log_fapl_get(H5FD_t *_file)
*-------------------------------------------------------------------------
*/
static void *
-H5FD_log_fapl_copy(const void *_old_fa)
+H5FD__log_fapl_copy(const void *_old_fa)
{
const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t*)_old_fa;
H5FD_log_fapl_t *new_fa = NULL; /* New FAPL info */
void *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(old_fa);
@@ -430,11 +430,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_fapl_copy() */
+} /* end H5FD__log_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_fapl_free
+ * Function: H5FD__log_fapl_free
*
* Purpose: Frees the log-specific file access properties.
*
@@ -446,11 +446,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_fapl_free(void *_fa)
+H5FD__log_fapl_free(void *_fa)
{
H5FD_log_fapl_t *fa = (H5FD_log_fapl_t*)_fa;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Free the fapl information */
if(fa->logfile)
@@ -458,11 +458,11 @@ H5FD_log_fapl_free(void *_fa)
H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_fapl_free() */
+} /* end H5FD__log_fapl_free() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_open
+ * Function: H5FD__log_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -477,7 +477,7 @@ H5FD_log_fapl_free(void *_fa)
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_log_t *file = NULL;
H5P_genplist_t *plist; /* Property list */
@@ -492,7 +492,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
h5_stat_t sb;
H5FD_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check on file offsets */
HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
@@ -649,11 +649,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_open() */
+} /* end H5FD__log_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_close
+ * Function: H5FD__log_close
*
* Purpose: Closes an HDF5 file.
*
@@ -666,13 +666,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_close(H5FD_t *_file)
+H5FD__log_close(H5FD_t *_file)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
H5_timer_t close_timer; /* Timer for close() call */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(file);
@@ -794,11 +794,11 @@ H5FD_log_close(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_close() */
+} /* end H5FD__log_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_cmp
+ * Function: H5FD__log_cmp
*
* Purpose: Compares two files belonging to this driver using an
* arbitrary (but consistent) ordering.
@@ -813,13 +813,13 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_log_t *f1 = (const H5FD_log_t *)_f1;
const H5FD_log_t *f2 = (const H5FD_log_t *)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#ifdef H5_HAVE_WIN32_API
if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1)
@@ -850,11 +850,11 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_cmp() */
+} /* end H5FD__log_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_query
+ * Function: H5FD__log_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -867,11 +867,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */)
+H5FD__log_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
const H5FD_log_t *file = (const H5FD_log_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
if(flags) {
@@ -890,11 +890,11 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */)
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_query() */
+} /* end H5FD__log_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_alloc
+ * Function: H5FD__log_alloc
*
* Purpose: Allocate file memory.
*
@@ -907,13 +907,13 @@ 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 H5_ATTR_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;
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Compute the address for the block to allocate */
addr = file->eoa;
@@ -937,7 +937,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hsi
ret_value = addr;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_alloc() */
+} /* end H5FD__log_alloc() */
/*-------------------------------------------------------------------------
@@ -978,7 +978,7 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
/*-------------------------------------------------------------------------
- * Function: H5FD_log_get_eoa
+ * Function: H5FD__log_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -993,18 +993,18 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id,
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
-} /* end H5FD_log_get_eoa() */
+} /* end H5FD__log_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_set_eoa
+ * Function: H5FD__log_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -1018,11 +1018,11 @@ H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
+H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
{
H5FD_log_t *file = (H5FD_log_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if(file->fa.flags != 0) {
/* Check for increasing file size */
@@ -1061,11 +1061,11 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_log_set_eoa() */
+} /* end H5FD__log_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_get_eof
+ * Function: H5FD__log_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the filesystem end-of-file or the HDF5 end-of-address
@@ -1082,18 +1082,18 @@ 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 H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eof)
-} /* end H5FD_log_get_eof() */
+} /* end H5FD__log_get_eof() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_get_handle
+ * Function: H5FD__log_get_handle
*
* Purpose: Returns the file handle of LOG file driver.
*
@@ -1105,12 +1105,12 @@ H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
@@ -1119,11 +1119,11 @@ H5FD_log_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handle
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_get_handle() */
+} /* end H5FD__log_get_handle() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_read
+ * Function: H5FD__log_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
* into buffer BUF according to data transfer properties in
@@ -1139,7 +1139,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_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;
@@ -1154,7 +1154,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd
HDoff_t offset = (HDoff_t)addr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -1325,11 +1325,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_read() */
+} /* end H5FD__log_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_write
+ * Function: H5FD__log_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -1343,7 +1343,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_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;
@@ -1358,7 +1358,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had
HDoff_t offset = (HDoff_t)addr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(size > 0);
@@ -1531,11 +1531,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_write() */
+} /* end H5FD__log_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_truncate
+ * Function: H5FD__log_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -1548,12 +1548,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_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 */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1639,11 +1639,11 @@ H5FD_log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_U
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_truncate() */
+} /* end H5FD__log_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_lock
+ * Function: H5FD__log_lock
*
* Purpose: Place a lock on the file
*
@@ -1655,13 +1655,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_lock(H5FD_t *_file, hbool_t rw)
+H5FD__log_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */
int lock_flags; /* file locking flags */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(file);
@@ -1679,11 +1679,11 @@ H5FD_log_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_lock() */
+} /* end H5FD__log_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_log_unlock
+ * Function: H5FD__log_unlock
*
* Purpose: Remove the existing lock on the file
*
@@ -1694,12 +1694,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_log_unlock(H5FD_t *_file)
+H5FD__log_unlock(H5FD_t *_file)
{
H5FD_log_t *file = (H5FD_log_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1712,5 +1712,5 @@ H5FD_log_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_log_unlock() */
+} /* end H5FD__log_unlock() */
diff --git a/src/H5FDlog.h b/src/H5FDlog.h
index a69bb18..db51f3d 100644
--- a/src/H5FDlog.h
+++ b/src/H5FDlog.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Monday, April 17, 2000
*
* Purpose: The public header file for the log driver.
diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c
index ef035c1..6bee4a7 100644
--- a/src/H5FDmirror.c
+++ b/src/H5FDmirror.c
@@ -25,6 +25,7 @@
#include "H5Fprivate.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
#include "H5FDmirror.h" /* "Mirror" definitions */
+#include "H5FDmirror_priv.h" /* Private header for the mirror VFD */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
@@ -136,32 +137,32 @@ typedef struct H5FD_mirror_t {
#if MIRROR_DEBUG_OP_CALLS
#define LOG_OP_CALL(name) do { \
HDprintf("called %s()\n", (name)); \
- fflush(stdout); \
+ HDfflush(stdout); \
} while (0)
#else
#define LOG_OP_CALL(name) /* no-op */
#endif /* MIRROR_DEBUG_OP_CALLS */
/* Prototypes */
-static herr_t H5FD_mirror_term(void);
-static void *H5FD_mirror_fapl_get(H5FD_t *_file);
-static void *H5FD_mirror_fapl_copy(const void *_old_fa);
-static herr_t H5FD_mirror_fapl_free(void *_fa);
-static haddr_t H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static H5FD_t *H5FD_mirror_open(const char *name, unsigned flags, \
+static herr_t H5FD__mirror_term(void);
+static void *H5FD__mirror_fapl_get(H5FD_t *_file);
+static void *H5FD__mirror_fapl_copy(const void *_old_fa);
+static herr_t H5FD__mirror_fapl_free(void *_fa);
+static haddr_t H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static H5FD_t *H5FD__mirror_open(const char *name, unsigned flags,
hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_mirror_close(H5FD_t *_file);
-static herr_t H5FD_mirror_query(const H5FD_t *_file, unsigned long *flags);
-static herr_t H5FD_mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, \
+static herr_t H5FD__mirror_close(H5FD_t *_file);
+static herr_t H5FD__mirror_query(const H5FD_t *_file, unsigned long *flags);
+static herr_t H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
haddr_t addr, size_t size, const void *buf);
-static herr_t H5FD_mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+static herr_t H5FD__mirror_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
haddr_t addr, size_t size, void *buf);
-static herr_t H5FD_mirror_truncate(H5FD_t *_file, hid_t dxpl_id, \
+static herr_t H5FD__mirror_truncate(H5FD_t *_file, hid_t dxpl_id,
hbool_t closing);
-static herr_t H5FD_mirror_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_mirror_unlock(H5FD_t *_file);
+static herr_t H5FD__mirror_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__mirror_unlock(H5FD_t *_file);
static herr_t H5FD__mirror_verify_reply(H5FD_mirror_t *file);
@@ -169,40 +170,46 @@ static const H5FD_class_t H5FD_mirror_g = {
"mirror", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_mirror_term, /* terminate */
+ H5FD__mirror_term, /* terminate */
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
0, /* fapl_size */
- H5FD_mirror_fapl_get, /* fapl_get */
- H5FD_mirror_fapl_copy, /* fapl_copy */
- H5FD_mirror_fapl_free, /* fapl_free */
+ H5FD__mirror_fapl_get, /* fapl_get */
+ H5FD__mirror_fapl_copy, /* fapl_copy */
+ H5FD__mirror_fapl_free, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
- H5FD_mirror_open, /* open */
- H5FD_mirror_close, /* close */
+ H5FD__mirror_open, /* open */
+ H5FD__mirror_close, /* close */
NULL, /* cmp */
- H5FD_mirror_query, /* query */
+ H5FD__mirror_query, /* query */
NULL, /* get_type_map */
NULL, /* alloc */
NULL, /* free */
- H5FD_mirror_get_eoa, /* get_eoa */
- H5FD_mirror_set_eoa, /* set_eoa */
- H5FD_mirror_get_eof, /* get_eof */
+ H5FD__mirror_get_eoa, /* get_eoa */
+ H5FD__mirror_set_eoa, /* set_eoa */
+ H5FD__mirror_get_eof, /* get_eof */
NULL, /* get_handle */
- H5FD_mirror_read, /* read */
- H5FD_mirror_write, /* write */
+ H5FD__mirror_read, /* read */
+ H5FD__mirror_write, /* write */
NULL, /* flush */
- H5FD_mirror_truncate, /* truncate */
- H5FD_mirror_lock, /* lock */
- H5FD_mirror_unlock, /* unlock */
+ H5FD__mirror_truncate, /* truncate */
+ H5FD__mirror_lock, /* lock */
+ H5FD__mirror_unlock, /* unlock */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
+/* Declare a free list to manage the transmission buffers */
+H5FL_BLK_DEFINE_STATIC(xmit);
+
/* Declare a free list to manage the H5FD_mirror_t struct */
H5FL_DEFINE_STATIC(H5FD_mirror_t);
+/* Declare a free list to manage the H5FD_mirror_xmit_open_t struct */
+H5FL_DEFINE_STATIC(H5FD_mirror_xmit_open_t);
+
/*-------------------------------------------------------------------------
* Function: H5FD__init_package
@@ -219,12 +226,10 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD__init_package");
+ LOG_OP_CALL(FUNC);
- if (H5FD_mirror_init() < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL,
- "unable to initialize mirror VFD");
- }
+ if(H5FD_mirror_init() < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize mirror VFD");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -248,12 +253,10 @@ H5FD_mirror_init(void)
FUNC_ENTER_NOAPI(FAIL)
- LOG_OP_CALL("H5FD_mirror_init");
+ LOG_OP_CALL(FUNC);
- if (H5I_VFL != H5I_get_type(H5FD_MIRROR_g)) {
- H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t),
- FALSE);
- }
+ if(H5I_VFL != H5I_get_type(H5FD_MIRROR_g))
+ H5FD_MIRROR_g = H5FD_register(&H5FD_mirror_g, sizeof(H5FD_class_t), FALSE);
ret_value = H5FD_MIRROR_g;
@@ -263,7 +266,7 @@ done:
/* ---------------------------------------------------------------------------
- * Function: H5FD_mirror_term
+ * Function: H5FD__mirror_term
*
* Purpose: Shut down the VFD
*
@@ -271,17 +274,17 @@ done:
* ---------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_term(void)
+H5FD__mirror_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_MIRROR_g = 0;
- LOG_OP_CALL("H5FD_mirror_term");
+ LOG_OP_CALL(FUNC);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_mirror_term() */
+} /* end H5FD__mirror_term() */
/* ---------------------------------------------------------------------------
@@ -301,10 +304,14 @@ size_t
H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf)
{
uint16_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint16");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
+
HDmemcpy(&n, _buf, sizeof(n));
*out = (uint16_t)HDntohs(n);
+
return 2; /* number of bytes eaten */
} /* end H5FD__mirror_xmit_decode_uint16() */
@@ -326,14 +333,17 @@ size_t
H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf)
{
uint32_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint32");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
+
HDmemcpy(&n, _buf, sizeof(n));
*out = (uint32_t)HDntohl(n);
+
return 4; /* number of bytes eaten */
} /* end H5FD__mirror_xmit_decode_uint32() */
-
/* ---------------------------------------------------------------------------
* Function: is_host_little_endian
@@ -357,12 +367,11 @@ is_host_little_endian(void)
uint8_t u8[4];
} echeck;
echeck.u32 = 0xA1B2C3D4;
- if (echeck.u8[0] == 0xD4) {
+
+ if(echeck.u8[0] == 0xD4)
return TRUE;
- }
- else {
+ else
return FALSE;
- }
} /* end is_host_little_endian() */
@@ -385,15 +394,17 @@ size_t
H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf)
{
uint64_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
+
HDmemcpy(&n, _buf, sizeof(n));
- if (TRUE == is_host_little_endian()) {
+ if(TRUE == is_host_little_endian())
*out = BSWAP_64(n);
- }
- else {
+ else
*out = n;
- }
+
return 8;
} /* end H5FD__mirror_xmit_decode_uint64() */
@@ -412,9 +423,12 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf)
size_t
H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *_buf)
{
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint8");
+ LOG_OP_CALL(__func__);
+
HDassert(_buf && out);
+
HDmemcpy(out, _buf, sizeof(uint8_t));
+
return 1; /* number of bytes eaten */
} /* end H5FD__mirror_xmit_decode_uint8() */
@@ -435,10 +449,14 @@ size_t
H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v)
{
uint16_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_encode_uint16");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_dest);
+
n = (uint16_t)HDhtons(v);
HDmemcpy(_dest, &n, sizeof(n));
+
return 2;
} /* end H5FD__mirror_xmit_encode_uint16() */
@@ -459,10 +477,14 @@ size_t
H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v)
{
uint32_t n = 0;
- LOG_OP_CALL("H5FD__mirror_xmit_encode_uint32");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_dest);
+
n = (uint32_t)HDhtonl(v);
HDmemcpy(_dest, &n, sizeof(n));
+
return 4;
} /* end H5FD__mirror_xmit_encode_uint32() */
@@ -483,12 +505,15 @@ size_t
H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v)
{
uint64_t n = v;
- LOG_OP_CALL("H5FD__mirror_xmit_decode_uint64");
+
+ LOG_OP_CALL(__func__);
+
HDassert(_dest);
- if (TRUE == is_host_little_endian()) {
+
+ if(TRUE == is_host_little_endian())
n = BSWAP_64(v);
- }
HDmemcpy(_dest, &n, sizeof(n));
+
return 8;
} /* H5FD__mirror_xmit_encode_uint64() */
@@ -509,9 +534,12 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v)
size_t
H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v)
{
- LOG_OP_CALL("H5FD__mirror_xmit_encode_uint8");
+ LOG_OP_CALL(__func__);
+
HDassert(dest);
+
HDmemcpy(dest, &v, sizeof(v));
+
return 1;
} /* end H5FD__mirror_xmit_encode_uint8() */
@@ -540,8 +568,11 @@ H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out,
const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_header");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->magic), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->version), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->session_token),
@@ -550,6 +581,7 @@ H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out,
&buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->op), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_HEADER_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_header() */
@@ -578,11 +610,15 @@ H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out,
const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_lock");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->rw), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_LOCK_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_lock() */
@@ -612,8 +648,11 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out,
const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_open");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->flags), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->maxaddr), &buf[n_eaten]);
@@ -622,8 +661,9 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out,
HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX)
== n_eaten);
HDstrncpy(out->filename, (const char *)&buf[n_eaten],
- H5FD_MIRROR_XMIT_FILEPATH_MAX-1);
- out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX-1] = 0; /* force final NULL */
+ H5FD_MIRROR_XMIT_FILEPATH_MAX - 1);
+ out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX - 1] = 0; /* force final NULL */
+
return H5FD_MIRROR_XMIT_OPEN_SIZE;
} /* end H5FD_mirror_xmit_decode_open() */
@@ -653,15 +693,19 @@ H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out,
const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_reply");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->status), &buf[n_eaten]);
HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX)
== n_eaten);
HDstrncpy(out->message, (const char *)&buf[n_eaten],
- H5FD_MIRROR_STATUS_MESSAGE_MAX-1);
- out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX-1] = 0; /* force NULL term */
+ H5FD_MIRROR_STATUS_MESSAGE_MAX - 1);
+ out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX - 1] = 0; /* force NULL term */
+
return H5FD_MIRROR_XMIT_REPLY_SIZE;
} /* end H5FD_mirror_xmit_decode_reply() */
@@ -690,12 +734,16 @@ H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out,
const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_set_eoa");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->eoa_addr), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_EOA_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_set_eoa() */
@@ -724,13 +772,17 @@ H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out,
const unsigned char *buf)
{
size_t n_eaten = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_decode_write");
+
+ LOG_OP_CALL(__func__);
+
HDassert(out && buf);
+
n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf);
n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->offset), &buf[n_eaten]);
n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->size), &buf[n_eaten]);
HDassert(n_eaten == H5FD_MIRROR_XMIT_WRITE_SIZE);
+
return n_eaten;
} /* end H5FD_mirror_xmit_decode_write() */
@@ -754,14 +806,18 @@ H5FD_mirror_xmit_encode_header(unsigned char *dest,
const H5FD_mirror_xmit_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_header");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->magic);
n_writ += H5FD__mirror_xmit_encode_uint8((dest+n_writ), x->version);
n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->session_token);
n_writ += H5FD__mirror_xmit_encode_uint32((dest+n_writ), x->xmit_count);
n_writ += H5FD__mirror_xmit_encode_uint8((dest+n_writ), x->op);
HDassert(n_writ == H5FD_MIRROR_XMIT_HEADER_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_header() */
@@ -784,12 +840,16 @@ H5FD_mirror_xmit_encode_lock(unsigned char *dest,
const H5FD_mirror_xmit_lock_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_lock");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD_mirror_xmit_encode_header(dest,
(const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->rw);
HDassert(n_writ == H5FD_MIRROR_XMIT_LOCK_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_lock() */
@@ -813,13 +873,14 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest,
const H5FD_mirror_xmit_open_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_open");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
/* clear entire structure, but especially its filepath string area */
- for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_OPEN_SIZE; n_writ++) {
- *(dest+n_writ) = 0;
- }
- n_writ = 0;
+ HDmemset(dest, 0, H5FD_MIRROR_XMIT_OPEN_SIZE);
+
n_writ += H5FD_mirror_xmit_encode_header(dest,
(const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->flags);
@@ -827,8 +888,8 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest,
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size_t_blob);
HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX)
== n_writ);
- HDstrncpy((char *)&dest[n_writ], x->filename,
- H5FD_MIRROR_XMIT_FILEPATH_MAX);
+ HDstrncpy((char *)&dest[n_writ], x->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX);
+
return H5FD_MIRROR_XMIT_OPEN_SIZE;
} /* end H5FD_mirror_xmit_encode_open() */
@@ -853,20 +914,21 @@ H5FD_mirror_xmit_encode_reply(unsigned char *dest,
const H5FD_mirror_xmit_reply_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_reply");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
/* clear entire structure, but especially its message string area */
- for (n_writ = 0; n_writ < H5FD_MIRROR_XMIT_REPLY_SIZE; n_writ++) {
- *(dest+n_writ) = 0;
- }
- n_writ = 0;
+ HDmemset(dest, 0, H5FD_MIRROR_XMIT_REPLY_SIZE);
+
n_writ += H5FD_mirror_xmit_encode_header(dest,
(const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->status);
HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX)
== n_writ);
- HDstrncpy((char *)&dest[n_writ], x->message,
- H5FD_MIRROR_STATUS_MESSAGE_MAX);
+ HDstrncpy((char *)&dest[n_writ], x->message, H5FD_MIRROR_STATUS_MESSAGE_MAX);
+
return H5FD_MIRROR_XMIT_REPLY_SIZE;
} /* end H5FD_mirror_xmit_encode_reply() */
@@ -890,13 +952,17 @@ H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest,
const H5FD_mirror_xmit_eoa_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_set_eoa");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD_mirror_xmit_encode_header(dest,
(const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->eoa_addr);
HDassert(n_writ == H5FD_MIRROR_XMIT_EOA_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_set_eoa() */
@@ -920,14 +986,18 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest,
const H5FD_mirror_xmit_write_t *x)
{
size_t n_writ = 0;
- LOG_OP_CALL("H5FD_mirror_xmit_encode_write");
+
+ LOG_OP_CALL(__func__);
+
HDassert(dest && x);
+
n_writ += H5FD_mirror_xmit_encode_header(dest,
(const H5FD_mirror_xmit_t *)&(x->pub));
n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->offset);
n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size);
HDassert(n_writ == H5FD_MIRROR_XMIT_WRITE_SIZE);
+
return n_writ;
} /* end H5FD_mirror_xmit_encode_write() */
@@ -942,16 +1012,16 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest,
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_close");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ( (TRUE == H5FD_mirror_xmit_is_xmit(xmit)) &&
- (H5FD_MIRROR_OP_CLOSE == xmit->op) )
- {
+
+ if((TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_close() */
@@ -966,16 +1036,16 @@ H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_lock");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) &&
- (H5FD_MIRROR_OP_LOCK == xmit->pub.op) )
- {
+
+ if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_lock() */
@@ -990,16 +1060,17 @@ H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_open");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) &&
- (H5FD_MIRROR_OP_OPEN == xmit->pub.op) )
- {
+
+ if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op))
+
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_open() */
@@ -1014,16 +1085,16 @@ H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_set_eoa");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) &&
- (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op) )
- {
+
+ if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_eoa() */
@@ -1038,16 +1109,16 @@ H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_reply");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) &&
- (H5FD_MIRROR_OP_REPLY == xmit->pub.op) )
- {
+
+ if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_reply() */
@@ -1062,16 +1133,16 @@ H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_write");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ( (TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) &&
- (H5FD_MIRROR_OP_WRITE == xmit->pub.op) )
- {
+
+ if((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op))
return TRUE;
- }
+
return FALSE;
} /* end H5FD_mirror_xmit_is_write() */
@@ -1086,16 +1157,16 @@ H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit)
* Return: TRUE if valid; else FALSE.
* ---------------------------------------------------------------------------
*/
-hbool_t
+H5_ATTR_PURE hbool_t
H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit)
{
- LOG_OP_CALL("H5FD_mirror_xmit_is_xmit");
+ LOG_OP_CALL(__func__);
+
HDassert(xmit);
- if ( (H5FD_MIRROR_XMIT_MAGIC != xmit->magic) ||
- (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version) )
- {
+
+ if((H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version))
return FALSE;
- }
+
return TRUE;
} /* end H5FD_mirror_xmit_is_xmit() */
@@ -1111,60 +1182,55 @@ H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit)
* Return: SUCCEED if ok, else FAIL.
* ----------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5FD__mirror_verify_reply(H5FD_mirror_t *file)
{
- char xmit_buf[H5FD_MIRROR_XMIT_REPLY_SIZE];
+ unsigned char *xmit_buf = NULL;
struct H5FD_mirror_xmit_reply_t reply;
ssize_t read_ret = 0;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT;
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD__mirror_verify_reply");
+ LOG_OP_CALL(FUNC);
HDassert(file && file->sock_fd);
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
read_ret = HDread(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_REPLY_SIZE);
- if (read_ret < 0) {
+ if(read_ret < 0)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to read reply");
- }
- if (read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE) {
+ if(read_ret != H5FD_MIRROR_XMIT_REPLY_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unexpected read size");
- }
LOG_XMIT_BYTES("reply", xmit_buf, read_ret);
- if (H5FD_mirror_xmit_decode_reply(&reply, (const unsigned char *)xmit_buf)
- != H5FD_MIRROR_XMIT_REPLY_SIZE)
- {
+ if(H5FD_mirror_xmit_decode_reply(&reply, xmit_buf) != H5FD_MIRROR_XMIT_REPLY_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unable to decode reply xmit");
- }
- if (H5FD_mirror_xmit_is_reply(&reply) != TRUE) {
+ if(H5FD_mirror_xmit_is_reply(&reply) != TRUE)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "xmit op code was not REPLY");
- }
- if (reply.pub.session_token != file->xmit.session_token) {
+ if(reply.pub.session_token != file->xmit.session_token)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "wrong session");
- }
-
- if (reply.pub.xmit_count != (file->xmit_i)++) {
+ if(reply.pub.xmit_count != (file->xmit_i)++)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "xmit out of sync");
- }
-
- if (reply.status != H5FD_MIRROR_STATUS_OK) {
- HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL,
- "%s", (const char *)(reply.message));
- }
+ if(reply.status != H5FD_MIRROR_STATUS_OK)
+ HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "%s", (const char *)(reply.message));
done:
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD__mirror_verify_reply() */
/* -------------------------------------------------------------------------
- * Function: H5FD_mirror_fapl_get
+ * Function: H5FD__mirror_fapl_get
*
* Purpose: Get the file access propety list which could be used to create
* an identical file.
@@ -1174,37 +1240,35 @@ done:
* -------------------------------------------------------------------------
*/
static void *
-H5FD_mirror_fapl_get(H5FD_t *_file)
+H5FD__mirror_fapl_get(H5FD_t *_file)
{
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
H5FD_mirror_fapl_t *fa = NULL;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_fapl_get");
+ LOG_OP_CALL(FUNC);
fa = (H5FD_mirror_fapl_t *)H5MM_calloc(sizeof(H5FD_mirror_fapl_t));
- if (NULL == fa) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "calloc failed");
- }
+ if(NULL == fa)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "calloc failed");
HDmemcpy(fa, &(file->fa), sizeof(H5FD_mirror_fapl_t));
ret_value = fa;
done:
- if (ret_value == NULL) {
- if (fa != NULL) {
+ if(ret_value == NULL)
+ if(fa != NULL)
H5MM_xfree(fa);
- }
- }
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_fapl_get() */
+} /* end H5FD__mirror_fapl_get() */
/* -------------------------------------------------------------------------
- * Function: H5FD_mirror_fapl_copy
+ * Function: H5FD__mirror_fapl_copy
*
* Purpose: Copies the mirror vfd-specific file access properties.
*
@@ -1213,37 +1277,34 @@ done:
* -------------------------------------------------------------------------
*/
static void *
-H5FD_mirror_fapl_copy(const void *_old_fa)
+H5FD__mirror_fapl_copy(const void *_old_fa)
{
const H5FD_mirror_fapl_t *old_fa = (const H5FD_mirror_fapl_t *)_old_fa;
H5FD_mirror_fapl_t *new_fa = NULL;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_fapl_copy");
+ LOG_OP_CALL(FUNC);
new_fa = (H5FD_mirror_fapl_t *)H5MM_malloc(sizeof(H5FD_mirror_fapl_t));
- if (new_fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed");
- }
+ if(new_fa == NULL)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "memory allocation failed");
HDmemcpy(new_fa, old_fa, sizeof(H5FD_mirror_fapl_t));
ret_value = new_fa;
done:
- if (ret_value == NULL) {
- if (new_fa != NULL) {
+ if(ret_value == NULL)
+ if(new_fa != NULL)
H5MM_xfree(new_fa);
- }
- }
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_fapl_copy() */
+} /* end H5FD__mirror_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_fapl_free
+ * Function: H5FD__mirror_fapl_free
*
* Purpose: Frees the mirror VFD-specific file access properties.
*
@@ -1251,13 +1312,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_fapl_free(void *_fa)
+H5FD__mirror_fapl_free(void *_fa)
{
H5FD_mirror_fapl_t *fa = (H5FD_mirror_fapl_t*)_fa;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL("H5FD_mirror_fapl_free");
+ LOG_OP_CALL(FUNC);
/* sanity check */
HDassert(fa != NULL);
@@ -1267,7 +1328,7 @@ H5FD_mirror_fapl_free(void *_fa)
H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_mirror_fapl_free() */
+} /* end H5FD__mirror_fapl_free() */
/* -------------------------------------------------------------------------
@@ -1289,26 +1350,20 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*x", fapl_id, fa_out);
- LOG_OP_CALL("H5Pget_fapl_mirror");
+ LOG_OP_CALL(FUNC);
- if (NULL == fa_out) {
+ if(NULL == fa_out)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL");
- }
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (NULL == plist) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
- "not a file access property list");
- }
-
- if (H5P_peek_driver(plist) != H5FD_MIRROR) {
+ if(NULL == plist)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ if(H5P_peek_driver(plist) != H5FD_MIRROR)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
- }
fa = (const H5FD_mirror_fapl_t *)H5P_peek_driver_info(plist);
- if (NULL == fa) {
+ if(NULL == fa)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info");
- }
HDassert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */
@@ -1337,22 +1392,17 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*x", fapl_id, fa);
- LOG_OP_CALL("H5Pset_fapl_mirror");
+ LOG_OP_CALL(FUNC);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (NULL == plist) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
- "not a file access property list");
- }
- if (NULL == fa) {
+ if(NULL == plist)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
+ if(NULL == fa)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null fapl_t pointer");
- }
- if (H5FD_MIRROR_FAPL_MAGIC != fa->magic) {
+ if(H5FD_MIRROR_FAPL_MAGIC != fa->magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fapl_t magic");
- }
- if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version) {
+ if(H5FD_MIRROR_CURR_FAPL_T_VERSION != fa->version)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown fapl_t version");
- }
ret_value = H5P_set_driver(plist, H5FD_MIRROR, (const void *)fa);
@@ -1362,7 +1412,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_open
+ * Function: H5FD__mirror_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -1376,64 +1426,51 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_mirror_open(const char *name,
+H5FD__mirror_open(const char *name,
unsigned flags,
hid_t fapl_id,
haddr_t maxaddr)
{
-#define MIRR_OPEN_MAXBUF 16 /* local symbol to give meaning to magic number */
- /* #defined because it is needed at compile time */
- /* Large enough to hold a port number string */
int live_socket = -1;
struct sockaddr_in target_addr;
socklen_t addr_size;
- char xmit_buf[H5FD_MIRROR_XMIT_OPEN_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_fapl_t fa;
H5FD_mirror_t *file = NULL;
- H5FD_mirror_xmit_open_t open_xmit;
+ H5FD_mirror_xmit_open_t *open_xmit = NULL;
H5FD_t *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_open");
+ LOG_OP_CALL(FUNC);
/* --------------- */
/* Check arguments */
/* --------------- */
- if (!name || !*name) {
+ if(!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name");
- }
- if (HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX) {
+ if(HDstrlen(name) >= H5FD_MIRROR_XMIT_FILEPATH_MAX)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "filename is too long");
- }
- if (0 == maxaddr || HADDR_UNDEF == maxaddr) {
+ if(0 == maxaddr || HADDR_UNDEF == maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr");
- }
- if (ADDR_OVERFLOW(maxaddr)) {
+ if(ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr");
- }
- if (H5Pget_fapl_mirror(fapl_id, &fa) == FAIL) {
+ if(H5Pget_fapl_mirror(fapl_id, &fa) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get config info");
- }
-
- if (H5FD_MIRROR_FAPL_MAGIC != fa.magic) {
+ if(H5FD_MIRROR_FAPL_MAGIC != fa.magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl magic");
- }
-
- if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version) {
+ if(H5FD_MIRROR_CURR_FAPL_T_VERSION != fa.version)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid fapl version");
- }
/* --------------------- */
/* Handshake with remote */
/* --------------------- */
live_socket = HDsocket(AF_INET, SOCK_STREAM, 0);
- if (live_socket < 0) {
+ if(live_socket < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't create socket");
- }
target_addr.sin_family = AF_INET;
target_addr.sin_port = HDhtons((uint16_t)fa.handshake_port);
@@ -1441,21 +1478,16 @@ H5FD_mirror_open(const char *name,
HDmemset(target_addr.sin_zero, '\0', sizeof target_addr.sin_zero);
addr_size = sizeof(target_addr);
- if (HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "can't connect to remote server");
- }
+ if(HDconnect(live_socket, (struct sockaddr *)&target_addr, addr_size) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't connect to remote server");
/* ------------- */
/* Open the file */
/* ------------- */
file = (H5FD_mirror_t *)H5FL_CALLOC(H5FD_mirror_t);
- if (NULL == file) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "unable to allocate file struct");
- }
+ if(NULL == file)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct");
file->sock_fd = live_socket;
file->xmit_i = 0;
@@ -1466,49 +1498,53 @@ H5FD_mirror_open(const char *name,
file->xmit.session_token = (uint32_t)(0x01020304 ^ file->sock_fd); /* TODO: hashing? */
/* int --> uint32_t may truncate on some systems... shouldn't matter? */
+ open_xmit = (H5FD_mirror_xmit_open_t *)H5FL_CALLOC(H5FD_mirror_xmit_open_t);
+ if(NULL == open_xmit)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate open_xmit struct");
+
file->xmit.op = H5FD_MIRROR_OP_OPEN;
- open_xmit.pub = file->xmit;
- open_xmit.flags = (uint32_t)flags;
- open_xmit.maxaddr = (uint64_t)maxaddr;
- open_xmit.size_t_blob = (uint64_t)((size_t)(-1));
- HDsnprintf(open_xmit.filename, H5FD_MIRROR_XMIT_FILEPATH_MAX-1, "%s", name);
-
- if (H5FD_mirror_xmit_encode_open((unsigned char *)xmit_buf,
- (const H5FD_mirror_xmit_open_t *)&open_xmit)
- != H5FD_MIRROR_XMIT_OPEN_SIZE)
- {
+ open_xmit->pub = file->xmit;
+ open_xmit->flags = (uint32_t)flags;
+ open_xmit->maxaddr = (uint64_t)maxaddr;
+ open_xmit->size_t_blob = (uint64_t)((size_t)(-1));
+ HDsnprintf(open_xmit->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX-1, "%s", name);
+
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate xmit buffer");
+
+ if(H5FD_mirror_xmit_encode_open(xmit_buf, open_xmit) != H5FD_MIRROR_XMIT_OPEN_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to encode open");
- }
LOG_XMIT_BYTES("open", xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0) {
+ if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_OPEN_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, NULL, "unable to transmit open");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid reply");
- }
ret_value = (H5FD_t *)file;
done:
- if (NULL == ret_value) {
- if (file) {
+ if(NULL == ret_value) {
+ if(file)
file = H5FL_FREE(H5FD_mirror_t, file);
- }
- if (live_socket >= 0 && HDclose(live_socket) < 0) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
- "can't close socket");
- }
+ if(live_socket >= 0 && HDclose(live_socket) < 0)
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "can't close socket");
}
+
+ if(open_xmit)
+ open_xmit = H5FL_FREE(H5FD_mirror_xmit_open_t, open_xmit);
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-#undef MIRR_OPEN_MAXBUF
-} /* end H5FD_mirror_open() */
+} /* end H5FD__mirror_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_close
+ * Function: H5FD__mirror_close
*
* Purpose: Closes the HDF5 file.
*
@@ -1523,16 +1559,16 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_close(H5FD_t *_file)
+H5FD__mirror_close(H5FD_t *_file)
{
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE];
+ unsigned char *xmit_buf = NULL;
int xmit_encoded = 0; /* monitor point of failure */
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_close");
+ LOG_OP_CALL(FUNC);
/* Sanity check */
HDassert(file);
@@ -1541,68 +1577,59 @@ H5FD_mirror_close(H5FD_t *_file)
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_CLOSE;
- if (H5FD_mirror_xmit_encode_header(xmit_buf,
- (const H5FD_mirror_xmit_t *)&(file->xmit))
- != H5FD_MIRROR_XMIT_HEADER_SIZE)
- {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to encode close");
- }
xmit_encoded = 1;
LOG_XMIT_BYTES("close", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) {
+ if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
- if (HDclose(file->sock_fd) < 0) {
+ if(HDclose(file->sock_fd) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket");
- }
done:
- if (ret_value == FAIL) {
- if (xmit_encoded == 0) {
+ if(ret_value == FAIL) {
+ if(xmit_encoded == 0) {
/* Encode failed; send GOODBYE to force writer halt.
* We can ignore any response from the writer, if we receive
* any reply at all.
*/
- if (HDwrite(file->sock_fd, "GOODBYE", HDstrlen("GOODBYE")) < 0) {
- HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to transmit close");
- if (HDclose(file->sock_fd) < 0) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "can't close socket");
- }
+ if(HDwrite(file->sock_fd, "GOODBYE", HDstrlen("GOODBYE")) < 0) {
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to transmit close");
+ if(HDclose(file->sock_fd) < 0)
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket");
file->sock_fd = -1; /* invalidate for later */
} /* end if problem writing goodbye; go down hard */
else
- if (HDshutdown(file->sock_fd, SHUT_WR) < 0) {
- HDONE_ERROR(H5E_VFL, H5E_BADVALUE, FAIL,
- "can't shutdown socket write: %s",
- HDstrerror(errno));
- } /* end else-if problem shutting down socket */
+ if(HDshutdown(file->sock_fd, SHUT_WR) < 0)
+ HDONE_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't shutdown socket write: %s", HDstrerror(errno));
} /* end if xmit encode failed */
- if (file->sock_fd >= 0) {
- if (HDclose(file->sock_fd) < 0) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "can't close socket");
- }
- } /* end if socket not closed by going down hard */
+ if(file->sock_fd >= 0)
+ if(HDclose(file->sock_fd) < 0)
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "can't close socket");
} /* end if error */
file = H5FL_FREE(H5FD_mirror_t, file); /* always release resources */
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_close() */
+} /* end H5FD__mirror_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_query
+ * Function: H5FD__mirror_query
*
* Purpose: Get the driver feature flags implemented by the driver.
*
@@ -1610,11 +1637,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
+H5FD__mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR;
+ FUNC_ENTER_STATIC_NOERR;
- LOG_OP_CALL("H5FD_mirror_query");
+ LOG_OP_CALL(FUNC);
/* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as
* the underying driver -- as such, the Mirror VFD implementation copies
@@ -1624,23 +1651,21 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
* is never included.
* -- JOS 2020-01-13
*/
- if (flags) {
- *flags = 0 \
- | H5FD_FEAT_AGGREGATE_METADATA \
+ if(flags)
+ *flags = H5FD_FEAT_AGGREGATE_METADATA \
| H5FD_FEAT_ACCUMULATE_METADATA \
| H5FD_FEAT_DATA_SIEVE \
| H5FD_FEAT_AGGREGATE_SMALLDATA \
| H5FD_FEAT_POSIX_COMPAT_HANDLE \
| H5FD_FEAT_SUPPORTS_SWMR_IO \
| H5FD_FEAT_DEFAULT_VFD_COMPATIBLE;
- }
FUNC_LEAVE_NOAPI(SUCCEED);
-} /* end H5FD_mirror_query() */
+} /* end H5FD__mirror_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_get_eoa
+ * Function: H5FD__mirror_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -1652,22 +1677,22 @@ H5FD_mirror_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL("H5FD_mirror_get_eoa");
+ LOG_OP_CALL(FUNC);
HDassert(file);
FUNC_LEAVE_NOAPI(file->eoa)
-} /* end H5FD_mirror_get_eoa() */
+} /* end H5FD__mirror_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_set_eoa
+ * Function: H5FD__mirror_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -1677,16 +1702,16 @@ H5FD_mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
+H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
{
H5FD_mirror_xmit_eoa_t xmit_eoa;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_EOA_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_set_eoa");
+ LOG_OP_CALL(FUNC);
HDassert(file);
@@ -1699,31 +1724,31 @@ H5FD_mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr)
xmit_eoa.type = (uint8_t)type;
xmit_eoa.eoa_addr = (uint64_t)addr;
- if (H5FD_mirror_xmit_encode_set_eoa(xmit_buf,
- (const H5FD_mirror_xmit_eoa_t *)&xmit_eoa)
- != H5FD_MIRROR_XMIT_EOA_SIZE)
- {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if(H5FD_mirror_xmit_encode_set_eoa(xmit_buf, &xmit_eoa) != H5FD_MIRROR_XMIT_EOA_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode set-eoa");
- }
LOG_XMIT_BYTES("set-eoa", xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL,
- "unable to transmit set-eoa");
- }
+ if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_EOA_SIZE) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit set-eoa");
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_set_eoa() */
+} /* end H5FD__mirror_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_get_eof
+ * Function: H5FD__mirror_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the filesystem end-of-file or the HDF5 end-of-address
@@ -1736,49 +1761,43 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_mirror_t *file = (const H5FD_mirror_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- LOG_OP_CALL("H5FD_mirror_get_eof");
+ LOG_OP_CALL(FUNC);
HDassert(file);
FUNC_LEAVE_NOAPI(file->eof)
-} /* end H5FD_mirror_get_eof() */
+} /* end H5FD__mirror_get_eof() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_read
+ * Function: H5FD__mirror_read
*
- * Purpose: Required to register the driver.
- * If called, MUST fail.
+ * Purpose: Required to register the driver, but if called, MUST fail.
*
* Return: FAIL
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_read(H5FD_t H5_ATTR_UNUSED *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- hid_t H5_ATTR_UNUSED fapl_id,
- haddr_t H5_ATTR_UNUSED addr,
- size_t H5_ATTR_UNUSED size,
- void H5_ATTR_UNUSED *buf)
+H5FD__mirror_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr,
+ size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf)
{
- herr_t ret_value = FAIL;
+ FUNC_ENTER_STATIC_NOERR
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ LOG_OP_CALL(FUNC);
- LOG_OP_CALL("H5FD_mirror_read");
-
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_read() */
+ FUNC_LEAVE_NOAPI(FAIL)
+} /* end H5FD__mirror_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_write
+ * Function: H5FD__mirror_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -1795,21 +1814,17 @@ H5FD_mirror_read(H5FD_t H5_ATTR_UNUSED *_file,
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_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__mirror_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_mirror_xmit_write_t xmit_write;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_WRITE_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_write");
+ LOG_OP_CALL(FUNC);
HDassert(file);
HDassert(buf);
@@ -1822,43 +1837,41 @@ H5FD_mirror_write(H5FD_t *_file,
xmit_write.offset = (uint64_t)addr;
xmit_write.type = (uint8_t)type;
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
/* Notify Writer of incoming data to write. */
- if (H5FD_mirror_xmit_encode_write(xmit_buf,
- (const H5FD_mirror_xmit_write_t *)&xmit_write)
- != H5FD_MIRROR_XMIT_WRITE_SIZE)
- {
+ if(H5FD_mirror_xmit_encode_write(xmit_buf, &xmit_write) != H5FD_MIRROR_XMIT_WRITE_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode write");
- }
LOG_XMIT_BYTES("write", xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0) {
+ if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_WRITE_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit write");
- }
/* Check that our write xmission was received */
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
/* Send the data to be written */
- if (HDwrite(file->sock_fd, buf, size) < 0) {
+ if(HDwrite(file->sock_fd, buf, size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit data");
- }
/* Writer should reply that it got the data and is still okay/ready */
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_write() */
+} /* end H5FD__mirror_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_truncate
+ * Function: H5FD__mirror_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -1867,45 +1880,45 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_truncate(H5FD_t *_file,
- hid_t H5_ATTR_UNUSED dxpl_id,
- hbool_t H5_ATTR_UNUSED closing)
+H5FD__mirror_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id,
+ hbool_t H5_ATTR_UNUSED closing)
{
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_truncate");
+ LOG_OP_CALL(FUNC);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_TRUNCATE;
- if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit))
- != H5FD_MIRROR_XMIT_HEADER_SIZE)
- {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode truncate");
- }
LOG_XMIT_BYTES("truncate", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL,
- "unable to transmit truncate");
- }
+ if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit truncate");
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mirror_truncate() */
+} /* end H5FD__mirror_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_lock
+ * Function: H5FD__mirror_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -1916,16 +1929,16 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_lock(H5FD_t *_file, hbool_t rw)
+H5FD__mirror_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_mirror_xmit_lock_t xmit_lock;
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_LOCK_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT;
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_lock");
+ LOG_OP_CALL(FUNC);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_LOCK;
@@ -1933,30 +1946,31 @@ H5FD_mirror_lock(H5FD_t *_file, hbool_t rw)
xmit_lock.pub = file->xmit;
xmit_lock.rw = (uint64_t)rw;
- if (H5FD_mirror_xmit_encode_lock(xmit_buf,
- (const H5FD_mirror_xmit_lock_t *)&xmit_lock)
- != H5FD_MIRROR_XMIT_LOCK_SIZE)
- {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if(H5FD_mirror_xmit_encode_lock(xmit_buf, &xmit_lock) != H5FD_MIRROR_XMIT_LOCK_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode lock");
- }
LOG_XMIT_BYTES("lock", xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0) {
+ if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_LOCK_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit lock");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5FD_mirror_lock */
+} /* end H5FD__mirror_lock */
/*-------------------------------------------------------------------------
- * Function: H5FD_mirror_unlock
+ * Function: H5FD__mirror_unlock
*
* Purpose: Remove the existing lock on the file.
*
@@ -1964,38 +1978,40 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_mirror_unlock(H5FD_t *_file)
+H5FD__mirror_unlock(H5FD_t *_file)
{
- unsigned char xmit_buf[H5FD_MIRROR_XMIT_HEADER_SIZE];
+ unsigned char *xmit_buf = NULL;
H5FD_mirror_t *file = (H5FD_mirror_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT;
+ FUNC_ENTER_STATIC
- LOG_OP_CALL("H5FD_mirror_unlock");
+ LOG_OP_CALL(FUNC);
file->xmit.xmit_count = (file->xmit_i)++;
file->xmit.op = H5FD_MIRROR_OP_UNLOCK;
- if (H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit))
- != H5FD_MIRROR_XMIT_HEADER_SIZE)
- {
+ xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX);
+ if(NULL == xmit_buf)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate xmit buffer");
+
+ if(H5FD_mirror_xmit_encode_header(xmit_buf, &(file->xmit)) != H5FD_MIRROR_XMIT_HEADER_SIZE)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to encode unlock");
- }
LOG_XMIT_BYTES("unlock", xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE);
- if (HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0) {
+ if(HDwrite(file->sock_fd, xmit_buf, H5FD_MIRROR_XMIT_HEADER_SIZE) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to transmit unlock");
- }
- if (H5FD__mirror_verify_reply(file) == FAIL) {
+ if(H5FD__mirror_verify_reply(file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid reply");
- }
done:
+ if(xmit_buf)
+ xmit_buf = H5FL_BLK_FREE(xmit, xmit_buf);
+
FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5FD_mirror_unlock */
+} /* end H5FD__mirror_unlock */
#endif /* H5_HAVE_MIRROR_VFD */
diff --git a/src/H5FDmirror.h b/src/H5FDmirror.h
index fb66b7b..7d15c1b 100644
--- a/src/H5FDmirror.h
+++ b/src/H5FDmirror.h
@@ -65,297 +65,6 @@ H5_DLL hid_t H5FD_mirror_init(void);
H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out);
H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa);
-/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
- * IPC - Mirror VFD and Remote Worker application.
- * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
- */
-
-
-/* The maximum allowed size for a receiving buffer when accepting bytes to
- * write. Writes larger than this size are performed by multiple accept-write
- * steps by the Writer. */
-#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */
-
-#define H5FD_MIRROR_XMIT_CURR_VERSION 1
-#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B
-
-#define H5FD_MIRROR_OP_OPEN 1
-#define H5FD_MIRROR_OP_CLOSE 2
-#define H5FD_MIRROR_OP_WRITE 3
-#define H5FD_MIRROR_OP_TRUNCATE 4
-#define H5FD_MIRROR_OP_REPLY 5
-#define H5FD_MIRROR_OP_SET_EOA 6
-#define H5FD_MIRROR_OP_LOCK 7
-#define H5FD_MIRROR_OP_UNLOCK 8
-
-#define H5FD_MIRROR_STATUS_OK 0
-#define H5FD_MIRROR_STATUS_ERROR 1
-#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */
-
-/* Maximum length of a path/filename string, including the NULL-terminator.
- * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */
-#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097
-
-/* Define the exact sizes of the various xmit blobs as sent over the wire.
- * This is used to minimize the number of bytes transmitted as well as to
- * sanity-check received bytes.
- * Any modifications to the xmit structures and/or the encode/decode functions
- * must be reflected here.
- * */
-#define H5FD_MIRROR_XMIT_HEADER_SIZE 14
-#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9)
-#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8)
-#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX)
-#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX)
-#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17)
-
-/* Maximum length of any xmit. */
-#define H5FD_MIRROR_XMIT_BUFFER_MAX MAX2( MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, \
- H5FD_MIRROR_XMIT_EOA_SIZE, \
- H5FD_MIRROR_XMIT_LOCK_SIZE), \
- MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, \
- H5FD_MIRROR_XMIT_REPLY_SIZE, \
- H5FD_MIRROR_XMIT_WRITE_SIZE) ) \
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_t
- *
- * Common structure 'header' for all mirror VFD/worker IPC.
- * Must be the first component of a derived operation xmit structure,
- * such as file-open or write command.
- *
- * `magic` (uint32_t)
- * A "unique" number identifying the structure and endianness of
- * transmitting maching.
- * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender".
- *
- * `version` (uint8_t)
- * Number used to identify the structure membership.
- * Allows sane modifications to this structure in the future.
- * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION.
- *
- * `session_token` (uint32_t)
- * A "unique" number identifying the session between VFD sender and
- * remote receiver/worker/writer. Exists to help sanity-check.
- *
- * `xmit_count` (uint32_t)
- * Which transmission this is since the session began.
- * Used to sanity-check transmission errors.
- * First xmit (file-open) must be 0.
- *
- * `op` (uint8_t)
- * Number identifying which operation to perform.
- * Corresponds with the extended structure outside of this xmit header.
- * Possible values are all defined H5FD_MIRROR_OP_* constants.
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_t {
- uint32_t magic;
- uint8_t version;
- uint32_t session_token;
- uint32_t xmit_count;
- uint8_t op;
-} H5FD_mirror_xmit_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_eoa_t
- *
- * Structure containing eoa-set information from VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `type` (uint8_t)
- * System-independent alias for H5F[D]_mem_t.
- * Specifies datatype to be written.
- *
- * `eoa_addr` (uint64_t)
- * New address for eoa.
- * (Natively 'haddr_t', always a 64-bit field)
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_eoa_t {
- H5FD_mirror_xmit_t pub;
- uint8_t type;
- uint64_t eoa_addr;
-} H5FD_mirror_xmit_eoa_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_lock_t
- *
- * Structure containing eoa-set information from VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `rw` (uint64_t)
- * The Read/Write mode flag passed into H5FDlock().
- * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit?
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_lock_t {
- H5FD_mirror_xmit_t pub;
- uint64_t rw;
-} H5FD_mirror_xmit_lock_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_open_t
- *
- * Structure containing file-open information from the VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `flags` (uint32_t)
- * VFL-layer file-open flags passed directly to H5FDopen().
- * (Natively 'unsigned [int]') TODO: native int may be 64-bit?
- *
- * `maxaddr` (uint64_t)
- * VFL-layer maximum allowed address space for the file to open passed
- * directly to H5FDopen().
- * (Natively 'haddr_t', always a 64-bit field)
- *
- * `size_t_blob` (uint64_t)
- * A number indicating how large a size_t is on the sending system.
- * Must be set to (uint64_t)((size_t)(-1))
- * (maximum possible value of size_t, cast to uint64_t).
- * The receiving system inspects this value -- if the local (remote)
- * size_t is smaller than that of the Sender, issues a warning.
- * Not an error, as:
- * 1. It is assumed that underlying file systems/drivers have become
- * smart enough to handle file sizes that otherwise might be
- * constrained.
- * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the
- * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of
- * any size_t storage size disparity.
- *
- * `filename` (char[])
- * String giving the filename and path of file to open.
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_open_t {
- H5FD_mirror_xmit_t pub;
- uint32_t flags;
- uint64_t maxaddr;
- uint64_t size_t_blob;
- char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX];
-} H5FD_mirror_xmit_open_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_reply_t
- *
- * Structure used by the remote receiver/worker/writer to respond to
- * a command from the VFD sender.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `status` (uint32_t)
- * Number indicating whether the command was successful or if an
- * occured.
- * Allowed values are H5FD_MIRROR_STATUS_OK and
- * H5FD_MIRROR_STATUS_ERROR.
- *
- * `message` (char[])
- * Error message. Populated if and only if there was a problem.
- * It is possible that a message may reach the end of the alloted
- * space without a NULL terminator -- the onus is on the programmer to
- * handle this situation.
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_reply_t {
- H5FD_mirror_xmit_t pub;
- uint32_t status;
- char message[H5FD_MIRROR_STATUS_MESSAGE_MAX];
-} H5FD_mirror_xmit_reply_t;
-
-/* ---------------------------------------------------------------------------
- * Structure: H5FD_mirror_xmit_write_t
- *
- * Structure containing data-write information from VFD sender.
- *
- * The data to be written is transmitted in subsequent, packets
- * and may be broken up into more than one transmission buffer.
- * The VFD sender and remote receiver/worker/writer must coordinate
- * the receipt of data.
- *
- * `pub` (H5FD_mirror_xmit_t)
- * Common transmission header, containing session information.
- * Must be first.
- *
- * `type` (uint8_t)
- * Specifies datatype to be written.
- * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h)
- *
- * `offset` (uint64_t)
- * Start location of write in file.
- * (Natively 'haddr_t', always a 64-bit field)
- *
- * `size` (uint64_t)
- * Size of the data to be written, in bytes.
- * (Natively 'size_t', accommodate the largest possible as 64-bits)
- *
- * ---------------------------------------------------------------------------
- */
-typedef struct H5FD_mirror_xmit_write_t {
- H5FD_mirror_xmit_t pub;
- uint8_t type;
- uint64_t offset;
- uint64_t size;
-} H5FD_mirror_xmit_write_t;
-
-
-
-/* Encode/decode routines are required to "pack" the xmit data into a known
- * byte format for transmission over the wire.
- *
- * All component numbers must be stored in "network" word order (Big-Endian).
- *
- * All components must be packed in the order given in the structure definition.
- *
- * All components must be packed with zero padding between.
- */
-
-H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v);
-H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v);
-
-H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf);
-H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf);
-
-H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x);
-H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x);
-
-H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit);
-H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit);
-
#ifdef __cplusplus
}
#endif
@@ -368,4 +77,3 @@ H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit);
#endif /* H5FDmirror_H */
-
diff --git a/src/H5FDmirror_priv.h b/src/H5FDmirror_priv.h
new file mode 100644
index 0000000..dc15441
--- /dev/null
+++ b/src/H5FDmirror_priv.h
@@ -0,0 +1,323 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Public, shared definitions for Mirror VFD & remote Writer.
+ */
+
+#ifndef H5FDmirror_priv_H
+#define H5FDmirror_priv_H
+
+#ifdef H5_HAVE_MIRROR_VFD
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+ * IPC - Mirror VFD and Remote Worker application.
+ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+ */
+
+/* The maximum allowed size for a receiving buffer when accepting bytes to
+ * write. Writes larger than this size are performed by multiple accept-write
+ * steps by the Writer. */
+#define H5FD_MIRROR_DATA_BUFFER_MAX H5_GB /* 1 Gigabyte */
+
+#define H5FD_MIRROR_XMIT_CURR_VERSION 1
+#define H5FD_MIRROR_XMIT_MAGIC 0x87F8005B
+
+#define H5FD_MIRROR_OP_OPEN 1
+#define H5FD_MIRROR_OP_CLOSE 2
+#define H5FD_MIRROR_OP_WRITE 3
+#define H5FD_MIRROR_OP_TRUNCATE 4
+#define H5FD_MIRROR_OP_REPLY 5
+#define H5FD_MIRROR_OP_SET_EOA 6
+#define H5FD_MIRROR_OP_LOCK 7
+#define H5FD_MIRROR_OP_UNLOCK 8
+
+#define H5FD_MIRROR_STATUS_OK 0
+#define H5FD_MIRROR_STATUS_ERROR 1
+#define H5FD_MIRROR_STATUS_MESSAGE_MAX 256 /* Dedicated error message size */
+
+/* Maximum length of a path/filename string, including the NULL-terminator.
+ * Must not be smaller than H5FD_SPLITTER_PATH_MAX. */
+#define H5FD_MIRROR_XMIT_FILEPATH_MAX 4097
+
+/* Define the exact sizes of the various xmit blobs as sent over the wire.
+ * This is used to minimize the number of bytes transmitted as well as to
+ * sanity-check received bytes.
+ * Any modifications to the xmit structures and/or the encode/decode functions
+ * must be reflected here.
+ * */
+#define H5FD_MIRROR_XMIT_HEADER_SIZE 14
+#define H5FD_MIRROR_XMIT_EOA_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 9)
+#define H5FD_MIRROR_XMIT_LOCK_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 8)
+#define H5FD_MIRROR_XMIT_OPEN_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 20 + H5FD_MIRROR_XMIT_FILEPATH_MAX)
+#define H5FD_MIRROR_XMIT_REPLY_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 4 + H5FD_MIRROR_STATUS_MESSAGE_MAX)
+#define H5FD_MIRROR_XMIT_WRITE_SIZE (H5FD_MIRROR_XMIT_HEADER_SIZE + 17)
+
+/* Maximum length of any xmit. */
+#define H5FD_MIRROR_XMIT_BUFFER_MAX MAX2( MAX3(H5FD_MIRROR_XMIT_HEADER_SIZE, \
+ H5FD_MIRROR_XMIT_EOA_SIZE, \
+ H5FD_MIRROR_XMIT_LOCK_SIZE), \
+ MAX3(H5FD_MIRROR_XMIT_OPEN_SIZE, \
+ H5FD_MIRROR_XMIT_REPLY_SIZE, \
+ H5FD_MIRROR_XMIT_WRITE_SIZE) ) \
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_t
+ *
+ * Common structure 'header' for all mirror VFD/worker IPC.
+ * Must be the first component of a derived operation xmit structure,
+ * such as file-open or write command.
+ *
+ * `magic` (uint32_t)
+ * A "unique" number identifying the structure and endianness of
+ * transmitting maching.
+ * Must be set to H5FD_MIRROR_XMIT_MAGIC native to the VFD "sender".
+ *
+ * `version` (uint8_t)
+ * Number used to identify the structure membership.
+ * Allows sane modifications to this structure in the future.
+ * Must be set to H5FD_MIRROR_XMIT_CURR_VERSION.
+ *
+ * `session_token` (uint32_t)
+ * A "unique" number identifying the session between VFD sender and
+ * remote receiver/worker/writer. Exists to help sanity-check.
+ *
+ * `xmit_count` (uint32_t)
+ * Which transmission this is since the session began.
+ * Used to sanity-check transmission errors.
+ * First xmit (file-open) must be 0.
+ *
+ * `op` (uint8_t)
+ * Number identifying which operation to perform.
+ * Corresponds with the extended structure outside of this xmit header.
+ * Possible values are all defined H5FD_MIRROR_OP_* constants.
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_t {
+ uint32_t magic;
+ uint8_t version;
+ uint32_t session_token;
+ uint32_t xmit_count;
+ uint8_t op;
+} H5FD_mirror_xmit_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_eoa_t
+ *
+ * Structure containing eoa-set information from VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `type` (uint8_t)
+ * System-independent alias for H5F[D]_mem_t.
+ * Specifies datatype to be written.
+ *
+ * `eoa_addr` (uint64_t)
+ * New address for eoa.
+ * (Natively 'haddr_t', always a 64-bit field)
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_eoa_t {
+ H5FD_mirror_xmit_t pub;
+ uint8_t type;
+ uint64_t eoa_addr;
+} H5FD_mirror_xmit_eoa_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_lock_t
+ *
+ * Structure containing eoa-set information from VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `rw` (uint64_t)
+ * The Read/Write mode flag passed into H5FDlock().
+ * (Natively `hbool_t`, an 'int') TODO: native int may be 64-bit?
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_lock_t {
+ H5FD_mirror_xmit_t pub;
+ uint64_t rw;
+} H5FD_mirror_xmit_lock_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_open_t
+ *
+ * Structure containing file-open information from the VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `flags` (uint32_t)
+ * VFL-layer file-open flags passed directly to H5FDopen().
+ * (Natively 'unsigned [int]') TODO: native int may be 64-bit?
+ *
+ * `maxaddr` (uint64_t)
+ * VFL-layer maximum allowed address space for the file to open passed
+ * directly to H5FDopen().
+ * (Natively 'haddr_t', always a 64-bit field)
+ *
+ * `size_t_blob` (uint64_t)
+ * A number indicating how large a size_t is on the sending system.
+ * Must be set to (uint64_t)((size_t)(-1))
+ * (maximum possible value of size_t, cast to uint64_t).
+ * The receiving system inspects this value -- if the local (remote)
+ * size_t is smaller than that of the Sender, issues a warning.
+ * Not an error, as:
+ * 1. It is assumed that underlying file systems/drivers have become
+ * smart enough to handle file sizes that otherwise might be
+ * constrained.
+ * 2. The Mirror Writer ingests bytes to write multiple 'slices' if the
+ * size is greater than H5FD_MIRROR_DATA_BUFFER_MAX, regardless of
+ * any size_t storage size disparity.
+ *
+ * `filename` (char[])
+ * String giving the filename and path of file to open.
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_open_t {
+ H5FD_mirror_xmit_t pub;
+ uint32_t flags;
+ uint64_t maxaddr;
+ uint64_t size_t_blob;
+ char filename[H5FD_MIRROR_XMIT_FILEPATH_MAX];
+} H5FD_mirror_xmit_open_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_reply_t
+ *
+ * Structure used by the remote receiver/worker/writer to respond to
+ * a command from the VFD sender.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `status` (uint32_t)
+ * Number indicating whether the command was successful or if an
+ * occured.
+ * Allowed values are H5FD_MIRROR_STATUS_OK and
+ * H5FD_MIRROR_STATUS_ERROR.
+ *
+ * `message` (char[])
+ * Error message. Populated if and only if there was a problem.
+ * It is possible that a message may reach the end of the alloted
+ * space without a NULL terminator -- the onus is on the programmer to
+ * handle this situation.
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_reply_t {
+ H5FD_mirror_xmit_t pub;
+ uint32_t status;
+ char message[H5FD_MIRROR_STATUS_MESSAGE_MAX];
+} H5FD_mirror_xmit_reply_t;
+
+/* ---------------------------------------------------------------------------
+ * Structure: H5FD_mirror_xmit_write_t
+ *
+ * Structure containing data-write information from VFD sender.
+ *
+ * The data to be written is transmitted in subsequent, packets
+ * and may be broken up into more than one transmission buffer.
+ * The VFD sender and remote receiver/worker/writer must coordinate
+ * the receipt of data.
+ *
+ * `pub` (H5FD_mirror_xmit_t)
+ * Common transmission header, containing session information.
+ * Must be first.
+ *
+ * `type` (uint8_t)
+ * Specifies datatype to be written.
+ * (Natively 'H5FD_mem_t', an enumerated type in H5Fpublic.h)
+ *
+ * `offset` (uint64_t)
+ * Start location of write in file.
+ * (Natively 'haddr_t', always a 64-bit field)
+ *
+ * `size` (uint64_t)
+ * Size of the data to be written, in bytes.
+ * (Natively 'size_t', accommodate the largest possible as 64-bits)
+ *
+ * ---------------------------------------------------------------------------
+ */
+typedef struct H5FD_mirror_xmit_write_t {
+ H5FD_mirror_xmit_t pub;
+ uint8_t type;
+ uint64_t offset;
+ uint64_t size;
+} H5FD_mirror_xmit_write_t;
+
+
+
+/* Encode/decode routines are required to "pack" the xmit data into a known
+ * byte format for transmission over the wire.
+ *
+ * All component numbers must be stored in "network" word order (Big-Endian).
+ *
+ * All components must be packed in the order given in the structure definition.
+ *
+ * All components must be packed with zero padding between.
+ */
+
+H5_DLL size_t H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint16(unsigned char *dest, uint16_t v);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint32(unsigned char *dest, uint32_t v);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint64(unsigned char *dest, uint64_t v);
+H5_DLL size_t H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v);
+
+H5_DLL size_t H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char *buf);
+H5_DLL size_t H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char *buf);
+
+H5_DLL size_t H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_t *x);
+H5_DLL size_t H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_t *x);
+
+H5_DLL hbool_t H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit);
+H5_DLL hbool_t H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* H5_HAVE_MIRROR_VFD */
+
+#endif /* H5FDmirror_priv_H */
+
diff --git a/src/H5FDmodule.h b/src/H5FDmodule.h
index ea1a9fd..11686be 100644
--- a/src/H5FDmodule.h
+++ b/src/H5FDmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c
index b2959a5..43fa340 100644
--- a/src/H5FDmpi.c
+++ b/src/H5FDmpi.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, January 30, 2004
*
* Purpose: Common routines for all MPI-based VFL drivers.
@@ -43,8 +43,6 @@
* Programmer: Quincey Koziol
* Friday, January 30, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -82,8 +80,6 @@ done:
* Programmer: Quincey Koziol
* Friday, January 30, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -120,8 +116,6 @@ done:
* Programmer: Quincey Koziol
* Friday, January 30, 2004
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
MPI_Comm
@@ -158,8 +152,6 @@ done:
* Programmer: John Mainzer
* 4/4/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -197,13 +189,6 @@ done:
* Programmer: Unknown
* January 30, 1998
*
- * Modifications:
- * Robb Matzke, 1999-04-23
- * An error is reported for address overflows. The ADDR output
- * argument is optional.
- *
- * Robb Matzke, 1999-08-06
- * Modified to work with the virtual file layer.
*-------------------------------------------------------------------------
*/
haddr_t
@@ -235,16 +220,6 @@ H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off)
* Programmer: Unknown
* January 30, 1998
*
- * Modifications:
- * Robb Matzke, 1999-04-23
- * An error is reported for address overflows. The ADDR output
- * argument is optional.
- *
- * Robb Matzke, 1999-07-28
- * The ADDR argument is passed by value.
- *
- * Robb Matzke, 1999-08-06
- * Modified to work with the virtual file layer.
*-------------------------------------------------------------------------
*/
herr_t
@@ -290,9 +265,6 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/)
* Programmer: rky
* 19981207
*
- * Modifications:
- * Robb Matzke, 1999-08-09
- * Modified to work with the virtual file layer.
*-------------------------------------------------------------------------
*/
herr_t
@@ -345,9 +317,6 @@ done:
* Programmer: rky
* 19981207
*
- * Modifications:
- * Robb Matzke, 1999-08-09
- * Modified to work with the virtual file layer.
*-------------------------------------------------------------------------
*/
herr_t
diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h
index 2d62c79..da9f59b 100644
--- a/src/H5FDmpi.h
+++ b/src/H5FDmpi.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Friday, January 30, 2004
*
* Purpose: The public header file for common items for all MPI VFL drivers
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 3d2e0cf..9475093 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Thursday, July 29, 1999
*
* Purpose: This is the MPI-2 I/O driver.
diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h
index 6ee0a1a..9d02153 100644
--- a/src/H5FDmpio.h
+++ b/src/H5FDmpio.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the mpio driver.
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 72f4da5..fbca8e4 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, November 10, 1997
*
* Purpose: Implements a file driver which dispatches I/O requests to
@@ -1234,14 +1234,6 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- * Raymond Lu
- * 21 Dec. 2006
- * Added the parameter TYPE. It's only used for MULTI driver.
- * If the TYPE is H5FD_MEM_DEFAULT, simply find the biggest
- * EOA of individual file because the EOA for the whole file
- * is meaningless.
- *
*-------------------------------------------------------------------------
*/
static haddr_t
@@ -1334,17 +1326,6 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type)
* Programmer: Robb Matzke
* Wednesday, August 4, 1999
*
- * Modifications:
- * Raymond Lu
- * 10 January 2007
- * EOA for the whole file is discarded because it's meaningless
- * for MULTI file. This function only sets eoa for individual
- * file.
- *
- * Raymond Lu
- * 21 June 2011
- * Backward compatibility of EOA. Please the comment in the
- * code.
*-------------------------------------------------------------------------
*/
static herr_t
diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h
index 0bd5718..b3c3c62 100644
--- a/src/H5FDmulti.h
+++ b/src/H5FDmulti.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the "multi" driver.
diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h
index 22b5d17..8ffffd1 100644
--- a/src/H5FDpkg.h
+++ b/src/H5FDpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Thursday, January 3, 2008
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index 2e3d3ce..7d5b66d 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, July 26, 1999
*/
#ifndef _H5FDprivate_H
diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h
index 61bf212..7297cf8 100644
--- a/src/H5FDpublic.h
+++ b/src/H5FDpublic.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, July 26, 1999
*/
#ifndef _H5FDpublic_H
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index d99272c..38e34a0 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -13,7 +13,7 @@
/*
* Read-Only S3 Virtual File Driver (VFD)
*
- * Programmer: Jacob Smith <jake.smith@hdfgroup.org>
+ * Programmer: Jacob Smith
* 2017-10-13
*
* Purpose:
@@ -212,66 +212,67 @@ typedef struct H5FD_ros3_t {
* Only included if it may be used -- ROS3 VFD is enabled.
*
*/
-#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
+#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
/* Prototypes */
-static herr_t H5FD_ros3_term(void);
-static void *H5FD_ros3_fapl_get(H5FD_t *_file);
-static void *H5FD_ros3_fapl_copy(const void *_old_fa);
-static herr_t H5FD_ros3_fapl_free(void *_fa);
-static H5FD_t *H5FD_ros3_open(const char *name, unsigned flags, hid_t fapl_id,
+static herr_t H5FD__ros3_term(void);
+static void *H5FD__ros3_fapl_get(H5FD_t *_file);
+static void *H5FD__ros3_fapl_copy(const void *_old_fa);
+static herr_t H5FD__ros3_fapl_free(void *_fa);
+static H5FD_t *H5FD__ros3_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
-static herr_t H5FD_ros3_close(H5FD_t *_file);
-static int H5FD_ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_ros3_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_ros3_get_handle(H5FD_t *_file, hid_t fapl,
+static herr_t H5FD__ros3_close(H5FD_t *_file);
+static int H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__ros3_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__ros3_get_handle(H5FD_t *_file, hid_t fapl,
void** file_handle);
-static herr_t H5FD_ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+static herr_t H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
haddr_t addr, size_t size, void *buf);
-static herr_t H5FD_ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
+static herr_t H5FD__ros3_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
haddr_t addr, size_t size, const void *buf);
-static herr_t H5FD_ros3_truncate(H5FD_t *_file, hid_t dxpl_id,
+static herr_t H5FD__ros3_truncate(H5FD_t *_file, hid_t dxpl_id,
hbool_t closing);
-static herr_t H5FD_ros3_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_ros3_unlock(H5FD_t *_file);
-static herr_t H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa);
+static herr_t H5FD__ros3_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__ros3_unlock(H5FD_t *_file);
+
+static herr_t H5FD__ros3_validate_config(const H5FD_ros3_fapl_t * fa);
static const H5FD_class_t H5FD_ros3_g = {
"ros3", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_ros3_term, /* terminate */
+ H5FD__ros3_term, /* terminate */
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
sizeof(H5FD_ros3_fapl_t), /* fapl_size */
- H5FD_ros3_fapl_get, /* fapl_get */
- H5FD_ros3_fapl_copy, /* fapl_copy */
- H5FD_ros3_fapl_free, /* fapl_free */
+ H5FD__ros3_fapl_get, /* fapl_get */
+ H5FD__ros3_fapl_copy, /* fapl_copy */
+ H5FD__ros3_fapl_free, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
- H5FD_ros3_open, /* open */
- H5FD_ros3_close, /* close */
- H5FD_ros3_cmp, /* cmp */
- H5FD_ros3_query, /* query */
+ H5FD__ros3_open, /* open */
+ H5FD__ros3_close, /* close */
+ H5FD__ros3_cmp, /* cmp */
+ H5FD__ros3_query, /* query */
NULL, /* get_type_map */
NULL, /* alloc */
NULL, /* free */
- H5FD_ros3_get_eoa, /* get_eoa */
- H5FD_ros3_set_eoa, /* set_eoa */
- H5FD_ros3_get_eof, /* get_eof */
- H5FD_ros3_get_handle, /* get_handle */
- H5FD_ros3_read, /* read */
- H5FD_ros3_write, /* write */
+ H5FD__ros3_get_eoa, /* get_eoa */
+ H5FD__ros3_set_eoa, /* set_eoa */
+ H5FD__ros3_get_eof, /* get_eof */
+ H5FD__ros3_get_handle, /* get_handle */
+ H5FD__ros3_read, /* read */
+ H5FD__ros3_write, /* write */
NULL, /* flush */
- H5FD_ros3_truncate, /* truncate */
- H5FD_ros3_lock, /* lock */
- H5FD_ros3_unlock, /* unlock */
+ H5FD__ros3_truncate, /* truncate */
+ H5FD__ros3_lock, /* lock */
+ H5FD__ros3_unlock, /* unlock */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -297,14 +298,11 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- if (H5FD_ros3_init() < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL,
- "unable to initialize ros3 VFD")
- }
+ if(H5FD_ros3_init() < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize ros3 VFD")
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD__init_package() */
@@ -335,7 +333,7 @@ H5FD_ros3_init(void)
HDfprintf(stdout, "H5FD_ros3_init() called.\n");
#endif
- if (H5I_VFL != H5I_get_type(H5FD_ROS3_g))
+ if(H5I_VFL != H5I_get_type(H5FD_ROS3_g))
H5FD_ROS3_g = H5FD_register(&H5FD_ros3_g, sizeof(H5FD_class_t), FALSE);
#if ROS3_STATS
@@ -343,6 +341,7 @@ H5FD_ros3_init(void)
*/
for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
unsigned long long value = 0;
+
ROS3_STATS_POW(bin_i, &value)
ros3_stats_boundaries[bin_i] = value;
}
@@ -353,12 +352,11 @@ H5FD_ros3_init(void)
done:
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD_ros3_init() */
/*---------------------------------------------------------------------------
- * Function: H5FD_ros3_term
+ * Function: H5FD__ros3_term
*
* Purpose: Shut down the VFD
*
@@ -369,20 +367,19 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_term(void)
+H5FD__ros3_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_term() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_term() called.\n");
#endif
/* Reset VFL ID */
H5FD_ROS3_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_term() */
+} /* end H5FD__ros3_term() */
/*-------------------------------------------------------------------------
@@ -401,8 +398,7 @@ H5FD_ros3_term(void)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_fapl_ros3(hid_t fapl_id,
- H5FD_ros3_fapl_t *fa)
+H5Pset_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa)
{
H5P_genplist_t *plist = NULL; /* Property list pointer */
herr_t ret_value = FAIL;
@@ -417,25 +413,21 @@ H5Pset_fapl_ros3(hid_t fapl_id,
#endif
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \
- "not a file access property list")
- }
+ if(plist == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- if (FAIL == H5FD_ros3_validate_config(fa)) {
+ if(FAIL == H5FD__ros3_validate_config(fa))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid ros3 config")
- }
ret_value = H5P_set_driver(plist, H5FD_ROS3, (void *)fa);
done:
FUNC_LEAVE_API(ret_value)
-
} /* end H5Pset_fapl_ros3() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_validate_config()
+ * Function: H5FD__ros3_validate_config()
*
* Purpose: Test to see if the supplied instance of H5FD_ros3_fapl_t
* contains internally consistant data. Return SUCCEED if so,
@@ -455,34 +447,25 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_validate_config(const H5FD_ros3_fapl_t * fa)
+H5FD__ros3_validate_config(const H5FD_ros3_fapl_t * fa)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(fa != NULL);
- if ( fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Unknown H5FD_ros3_fapl_t version");
- }
+ if(fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version");
- /* if set to authenticate, region and id cannot be empty strings
- */
- if (fa->authenticate == TRUE) {
- if ((fa->aws_region[0] == '\0') ||
- (fa->secret_id[0] == '\0'))
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Inconsistent authentication information");
- }
- }
+ /* if set to authenticate, region and id cannot be empty strings */
+ if(fa->authenticate == TRUE)
+ if((fa->aws_region[0] == '\0') || (fa->secret_id[0] == '\0'))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Inconsistent authentication information");
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_validate_config() */
+} /* end H5FD__ros3_validate_config() */
/*-------------------------------------------------------------------------
@@ -498,13 +481,10 @@ done:
* Programmer: John Mainzer
* 9/10/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_fapl_ros3(hid_t fapl_id,
- H5FD_ros3_fapl_t *fa_out)
+H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_out)
{
const H5FD_ros3_fapl_t *fa = NULL;
H5P_genplist_t *plist = NULL;
@@ -517,35 +497,30 @@ H5Pget_fapl_ros3(hid_t fapl_id,
HDfprintf(stdout, "H5Pget_fapl_ros3() called.\n");
#endif
- if (fa_out == NULL) {
+ if(fa_out == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_out is NULL")
- }
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
- if (plist == NULL) {
+ if(plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- }
- if (H5FD_ROS3 != H5P_peek_driver(plist)) {
+ if(H5FD_ROS3 != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
- }
fa = (const H5FD_ros3_fapl_t *)H5P_peek_driver_info(plist);
- if (fa == NULL) {
+ if(fa == NULL)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
- }
/* Copy the ros3 fapl data out */
HDmemcpy(fa_out, fa, sizeof(H5FD_ros3_fapl_t));
done:
FUNC_LEAVE_API(ret_value)
-
} /* end H5Pget_fapl_ros3() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_get
+ * Function: H5FD__ros3_fapl_get
*
* Purpose: Gets a file access property list which could be used to
* create an identical file.
@@ -557,24 +532,20 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_ros3_fapl_get(H5FD_t *_file)
+H5FD__ros3_fapl_get(H5FD_t *_file)
{
H5FD_ros3_t *file = (H5FD_ros3_t*)_file;
H5FD_ros3_fapl_t *fa = NULL;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
fa = (H5FD_ros3_fapl_t *)H5MM_calloc(sizeof(H5FD_ros3_fapl_t));
- if (fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed")
- }
+ if(fa == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy the fields of the structure */
HDmemcpy(fa, &(file->fa), sizeof(H5FD_ros3_fapl_t));
@@ -583,18 +554,16 @@ H5FD_ros3_fapl_get(H5FD_t *_file)
ret_value = fa;
done:
- if (ret_value == NULL) {
- if (fa != NULL) {
+ if(ret_value == NULL)
+ if(fa != NULL)
H5MM_xfree(fa);
- }
- }
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_ros3_fapl_get() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__ros3_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_copy
+ * Function: H5FD__ros3_fapl_copy
*
* Purpose: Copies the ros3-specific file access properties.
*
@@ -605,41 +574,35 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static void *
-H5FD_ros3_fapl_copy(const void *_old_fa)
+H5FD__ros3_fapl_copy(const void *_old_fa)
{
const H5FD_ros3_fapl_t *old_fa = (const H5FD_ros3_fapl_t*)_old_fa;
H5FD_ros3_fapl_t *new_fa = NULL;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
new_fa = (H5FD_ros3_fapl_t *)H5MM_malloc(sizeof(H5FD_ros3_fapl_t));
- if (new_fa == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed");
- }
+ if(new_fa == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
HDmemcpy(new_fa, old_fa, sizeof(H5FD_ros3_fapl_t));
ret_value = new_fa;
done:
- if (ret_value == NULL) {
- if (new_fa != NULL) {
+ if(ret_value == NULL)
+ if(new_fa != NULL)
H5MM_xfree(new_fa);
- }
- }
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_ros3_fapl_copy() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD__ros3_fapl_copy() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_fapl_free
+ * Function: H5FD__ros3_fapl_free
*
* Purpose: Frees the ros3-specific file access properties.
*
@@ -648,27 +611,23 @@ done:
* Programmer: John Mainzer
* 9/8/17
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_fapl_free(void *_fa)
+H5FD__ros3_fapl_free(void *_fa)
{
H5FD_ros3_fapl_t *fa = (H5FD_ros3_fapl_t*)_fa;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDassert(fa != NULL); /* sanity check */
H5MM_xfree(fa);
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* end H5FD_ros3_fapl_free() */
+} /* end H5FD__ros3_fapl_free() */
#if ROS3_STATS
-
/*----------------------------------------------------------------------------
*
* Function: ros3_reset_stats()
@@ -696,18 +655,16 @@ ros3_reset_stats(H5FD_ros3_t *file)
unsigned i = 0;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
HDprintf("ros3_reset_stats() called\n");
#endif
- if (file == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "file was null");
- }
+ if(file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file was null");
- for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
file->raw[i].bytes = 0;
file->raw[i].count = 0;
file->raw[i].min = (unsigned long long)ROS3_STATS_STARTING_MIN;
@@ -721,15 +678,13 @@ ros3_reset_stats(H5FD_ros3_t *file)
done:
FUNC_LEAVE_NOAPI(ret_value);
-
} /* end ros3_reset_stats() */
-
#endif /* ROS3_STATS */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_open()
+ * Function: H5FD__ros3_open()
*
* Purpose:
*
@@ -759,11 +714,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_ros3_open(
- const char *url,
- unsigned flags,
- hid_t fapl_id,
- haddr_t maxaddr)
+H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_ros3_t *file = NULL;
struct tm *now = NULL;
@@ -773,117 +724,89 @@ H5FD_ros3_open(
H5FD_ros3_fapl_t fa;
H5FD_t *ret_value = NULL;
-
-
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_open() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_open() called.\n");
#endif
/* Sanity check on file offsets */
HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
/* Check arguments */
- if (!url || !*url)
+ if(!url || !*url)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
- if (0 == maxaddr || HADDR_UNDEF == maxaddr)
+ if(0 == maxaddr || HADDR_UNDEF == maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
- if (ADDR_OVERFLOW(maxaddr))
+ if(ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
- if (flags != H5F_ACC_RDONLY)
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL,
- "only Read-Only access allowed")
+ if(flags != H5F_ACC_RDONLY)
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed")
- if (FAIL == H5Pget_fapl_ros3(fapl_id, &fa)) {
+ if(FAIL == H5Pget_fapl_ros3(fapl_id, &fa))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "can't get property list")
- }
- if (CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "unable to initialize curl global (placeholder flags)")
- }
+ if(CURLE_OK != curl_global_init(CURL_GLOBAL_DEFAULT))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to initialize curl global (placeholder flags)")
/* open file; procedure depends on whether or not the fapl instructs to
* authenticate requests or not.
*/
- if (fa.authenticate == TRUE) {
+ if(fa.authenticate == TRUE) {
/* compute signing key (part of AWS/S3 REST API)
* can be re-used by user/key for 7 days after creation.
* find way to re-use/share
*/
now = gmnow();
HDassert( now != NULL );
- if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "problem while writing iso8601 timestamp")
- }
- if (FAIL == H5FD_s3comms_signing_key(signing_key,
- (const char *)fa.secret_key,
- (const char *)fa.aws_region,
- (const char *)iso8601now) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "problem while computing signing key")
- }
-
- handle = H5FD_s3comms_s3r_open(
- url,
- (const char *)fa.aws_region,
- (const char *)fa.secret_id,
- (const unsigned char *)signing_key);
- } else {
+ if(ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while writing iso8601 timestamp")
+ if(FAIL == H5FD_s3comms_signing_key(signing_key, (const char *)fa.secret_key,
+ (const char *)fa.aws_region, (const char *)iso8601now))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while computing signing key")
+
+ handle = H5FD_s3comms_s3r_open( url, (const char *)fa.aws_region,
+ (const char *)fa.secret_id, (const unsigned char *)signing_key);
+ }
+ else
handle = H5FD_s3comms_s3r_open(url, NULL, NULL, NULL);
- } /* if/else should authenticate */
- if (handle == NULL) {
+ if(handle == NULL)
/* If we want to check CURL's say on the matter in a controlled
* fashion, this is the place to do it, but would need to make a
* few minor changes to s3comms `s3r_t` and `s3r_read()`.
*/
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open");
- }
- /* create new file struct
- */
+ /* create new file struct */
file = H5FL_CALLOC(H5FD_ros3_t);
- if (file == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "unable to allocate file struct")
- }
+ if(file == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
file->s3r_handle = handle;
HDmemcpy(&(file->fa), &fa, sizeof(H5FD_ros3_fapl_t));
#if ROS3_STATS
- if (FAIL == ros3_reset_stats(file)) {
- HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL,
- "unable to reset file statistics")
- }
+ if(FAIL == ros3_reset_stats(file))
+ HGOTO_ERROR(H5E_INTERNAL, H5E_UNINITIALIZED, NULL, "unable to reset file statistics")
#endif /* ROS3_STATS */
ret_value = (H5FD_t*)file;
done:
- if (ret_value == NULL) {
- if (handle != NULL) {
- if (FAIL == H5FD_s3comms_s3r_close(handle)) {
- HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL,
- "unable to close s3 file handle")
- }
- }
- if (file != NULL) {
+ if(ret_value == NULL) {
+ if(handle != NULL)
+ if(FAIL == H5FD_s3comms_s3r_close(handle))
+ HDONE_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, NULL, "unable to close s3 file handle")
+ if(file != NULL)
file = H5FL_FREE(H5FD_ros3_t, file);
- }
curl_global_cleanup(); /* early cleanup because open failed */
} /* end if null return value (error) */
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_open() */
+} /* end H5FD__ros3_open() */
#if ROS3_STATS
-
/*----------------------------------------------------------------------------
*
* Function: ros3_fprint_stats()
@@ -939,8 +862,7 @@ done:
*----------------------------------------------------------------------------
*/
static herr_t
-ros3_fprint_stats(FILE *stream,
- const H5FD_ros3_t *file)
+ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file)
{
herr_t ret_value = SUCCEED;
parsed_url_t *purl = NULL;
@@ -959,26 +881,16 @@ ros3_fprint_stats(FILE *stream,
unsigned suffix_i = 0;
const char suffixes[] = { ' ', 'K', 'M', 'G', 'T', 'P' };
+ FUNC_ENTER_STATIC
-
- FUNC_ENTER_NOAPI_NOINIT
-
- if (stream == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "file stream cannot be null" );
- }
- if (file == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "file cannot be null");
- }
- if (file->s3r_handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "s3 request handle cannot be null");
- }
- if (file->s3r_handle->purl == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "parsed url structure cannot be null");
- }
+ if(stream == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file stream cannot be null" );
+ if(file == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file cannot be null");
+ if(file->s3r_handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "s3 request handle cannot be null");
+ if(file->s3r_handle->purl == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "parsed url structure cannot be null");
purl = file->s3r_handle->purl;
/******************
@@ -986,9 +898,9 @@ ros3_fprint_stats(FILE *stream,
******************/
HDfprintf(stream, "stats for %s://%s", purl->scheme, purl->host);
- if (purl->port != NULL && purl->port[0] != '\0')
+ if(purl->port != NULL && purl->port[0] != '\0')
HDfprintf(stream, ":%s", purl->port);
- if (purl->query != NULL && purl->query[0] != '\0') {
+ if(purl->query != NULL && purl->query[0] != '\0') {
if (purl->path != NULL && purl->path[0] != '\0')
HDfprintf(stream, "/%s", purl->path);
else
@@ -1003,23 +915,27 @@ ros3_fprint_stats(FILE *stream,
* AGGREGATE STATS *
*******************/
- for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
const ros3_statsbin *r = &file->raw[i];
const ros3_statsbin *m = &file->meta[i];
- if (m->min < min_meta) min_meta = m->min;
- if (r->min < min_raw) min_raw = r->min;
- if (m->max > max_meta) max_meta = m->max;
- if (r->max > max_raw) max_raw = r->max;
+ if(m->min < min_meta)
+ min_meta = m->min;
+ if(r->min < min_raw)
+ min_raw = r->min;
+ if(m->max > max_meta)
+ max_meta = m->max;
+ if(r->max > max_raw)
+ max_raw = r->max;
count_raw += r->count;
count_meta += m->count;
bytes_raw += r->bytes;
bytes_meta += m->bytes;
}
- if (count_raw > 0)
+ if(count_raw > 0)
average_raw = (double)bytes_raw / (double)count_raw;
- if (count_meta > 0)
+ if(count_meta > 0)
average_meta = (double)bytes_meta / (double)count_meta;
/******************
@@ -1031,7 +947,7 @@ ros3_fprint_stats(FILE *stream,
HDfprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n",
bytes_raw + bytes_meta, bytes_meta, bytes_raw);
- if (count_raw + count_meta == 0)
+ if(count_raw + count_meta == 0)
goto done;
/*************************
@@ -1040,21 +956,21 @@ ros3_fprint_stats(FILE *stream,
HDfprintf(stream, "SIZES meta raw\n");
HDfprintf(stream, " min ");
- if (count_meta == 0) {
+ if(count_meta == 0)
HDfprintf(stream, " 0.000 ");
- } else {
+ else {
re_dub = (double)min_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
}
- if (count_raw == 0) {
+ if(count_raw == 0)
HDfprintf(stream, " 0.000 \n");
- } else {
+ else {
re_dub = (double)min_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
@@ -1062,26 +978,26 @@ ros3_fprint_stats(FILE *stream,
HDfprintf(stream, " avg ");
re_dub = (double)average_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
re_dub = (double)average_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
HDfprintf(stream, " max ");
re_dub = (double)max_meta;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]);
re_dub = (double)max_raw;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]);
@@ -1095,7 +1011,7 @@ ros3_fprint_stats(FILE *stream,
HDfprintf(stream,
" up-to meta raw meta raw meta raw\n");
- for (i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
+ for(i = 0; i <= ROS3_STATS_BIN_COUNT; i++) {
const ros3_statsbin *m;
const ros3_statsbin *r;
unsigned long long range_end = 0;
@@ -1110,46 +1026,46 @@ ros3_fprint_stats(FILE *stream,
m = &file->meta[i];
r = &file->raw[i];
- if (r->count == 0 && m->count == 0)
+ if(r->count == 0 && m->count == 0)
continue;
range_end = ros3_stats_boundaries[i];
- if (i == ROS3_STATS_BIN_COUNT) {
+ if(i == ROS3_STATS_BIN_COUNT) {
range_end = ros3_stats_boundaries[i-1];
HDfprintf(stream, ">");
- } else {
- HDfprintf(stream, " ");
}
+ else
+ HDfprintf(stream, " ");
bm_val = (double)m->bytes;
- for (suffix_i = 0; bm_val >= 1024.0; suffix_i++)
+ for(suffix_i = 0; bm_val >= 1024.0; suffix_i++)
bm_val /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
bm_suffix = suffixes[suffix_i];
br_val = (double)r->bytes;
- for (suffix_i = 0; br_val >= 1024.0; suffix_i++)
+ for(suffix_i = 0; br_val >= 1024.0; suffix_i++)
br_val /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
br_suffix = suffixes[suffix_i];
- if (m->count > 0)
+ if(m->count > 0)
am_val = (double)(m->bytes) / (double)(m->count);
- for (suffix_i = 0; am_val >= 1024.0; suffix_i++)
+ for(suffix_i = 0; am_val >= 1024.0; suffix_i++)
am_val /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
am_suffix = suffixes[suffix_i];
- if (r->count > 0)
+ if(r->count > 0)
ar_val = (double)(r->bytes) / (double)(r->count);
- for (suffix_i = 0; ar_val >= 1024.0; suffix_i++)
+ for(suffix_i = 0; ar_val >= 1024.0; suffix_i++)
ar_val /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
ar_suffix = suffixes[suffix_i];
re_dub = (double)range_end;
- for (suffix_i = 0; re_dub >= 1024.0; suffix_i++)
+ for(suffix_i = 0; re_dub >= 1024.0; suffix_i++)
re_dub /= 1024.0;
HDassert(suffix_i < sizeof(suffixes));
@@ -1163,7 +1079,7 @@ ros3_fprint_stats(FILE *stream,
am_val, am_suffix, /* metadata average */
ar_val, ar_suffix); /* rawdata average */
- fflush(stream);
+ HDfflush(stream);
}
done:
@@ -1175,7 +1091,7 @@ done:
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_close()
+ * Function: H5FD__ros3_close()
*
* Purpose:
*
@@ -1191,52 +1107,45 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
+H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_close() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_close() called.\n");
#endif
- /* Sanity checks
- */
+ /* Sanity checks */
HDassert(file != NULL);
HDassert(file->s3r_handle != NULL);
/* Close the underlying request handle
*/
- if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "unable to close S3 request handle")
- }
+ if(FAIL == H5FD_s3comms_s3r_close(file->s3r_handle))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle")
#if ROS3_STATS
/* TODO: mechanism to re-target stats printout */
- if (ros3_fprint_stats(stdout, file) == FAIL) {
- HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL,
- "problem while writing file statistics")
- }
+ if(ros3_fprint_stats(stdout, file) == FAIL)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics")
#endif /* ROS3_STATS */
- /* Release the file info
- */
+ /* Release the file info */
file = H5FL_FREE(H5FD_ros3_t, file);
done:
curl_global_cleanup(); /* cleanup to answer init on open */
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_close() */
+} /* end H5FD__ros3_close() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_cmp()
+ * Function: H5FD__ros3_cmp()
*
* Purpose:
*
@@ -1265,9 +1174,7 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_ros3_cmp(
- const H5FD_t *_f1,
- const H5FD_t *_f2)
+H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_ros3_t *f1 = (const H5FD_ros3_t *)_f1;
const H5FD_ros3_t *f2 = (const H5FD_ros3_t *)_f2;
@@ -1275,10 +1182,10 @@ H5FD_ros3_cmp(
const parsed_url_t *purl2 = NULL;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_cmp() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_cmp() called.\n");
#endif
HDassert(f1->s3r_handle != NULL);
@@ -1294,113 +1201,80 @@ H5FD_ros3_cmp(
HDassert(purl2->host != NULL);
/* URL: SCHEME */
- if (HDstrcmp(purl1->scheme, purl2->scheme)) {
+ if(HDstrcmp(purl1->scheme, purl2->scheme))
HGOTO_DONE(-1);
- }
/* URL: HOST */
- if (HDstrcmp(purl1->host, purl2->host)) {
+ if(HDstrcmp(purl1->host, purl2->host))
HGOTO_DONE(-1);
- }
/* URL: PORT */
- if (purl1->port && purl2->port) {
- if (HDstrcmp(purl1->port, purl2->port)) {
+ if(purl1->port && purl2->port) {
+ if(HDstrcmp(purl1->port, purl2->port))
HGOTO_DONE(-1);
- }
}
- else
- if (purl1->port) {
+ else if(purl1->port)
HGOTO_DONE(-1);
- }
- else
- if (purl2->port) {
+ else if(purl2->port)
HGOTO_DONE(-1);
- }
/* URL: PATH */
- if (purl1->path && purl2->path) {
- if (HDstrcmp(purl1->path, purl2->path)) {
+ if(purl1->path && purl2->path) {
+ if(HDstrcmp(purl1->path, purl2->path))
HGOTO_DONE(-1);
- }
}
- else
- if (purl1->path && !purl2->path) {
+ else if(purl1->path && !purl2->path)
HGOTO_DONE(-1);
- }
- else
- if (purl2->path && !purl1->path) {
+ else if(purl2->path && !purl1->path)
HGOTO_DONE(-1);
- }
/* URL: QUERY */
- if (purl1->query && purl2->query) {
- if (HDstrcmp(purl1->query, purl2->query)) {
+ if(purl1->query && purl2->query) {
+ if(HDstrcmp(purl1->query, purl2->query))
HGOTO_DONE(-1);
- }
}
- else
- if (purl1->query && !purl2->query) {
+ else if(purl1->query && !purl2->query)
HGOTO_DONE(-1);
- }
- else
- if (purl2->query && !purl1->query) {
+ else if(purl2->query && !purl1->query)
HGOTO_DONE(-1);
- }
/* FAPL: AWS_REGION */
- if (f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') {
- if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) {
+ if(f1->fa.aws_region[0] != '\0' && f2->fa.aws_region[0] != '\0') {
+ if(HDstrcmp(f1->fa.aws_region, f2->fa.aws_region))
HGOTO_DONE(-1);
- }
}
- else
- if (f1->fa.aws_region[0] != '\0') {
+ else if(f1->fa.aws_region[0] != '\0')
HGOTO_DONE(-1);
- }
- else
- if (f2->fa.aws_region[0] != '\0') {
+ else if(f2->fa.aws_region[0] != '\0')
HGOTO_DONE(-1);
- }
/* FAPL: SECRET_ID */
- if (f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') {
- if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) {
+ if(f1->fa.secret_id[0] != '\0' && f2->fa.secret_id[0] != '\0') {
+ if(HDstrcmp(f1->fa.secret_id, f2->fa.secret_id))
HGOTO_DONE(-1);
- }
}
- else
- if (f1->fa.secret_id[0] != '\0') {
+ else if(f1->fa.secret_id[0] != '\0')
HGOTO_DONE(-1);
- }
- else
- if (f2->fa.secret_id[0] != '\0') {
+ else if(f2->fa.secret_id[0] != '\0')
HGOTO_DONE(-1);
- }
/* FAPL: SECRET_KEY */
- if (f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') {
- if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) {
+ if(f1->fa.secret_key[0] != '\0' && f2->fa.secret_key[0] != '\0') {
+ if(HDstrcmp(f1->fa.secret_key, f2->fa.secret_key))
HGOTO_DONE(-1);
- }
}
- else
- if (f1->fa.secret_key[0] != '\0') {
+ else if(f1->fa.secret_key[0] != '\0')
HGOTO_DONE(-1);
- }
- else
- if (f2->fa.secret_key[0] != '\0') {
+ else if(f2->fa.secret_key[0] != '\0')
HGOTO_DONE(-1);
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_ros3_cmp() */
+} /* H5FD__ros3_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_ros3_query
+ * Function: H5FD__ros3_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -1419,30 +1293,28 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file,
- unsigned long *flags /* out */)
+H5FD__ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_query() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_query() called.\n");
#endif
/* Set the VFL feature flags that this driver supports */
- if (flags) {
+ if(flags) {
*flags = 0;
/* OK to perform data sieving for faster raw data reads & writes */
*flags |= H5FD_FEAT_DATA_SIEVE;
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* H5FD_ros3_query() */
+} /* H5FD__ros3_query() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_get_eoa()
+ * Function: H5FD__ros3_get_eoa()
*
* Purpose:
*
@@ -1460,25 +1332,23 @@ H5FD_ros3_query(const H5FD_t H5_ATTR_UNUSED *_file,
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_ros3_get_eoa(const H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_get_eoa() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_get_eoa() called.\n");
#endif
FUNC_LEAVE_NOAPI(file->eoa)
-
-} /* end H5FD_ros3_get_eoa() */
+} /* end H5FD__ros3_get_eoa() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_set_eoa()
+ * Function: H5FD__ros3_set_eoa()
*
* Purpose:
*
@@ -1494,28 +1364,25 @@ H5FD_ros3_get_eoa(const H5FD_t *_file,
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_set_eoa(H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- haddr_t addr)
+H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_set_eoa() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_set_eoa() called.\n");
#endif
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-
-} /* H5FD_ros3_set_eoa() */
+} /* H5FD__ros3_set_eoa() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_get_eof()
+ * Function: H5FD__ros3_get_eof()
*
* Purpose:
*
@@ -1532,25 +1399,23 @@ H5FD_ros3_set_eoa(H5FD_t *_file,
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_ros3_get_eof(const H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_ros3_t *file = (const H5FD_ros3_t *)_file;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_get_eof() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_get_eof() called.\n");
#endif
FUNC_LEAVE_NOAPI(H5FD_s3comms_s3r_get_filesize(file->s3r_handle))
-
-} /* end H5FD_ros3_get_eof() */
+} /* end H5FD__ros3_get_eof() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_get_handle()
+ * Function: H5FD__ros3_get_handle()
*
* Purpose:
*
@@ -1566,34 +1431,31 @@ H5FD_ros3_get_eof(const H5FD_t *_file,
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_get_handle(H5FD_t *_file,
- hid_t H5_ATTR_UNUSED fapl,
- void **file_handle)
+H5FD__ros3_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl,
+ void **file_handle)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_get_handle() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_get_handle() called.\n");
#endif
- if (!file_handle) {
+ if(!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
- }
*file_handle = file->s3r_handle;
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_get_handle() */
+} /* end H5FD__ros3_get_handle() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_read()
+ * Function: H5FD__ros3_read()
*
* Purpose
*
@@ -1614,12 +1476,9 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_read(H5FD_t *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t addr, /* start offset */
- size_t size, /* length of read */
- void *buf) /* out */
+H5FD__ros3_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)
{
H5FD_ros3_t *file = (H5FD_ros3_t *)_file;
size_t filesize = 0;
@@ -1631,10 +1490,10 @@ H5FD_ros3_read(H5FD_t *_file,
#endif /* ROS3_STATS */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_read() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_read() called.\n");
#endif
HDassert(file != NULL);
@@ -1643,40 +1502,32 @@ H5FD_ros3_read(H5FD_t *_file,
filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle);
- if ((addr > filesize) || ((addr + size) > filesize)) {
+ if((addr > filesize) || ((addr + size) > filesize))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "range exceeds file address")
- }
- if (H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL) {
+ if(H5FD_s3comms_s3r_read(file->s3r_handle, addr, size, buf) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "unable to execute read")
- }
#if ROS3_STATS
- /* Find which "bin" this read fits in. Can be "overflow" bin.
- */
- for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) {
- if ((unsigned long long)size < ros3_stats_boundaries[bin_i]) {
+ /* Find which "bin" this read fits in. Can be "overflow" bin. */
+ for(bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++)
+ if((unsigned long long)size < ros3_stats_boundaries[bin_i])
break;
- }
- }
bin = (type == H5FD_MEM_DRAW)
? &file->raw[bin_i]
: &file->meta[bin_i];
- /* Store collected stats in appropriate bin
- */
- if (bin->count == 0) {
+ /* Store collected stats in appropriate bin */
+ if(bin->count == 0) {
bin->min = size;
bin->max = size;
}
else {
- if (size < bin->min) {
+ if(size < bin->min)
bin->min = size;
- }
- if (size > bin->max) {
+ if(size > bin->max)
bin->max = size;
- }
}
bin->count++;
bin->bytes += (unsigned long long)size;
@@ -1685,13 +1536,12 @@ H5FD_ros3_read(H5FD_t *_file,
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_read() */
+} /* end H5FD__ros3_read() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_write()
+ * Function: H5FD__ros3_write()
*
* Purpose:
*
@@ -1708,33 +1558,28 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_write(H5FD_t H5_ATTR_UNUSED *_file,
- H5FD_mem_t H5_ATTR_UNUSED type,
- hid_t H5_ATTR_UNUSED dxpl_id,
- haddr_t H5_ATTR_UNUSED addr,
- size_t H5_ATTR_UNUSED size,
- const void H5_ATTR_UNUSED *buf)
+H5FD__ros3_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type,
+ hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr,
+ size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf)
{
herr_t ret_value = FAIL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_write() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_write() called.\n");
#endif
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
- "cannot write to read-only file.")
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot write to read-only file.")
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* H5FD_ros3_write() */
+} /* H5FD__ros3_write() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_truncate()
+ * Function: H5FD__ros3_truncate()
*
* Purpose:
*
@@ -1753,30 +1598,27 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file,
- hid_t H5_ATTR_UNUSED dxpl_id,
- hbool_t H5_ATTR_UNUSED closing)
+H5FD__ros3_truncate(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id,
+ hbool_t H5_ATTR_UNUSED closing)
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if ROS3_DEBUG
- HDfprintf(stdout, "H5FD_ros3_truncate() called.\n");
+ HDfprintf(stdout, "H5FD__ros3_truncate() called.\n");
#endif
- HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL,
- "cannot truncate read-only file.")
+ HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "cannot truncate read-only file.")
done:
FUNC_LEAVE_NOAPI(ret_value)
-
-} /* end H5FD_ros3_truncate() */
+} /* end H5FD__ros3_truncate() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_lock()
+ * Function: H5FD__ros3_lock()
*
* Purpose:
*
@@ -1796,18 +1638,18 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file,
+H5FD__ros3_lock(H5FD_t H5_ATTR_UNUSED *_file,
hbool_t H5_ATTR_UNUSED rw)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_ENTER_STATIC_NOERR
-} /* end H5FD_ros3_lock() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD__ros3_lock() */
/*-------------------------------------------------------------------------
*
- * Function: H5FD_ros3_unlock()
+ * Function: H5FD__ros3_unlock()
*
* Purpose:
*
@@ -1824,12 +1666,12 @@ H5FD_ros3_lock(H5FD_t H5_ATTR_UNUSED *_file,
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file)
+H5FD__ros3_unlock(H5FD_t H5_ATTR_UNUSED *_file)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_ENTER_STATIC_NOERR
-} /* end H5FD_ros3_unlock() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD__ros3_unlock() */
#endif /* H5_HAVE_ROS3_VFD */
diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c
index d9d4c88..e79ee0d 100644
--- a/src/H5FDs3comms.c
+++ b/src/H5FDs3comms.c
@@ -148,9 +148,8 @@ curlwritecallback(char *ptr,
size_t product = (size * nmemb);
size_t written = 0;
- if (sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC) {
+ if(sds->magic != S3COMMS_CALLBACK_DATASTRUCT_MAGIC)
return written;
- }
if (size > 0) {
HDmemcpy(&(sds->data[sds->size]), ptr, product);
@@ -159,7 +158,6 @@ curlwritecallback(char *ptr,
}
return written;
-
} /* end curlwritecallback() */
@@ -236,22 +234,19 @@ H5FD_s3comms_hrb_node_set(
FUNC_ENTER_NOAPI_NOINIT
#if S3COMMS_DEBUG
- HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.\n");
+ HDfprintf(stdout, "called H5FD_s3comms_hrb_node_set.");
HDprintf("NAME: %s\n", name);
HDprintf("VALUE: %s\n", value);
HDprintf("LIST:\n->");
- for (node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next) {
+ for(node_ptr = (*L); node_ptr != NULL; node_ptr = node_ptr->next)
HDfprintf(stdout, "{%s}\n->", node_ptr->cat);
- }
HDprintf("(null)\n");
- fflush(stdout);
+ HDfflush(stdout);
node_ptr = NULL;
#endif
- if (name == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to operate on null name.\n");
- }
+ if(name == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to operate on null name");
namelen = HDstrlen(name);
/***********************
@@ -261,20 +256,17 @@ H5FD_s3comms_hrb_node_set(
/* copy and lowercase name
*/
lowername = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
- if (lowername == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
- "cannot make space for lowercase name copy.\n");
- }
- for (i = 0; i < namelen; i++) {
- lowername[i] = (char)tolower((int)name[i]);
- }
+ if(lowername == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for lowercase name copy.");
+ for(i = 0; i < namelen; i++)
+ lowername[i] = (char)HDtolower((int)name[i]);
lowername[namelen] = 0;
/* If value supplied, copy name, value, and concatenated "name: value".
* If NULL, we will be removing a node or doing nothing, so no need for
* copies
*/
- if (value != NULL) {
+ if(value != NULL) {
int ret = 0;
size_t valuelen = HDstrlen(value);
size_t catlen = namelen + valuelen + 2; /* +2 from ": " */
@@ -282,38 +274,28 @@ H5FD_s3comms_hrb_node_set(
namecpy = (char *)H5MM_malloc(sizeof(char) * (namelen + 1));
- if (namecpy == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
- "cannot make space for name copy.\n");
- }
+ if(namecpy == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for name copy.");
HDmemcpy(namecpy, name, (namelen + 1));
valuecpy = (char *)H5MM_malloc(sizeof(char) * (valuelen + 1));
- if (valuecpy == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
- "cannot make space for value copy.\n");
- }
+ if(valuecpy == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for value copy.");
HDmemcpy(valuecpy, value, (valuelen + 1));
nvcat = (char *)H5MM_malloc(sizeof(char) * catwrite);
- if (nvcat == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
- "cannot make space for concatenated string.\n");
- }
+ if(nvcat == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for concatenated string.");
ret = HDsnprintf(nvcat, catwrite, "%s: %s", name, value);
- if (ret < 0 || (size_t)ret > catlen) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot concatenate `%s: %s", name, value);
- }
+ if(ret < 0 || (size_t)ret > catlen)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot concatenate `%s: %s", name, value);
HDassert( catlen == HDstrlen(nvcat) );
/* create new_node, should we need it
*/
new_node = (hrb_node_t *)H5MM_malloc(sizeof(hrb_node_t));
- if (new_node == NULL) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
- "cannot make space for new set.\n");
- }
+ if(new_node == NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for new set.");
new_node->magic = S3COMMS_HRB_NODE_MAGIC;
new_node->name = NULL;
@@ -327,14 +309,12 @@ H5FD_s3comms_hrb_node_set(
* ACT ON LIST *
***************/
- if (*L == NULL) {
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "trying to remove node from empty list");
- }
+ if(*L == NULL) {
+ if(value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list");
else {
#if S3COMMS_DEBUG
-HDprintf("CREATE NEW\n"); fflush(stdout);
+HDprintf("CREATE NEW\n"); HDfflush(stdout);
#endif
/*******************
* CREATE NEW LIST *
@@ -358,13 +338,13 @@ HDprintf("CREATE NEW\n"); fflush(stdout);
/* Check whether to modify/remove first node in list
*/
- if (strcmp(lowername, node_ptr->lowername) == 0) {
+ if(HDstrcmp(lowername, node_ptr->lowername) == 0) {
is_looking = FALSE;
if (value == NULL) {
#if S3COMMS_DEBUG
-HDprintf("REMOVE HEAD\n"); fflush(stdout);
+HDprintf("REMOVE HEAD\n"); HDfflush(stdout);
#endif
/***************
* REMOVE HEAD *
@@ -373,41 +353,41 @@ HDprintf("REMOVE HEAD\n"); fflush(stdout);
*L = node_ptr->next;
#if S3COMMS_DEBUG
-HDprintf("FREEING CAT (node)\n"); fflush(stdout);
+HDprintf("FREEING CAT (node)\n"); HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->cat);
#if S3COMMS_DEBUG
-HDprintf("FREEING LOWERNAME (node)\n"); fflush(stdout);
+HDprintf("FREEING LOWERNAME (node)\n"); HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->lowername);
#if S3COMMS_DEBUG
-HDprintf("FREEING NAME (node)\n"); fflush(stdout);
+HDprintf("FREEING NAME (node)\n"); HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->name);
#if S3COMMS_DEBUG
-HDprintf("FREEING VALUE (node)\n"); fflush(stdout);
+HDprintf("FREEING VALUE (node)\n"); HDfflush(stdout);
#endif
H5MM_xfree(node_ptr->value);
#if S3COMMS_DEBUG
HDprintf("MAGIC OK? %s\n",
(node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO");
-fflush(stdout);
+HDfflush(stdout);
#endif
HDassert( node_ptr->magic == S3COMMS_HRB_NODE_MAGIC );
node_ptr->magic += 1ul;
#if S3COMMS_DEBUG
-HDprintf("FREEING POINTER\n"); fflush(stdout);
+HDprintf("FREEING POINTER\n"); HDfflush(stdout);
#endif
H5MM_xfree(node_ptr);
#if S3COMMS_DEBUG
-HDprintf("FREEING WORKING LOWERNAME\n"); fflush(stdout);
+HDprintf("FREEING WORKING LOWERNAME\n"); HDfflush(stdout);
#endif
H5MM_xfree(lowername); lowername = NULL;
}
else {
#if S3COMMS_DEBUG
-HDprintf("MODIFY HEAD\n"); fflush(stdout);
+HDprintf("MODIFY HEAD\n"); HDfflush(stdout);
#endif
/***************
* MODIFY HEAD *
@@ -429,17 +409,15 @@ HDprintf("MODIFY HEAD\n"); fflush(stdout);
}
}
else
- if (strcmp(lowername, node_ptr->lowername) < 0) {
+ if (HDstrcmp(lowername, node_ptr->lowername) < 0) {
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "trying to remove a node 'before' head");
- }
+ if(value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head");
else {
#if S3COMMS_DEBUG
-HDprintf("PREPEND NEW HEAD\n"); fflush(stdout);
+HDprintf("PREPEND NEW HEAD\n"); HDfflush(stdout);
#endif
/*******************
* INSERT NEW HEAD *
@@ -458,24 +436,22 @@ HDprintf("PREPEND NEW HEAD\n"); fflush(stdout);
* SEARCH LIST *
***************/
- while (is_looking) {
- if (node_ptr->next == NULL) {
+ while(is_looking) {
+ if(node_ptr->next == NULL) {
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "trying to remove absent node");
- }
+ if(value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node");
else {
#if S3COMMS_DEBUG
-HDprintf("APPEND A NODE\n"); fflush(stdout);
+HDprintf("APPEND A NODE\n"); HDfflush(stdout);
#endif
/*******************
* APPEND NEW NODE *
*******************/
- HDassert( strcmp(lowername, node_ptr->lowername) > 0 );
+ HDassert( HDstrcmp(lowername, node_ptr->lowername) > 0 );
new_node->name = namecpy;
new_node->value = valuecpy;
new_node->lowername = lowername;
@@ -484,23 +460,21 @@ HDprintf("APPEND A NODE\n"); fflush(stdout);
}
}
else
- if (strcmp(lowername, node_ptr->next->lowername) < 0) {
+ if(HDstrcmp(lowername, node_ptr->next->lowername) < 0) {
is_looking = FALSE;
- if (value == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "trying to remove absent node");
- }
+ if(value == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node");
else {
#if S3COMMS_DEBUG
-HDprintf("INSERT A NODE\n"); fflush(stdout);
+HDprintf("INSERT A NODE\n"); HDfflush(stdout);
#endif
/*******************
* INSERT NEW NODE *
*******************/
- HDassert( strcmp(lowername, node_ptr->lowername) > 0 );
+ HDassert( HDstrcmp(lowername, node_ptr->lowername) > 0 );
new_node->name = namecpy;
new_node->value = valuecpy;
new_node->lowername = lowername;
@@ -510,11 +484,11 @@ HDprintf("INSERT A NODE\n"); fflush(stdout);
}
}
else
- if (strcmp(lowername, node_ptr->next->lowername) == 0) {
+ if(HDstrcmp(lowername, node_ptr->next->lowername) == 0) {
is_looking = FALSE;
- if (value == NULL) {
+ if(value == NULL) {
/*****************
* REMOVE A NODE *
*****************/
@@ -523,7 +497,7 @@ HDprintf("INSERT A NODE\n"); fflush(stdout);
node_ptr->next = tmp->next;
#if S3COMMS_DEBUG
-HDprintf("REMOVE A NODE\n"); fflush(stdout);
+HDprintf("REMOVE A NODE\n"); HDfflush(stdout);
#endif
H5MM_xfree(tmp->cat);
H5MM_xfree(tmp->lowername);
@@ -539,7 +513,7 @@ HDprintf("REMOVE A NODE\n"); fflush(stdout);
}
else {
#if S3COMMS_DEBUG
-HDprintf("MODIFY A NODE\n"); fflush(stdout);
+HDprintf("MODIFY A NODE\n"); HDfflush(stdout);
#endif
/*****************
* MODIFY A NODE *
@@ -572,14 +546,17 @@ HDprintf("MODIFY A NODE\n"); fflush(stdout);
} /* end while is_looking */
done:
- if (ret_value == FAIL) {
- /* clean up
- */
- if (nvcat != NULL) { H5MM_xfree(nvcat); }
- if (namecpy != NULL) { H5MM_xfree(namecpy); }
- if (lowername != NULL) { H5MM_xfree(lowername); }
- if (valuecpy != NULL) { H5MM_xfree(valuecpy); }
- if (new_node != NULL) {
+ if(ret_value == FAIL) {
+ /* clean up */
+ if(nvcat != NULL)
+ H5MM_xfree(nvcat);
+ if(namecpy != NULL)
+ H5MM_xfree(namecpy);
+ if(lowername != NULL)
+ H5MM_xfree(lowername);
+ if(valuecpy != NULL)
+ H5MM_xfree(valuecpy);
+ if(new_node != NULL) {
HDassert( new_node->magic == S3COMMS_HRB_NODE_MAGIC );
new_node->magic += 1ul;
H5MM_xfree(new_node);
@@ -638,12 +615,10 @@ H5FD_s3comms_hrb_destroy(hrb_t **_buf)
HDfprintf(stdout, "called H5FD_s3comms_hrb_destroy.\n");
#endif
- if (_buf != NULL && *_buf != NULL) {
+ if(_buf != NULL && *_buf != NULL) {
buf = *_buf;
- if (buf->magic != S3COMMS_HRB_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "pointer's magic does not match.\n");
- }
+ if(buf->magic != S3COMMS_HRB_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "pointer's magic does not match.");
H5MM_xfree(buf->verb);
H5MM_xfree(buf->version);
@@ -707,53 +682,38 @@ H5FD_s3comms_hrb_init_request(const char *_verb,
HDfprintf(stdout, "called H5FD_s3comms_hrb_init_request.\n");
#endif
- if (_resource == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "resource string cannot be null.\n");
- }
+ if(_resource == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "resource string cannot be null.");
- /* populate valid NULLs with defaults
- */
- if (_verb == NULL) {
+ /* populate valid NULLs with defaults */
+ if(_verb == NULL)
_verb = "GET";
- }
-
- if (_http_version == NULL) {
+ if(_http_version == NULL)
_http_version = "HTTP/1.1";
- }
- /* malloc space for and prepare structure
- */
+ /* malloc space for and prepare structure */
request = (hrb_t *)H5MM_malloc(sizeof(hrb_t));
- if (request == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
- "no space for request structure");
- }
+ if(request == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for request structure");
request->magic = S3COMMS_HRB_MAGIC;
request->body = NULL;
request->body_len = 0;
request->first_header = NULL;
-
- /* malloc and copy strings for the structure
- */
+ /* malloc and copy strings for the structure */
reslen = HDstrlen(_resource);
if (_resource[0] == '/') {
res = (char *)H5MM_malloc(sizeof(char) * (reslen+1));
- if (res == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
- "no space for resource string");
- }
+ if(res == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
HDmemcpy(res, _resource, (reslen+1));
}
else {
res = (char *)H5MM_malloc(sizeof(char) * (reslen+2));
- if (res == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
- "no space for resource string");
- }
+ if(res == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string");
*res = '/';
HDmemcpy((&res[1]), _resource, (reslen+1));
HDassert( (reslen+1) == HDstrlen(res) );
@@ -761,24 +721,18 @@ H5FD_s3comms_hrb_init_request(const char *_verb,
verblen = HDstrlen(_verb) + 1;
verb = (char *)H5MM_malloc(sizeof(char) * verblen);
- if (verb == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "no space for verb string");
- }
+ if(verb == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for verb string");
HDstrncpy(verb, _verb, verblen);
vrsnlen = HDstrlen(_http_version) + 1;
vrsn = (char *)H5MM_malloc(sizeof(char) * vrsnlen);
- if (vrsn == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "no space for http-version string");
- }
+ if(vrsn == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no space for http-version string");
HDstrncpy(vrsn, _http_version, vrsnlen);
-
- /* place new copies into structure
- */
+ /* place new copies into structure */
request->resource = res;
request->verb = verb;
request->version = vrsn;
@@ -786,13 +740,16 @@ H5FD_s3comms_hrb_init_request(const char *_verb,
ret_value = request;
done:
- /* if there is an error, clean up after ourselves
- */
+ /* if there is an error, clean up after ourselves */
if (ret_value == NULL) {
- if (request != NULL) H5MM_xfree(request);
- if (vrsn != NULL) H5MM_xfree(vrsn);
- if (verb != NULL) H5MM_xfree(verb);
- if (res != NULL) H5MM_xfree(res);
+ if(request != NULL)
+ H5MM_xfree(request);
+ if(vrsn != NULL)
+ H5MM_xfree(vrsn);
+ if(verb != NULL)
+ H5MM_xfree(verb);
+ if(res != NULL)
+ H5MM_xfree(res);
}
FUNC_LEAVE_NOAPI(ret_value)
@@ -836,14 +793,10 @@ H5FD_s3comms_s3r_close(s3r_t *handle)
HDfprintf(stdout, "called H5FD_s3comms_s3r_close.\n");
#endif
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle cannot be null.\n");
- }
- if (handle->magic != S3COMMS_S3R_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle has invalid magic.\n");
- }
+ if(handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
+ if(handle->magic != S3COMMS_S3R_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
curl_easy_cleanup(handle->curlhandle);
@@ -854,10 +807,8 @@ H5FD_s3comms_s3r_close(s3r_t *handle)
HDassert( handle->httpverb != NULL );
H5MM_xfree(handle->httpverb);
- if (FAIL == H5FD_s3comms_free_purl(handle->purl)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to release parsed url structure")
- }
+ if(FAIL == H5FD_s3comms_free_purl(handle->purl))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to release parsed url structure")
H5MM_xfree(handle);
@@ -893,9 +844,8 @@ H5FD_s3comms_s3r_get_filesize(s3r_t *handle)
FUNC_ENTER_NOAPI_NOINIT_NOERR
- if (handle != NULL) {
+ if(handle != NULL)
ret_value = handle->filesize;
- }
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FD_s3comms_s3r_get_filesize */
@@ -953,58 +903,33 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
HDfprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n");
#endif
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle cannot be null.\n");
- }
- if (handle->magic != S3COMMS_S3R_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle has invalid magic.\n");
- }
- if (handle->curlhandle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle has bad (null) curlhandle.\n")
- }
+ if(handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
+ if(handle->magic != S3COMMS_S3R_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
+ if(handle->curlhandle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.")
/********************
* PREPARE FOR HEAD *
********************/
curlh = handle->curlhandle;
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, 1L))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY).");
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_NOBODY,
- 1L) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_NOBODY). "
- "(placeholder flags)");
- }
-
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_HEADERDATA,
- &sds) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_HEADERDATA). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, &sds))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA).");
HDassert( handle->httpverb == NULL );
handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16);
- if (handle->httpverb == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "unable to allocate space for S3 request HTTP verb");
- }
+ if(handle->httpverb == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb");
HDmemcpy(handle->httpverb, "HEAD", 5);
headerresponse = (char *)H5MM_malloc(sizeof(char) * CURL_MAX_HTTP_HEADER);
- if (headerresponse == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "unable to allocate space for curl header response");
- }
+ if(headerresponse == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for curl header response");
sds.data = headerresponse;
/*******************
@@ -1015,65 +940,43 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
* but, with a NULL destination and NOBODY and HEADERDATA supplied above,
* only http metadata will be sent by server and recorded by s3comms
*/
- if (FAIL ==
- H5FD_s3comms_s3r_read(handle, 0, 0, NULL) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem in reading during getsize.\n");
- }
+ if(FAIL == H5FD_s3comms_s3r_read(handle, 0, 0, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem in reading during getsize.");
- if (sds.size > CURL_MAX_HTTP_HEADER) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "HTTP metadata buffer overrun\n");
- } else if (sds.size == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "No HTTP metadata\n");
+ if(sds.size > CURL_MAX_HTTP_HEADER)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun");
+ else if (sds.size == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata");
#if S3COMMS_DEBUG
- } else {
+ else
HDfprintf(stderr, "GETSIZE: OK\n");
#endif
- }
/******************
* PARSE RESPONSE *
******************/
- start = strstr(headerresponse,
- "\r\nContent-Length: ");
- if (start == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not find \"Content-Length\" in response.\n");
- }
+ start = HDstrstr(headerresponse, "\r\nContent-Length: ");
+ if(start == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find \"Content-Length\" in response.");
- /* move "start" to beginning of value in line; find end of line
- */
+ /* move "start" to beginning of value in line; find end of line */
start = start + HDstrlen("\r\nContent-Length: ");
- end = strstr(start, "\r\n");
- if (end == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not find end of content length line");
- }
+ end = HDstrstr(start, "\r\n");
+ if(end == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not find end of content length line");
/* place null terminator at end of numbers
*/
*end = '\0';
- content_length = strtoumax((const char *)start,
- NULL,
- 0);
-
- if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) {
- HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t\n");
- }
+ content_length = HDstrtoumax((const char *)start, NULL, 0);
+ if(UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t");
- if (content_length == 0 ||
- errno == ERANGE) /* errno set by strtoumax*/
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not convert found \"Content-Length\" response (\"%s\")",
- start); /* range is null-terminated, remember */
- }
+ if(content_length == 0 || errno == ERANGE) /* errno set by HDstrtoumax*/
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert found \"Content-Length\" response (\"%s\")", start); /* range is null-terminated, remember */
handle->filesize = (size_t)content_length;
@@ -1081,32 +984,17 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
* UNDO HEAD SETTINGS *
**********************/
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_NOBODY,
- NULL) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_NOBODY). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_NOBODY, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_NOBODY).");
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_HEADERDATA,
- NULL) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option (CURLOPT_HEADERDATA). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA).");
done:
H5MM_xfree(headerresponse);
sds.magic += 1; /* set to bad magic */
FUNC_LEAVE_NOAPI(ret_value);
-
} /* H5FD_s3comms_s3r_getsize */
@@ -1167,26 +1055,19 @@ H5FD_s3comms_s3r_open(const char *url,
HDfprintf(stdout, "called H5FD_s3comms_s3r_open.\n");
#endif
+ if(url == NULL || url[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "url cannot be null.");
-
- if (url == NULL || url[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "url cannot be null.\n");
- }
-
- if (FAIL == H5FD_s3comms_parse_url(url, &purl)) {
+ if(FAIL == H5FD_s3comms_parse_url(url, &purl))
/* probably a malformed url, but could be internal error */
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL,
- "unable to create parsed url structure");
- }
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, "unable to create parsed url structure");
+
HDassert( purl != NULL ); /* if above passes, this must be true */
HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC );
handle = (s3r_t *)H5MM_malloc(sizeof(s3r_t));
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL,
- "could not malloc space for handle.\n");
- }
+ if(handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "could not malloc space for handle.");
handle->magic = S3COMMS_S3R_MAGIC;
handle->purl = purl;
@@ -1200,50 +1081,35 @@ H5FD_s3comms_s3r_open(const char *url,
* RECORD AUTHENTICATION INFORMATION *
*************************************/
- if ((region != NULL && *region != '\0') ||
- (id != NULL && *id != '\0') ||
- (signing_key != NULL))
- {
- /* if one exists, all three must exist
- */
- if (region == NULL || region[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "region cannot be null.\n");
- }
- if (id == NULL || id[0] == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "secret id cannot be null.\n");
- }
- if (signing_key == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "signing key cannot be null.\n");
- }
+ if((region != NULL && *region != '\0') ||
+ (id != NULL && *id != '\0') ||
+ (signing_key != NULL)) {
- /* copy strings
- */
+ /* if one exists, all three must exist */
+ if(region == NULL || region[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "region cannot be null.");
+ if(id == NULL || id[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "secret id cannot be null.");
+ if(signing_key == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "signing key cannot be null.");
+
+ /* copy strings */
tmplen = HDstrlen(region) + 1;
handle->region = (char *)H5MM_malloc(sizeof(char) * tmplen);
- if (handle->region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "could not malloc space for handle region copy.\n");
- }
+ if(handle->region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle region copy.");
HDmemcpy(handle->region, region, tmplen);
tmplen = HDstrlen(id) + 1;
handle->secret_id = (char *)H5MM_malloc(sizeof(char) * tmplen);
- if (handle->secret_id == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "could not malloc space for handle ID copy.\n");
- }
+ if(handle->secret_id == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle ID copy.");
HDmemcpy(handle->secret_id, id, tmplen);
tmplen = SHA256_DIGEST_LENGTH;
- handle->signing_key =
- (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen);
- if (handle->signing_key == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "could not malloc space for handle key copy.\n");
- }
+ handle->signing_key = (unsigned char *)H5MM_malloc(sizeof(unsigned char) * tmplen);
+ if(handle->signing_key == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "could not malloc space for handle key copy.");
HDmemcpy(handle->signing_key, signing_key, tmplen);
} /* if authentication information provided */
@@ -1252,61 +1118,23 @@ H5FD_s3comms_s3r_open(const char *url,
************************/
curlh = curl_easy_init();
+ if(curlh == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem creating curl easy handle!");
- if (curlh == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "problem creating curl easy handle!\n");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPGET, 1L))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTPGET).");
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_HTTPGET,
- 1L) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_HTTPGET). "
- "(placeholder flags)");
- }
-
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_HTTP_VERSION,
- CURL_HTTP_VERSION_1_1) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_HTTP_VERSION). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_HTTP_VERSION).");
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_FAILONERROR,
- 1L) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_FAILONERROR). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_FAILONERROR, 1L))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_FAILONERROR).");
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_WRITEFUNCTION,
- curlwritecallback) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_WRITEFUNCTION). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEFUNCTION, curlwritecallback))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_WRITEFUNCTION).");
- if ( CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_URL,
- url) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "error while setting CURL option (CURLOPT_URL). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_URL, url))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "error while setting CURL option (CURLOPT_URL).");
#if S3COMMS_CURL_VERBOSITY > 1
/* CURL will print (to stdout) information for each operation
@@ -1322,12 +1150,8 @@ H5FD_s3comms_s3r_open(const char *url,
* GET FILE SIZE *
*******************/
- if (FAIL ==
- H5FD_s3comms_s3r_getsize(handle) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "problem in H5FD_s3comms_s3r_getsize.\n");
- }
+ if(FAIL == H5FD_s3comms_s3r_getsize(handle))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem in H5FD_s3comms_s3r_getsize.");
/*********************
* FINAL PREPARATION *
@@ -1339,27 +1163,22 @@ H5FD_s3comms_s3r_open(const char *url,
ret_value = handle;
done:
- if (ret_value == NULL) {
- if (curlh != NULL) {
+ if(ret_value == NULL) {
+ if(curlh != NULL)
curl_easy_cleanup(curlh);
- }
- if (FAIL == H5FD_s3comms_free_purl(purl)) {
- HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL,
- "unable to free parsed url structure")
- }
- if (handle != NULL) {
+ if(FAIL == H5FD_s3comms_free_purl(purl))
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to free parsed url structure")
+ if(handle != NULL) {
H5MM_xfree(handle->region);
H5MM_xfree(handle->secret_id);
H5MM_xfree(handle->signing_key);
- if (handle->httpverb != NULL) {
+ if(handle->httpverb != NULL)
H5MM_xfree(handle->httpverb);
- }
H5MM_xfree(handle);
}
}
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5FD_s3comms_s3r_open */
@@ -1433,27 +1252,17 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
* ABSOLUTELY NECESSARY SANITY-CHECKS *
**************************************/
- if (handle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle cannot be null.\n");
- }
- if (handle->magic != S3COMMS_S3R_MAGIC) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle has invalid magic.\n");
- }
- if (handle->curlhandle == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle has bad (null) curlhandle.\n")
- }
- if (handle->purl == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle has bad (null) url.\n")
- }
+ if(handle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle cannot be null.");
+ if(handle->magic != S3COMMS_S3R_MAGIC)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has invalid magic.");
+ if(handle->curlhandle == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.")
+ if(handle->purl == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.")
HDassert( handle->purl->magic == S3COMMS_PARSED_URL_MAGIC );
- if (offset > handle->filesize || (len + offset) > handle->filesize) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to read past EoF")
- }
+ if(offset > handle->filesize || (len + offset) > handle->filesize)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to read past EoF")
curlh = handle->curlhandle;
@@ -1461,26 +1270,16 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
* PREPARE WRITEDATA *
*********************/
- if (dest != NULL) {
- sds = (struct s3r_datastruct *)H5MM_malloc(
- sizeof(struct s3r_datastruct));
- if (sds == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "could not malloc destination datastructure.\n");
- }
+ if(dest != NULL) {
+ sds = (struct s3r_datastruct *)H5MM_malloc(sizeof(struct s3r_datastruct));
+ if(sds == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc destination datastructure.");
sds->magic = S3COMMS_CALLBACK_DATASTRUCT_MAGIC;
sds->data = (char *)dest;
sds->size = 0;
- if (CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_WRITEDATA,
- sds) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL,
- "error while setting CURL option (CURLOPT_WRITEDATA). "
- "(placeholder flags)");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_WRITEDATA, sds))
+ HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "error while setting CURL option (CURLOPT_WRITEDATA).");
}
/*********************
@@ -1488,34 +1287,22 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
*********************/
if (len > 0) {
- rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \
- (S3COMMS_MAX_RANGE_STRING_SIZE+1) );
- if (rangebytesstr == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "could not malloc range format string.\n");
- }
- ret = HDsnprintf(rangebytesstr,
- (S3COMMS_MAX_RANGE_STRING_SIZE),
+ rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE+1) );
+ if(rangebytesstr == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.");
+ ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE),
"bytes="H5_PRINTF_HADDR_FMT"-"H5_PRINTF_HADDR_FMT,
- offset,
- offset + len - 1);
- if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to format HTTP Range value");
- } else if (offset > 0) {
- rangebytesstr = (char *)H5MM_malloc(sizeof(char) * \
- (S3COMMS_MAX_RANGE_STRING_SIZE+1));
- if (rangebytesstr == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "could not malloc range format string.\n");
- }
- ret = HDsnprintf(rangebytesstr,
- (S3COMMS_MAX_RANGE_STRING_SIZE),
- "bytes="H5_PRINTF_HADDR_FMT"-",
- offset);
- if (ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to format HTTP Range value");
+ offset, offset + len - 1);
+ if(ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value");
+ } else if(offset > 0) {
+ rangebytesstr = (char *)H5MM_malloc(sizeof(char) * (S3COMMS_MAX_RANGE_STRING_SIZE+1));
+ if(rangebytesstr == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "could not malloc range format string.");
+ ret = HDsnprintf(rangebytesstr, (S3COMMS_MAX_RANGE_STRING_SIZE),
+ "bytes="H5_PRINTF_HADDR_FMT"-", offset);
+ if(ret <= 0 || ret >= S3COMMS_MAX_RANGE_STRING_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value");
}
/*******************
@@ -1523,26 +1310,18 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
*******************/
if (handle->signing_key == NULL) {
- /* Do not authenticate.
- */
- if (rangebytesstr != NULL) {
- /* Pass in range directly
- */
+ /* Do not authenticate. */
+ if(rangebytesstr != NULL) {
+ /* Pass in range directly */
char *bytesrange_ptr = NULL; /* pointer past "bytes=" portion */
- bytesrange_ptr = strchr(rangebytesstr, '=');
+ bytesrange_ptr = HDstrchr(rangebytesstr, '=');
HDassert( bytesrange_ptr != NULL );
bytesrange_ptr++; /* move to first char past '=' */
HDassert( *bytesrange_ptr != '\0' );
- if (CURLE_OK !=
- curl_easy_setopt(curlh,
- CURLOPT_RANGE,
- bytesrange_ptr) )
- {
- HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL,
- "error while setting CURL option (CURLOPT_RANGE). ");
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, bytesrange_ptr))
+ HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL, "error while setting CURL option (CURLOPT_RANGE). ");
}
} else {
/* authenticate request
@@ -1575,30 +1354,18 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
/**** VERIFY INFORMATION EXISTS ****/
- if (handle->region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle must have non-null region.\n");
- }
- if (handle->secret_id == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle must have non-null secret_id.\n");
- }
- if (handle->signing_key == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle must have non-null signing_key.\n");
- }
- if (handle->httpverb == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle must have non-null httpverb.\n");
- }
- if (handle->purl->host == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle must have non-null host.\n");
- }
- if (handle->purl->path == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "handle must have non-null resource.\n");
- }
+ if(handle->region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null region.");
+ if(handle->secret_id == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null secret_id.");
+ if(handle->signing_key == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null signing_key.");
+ if(handle->httpverb == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null httpverb.");
+ if(handle->purl->host == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null host.");
+ if(handle->purl->path == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle must have non-null resource.");
/**** CREATE HTTP REQUEST STRUCTURE (hrb_t) ****/
@@ -1606,198 +1373,93 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
(const char *)handle->httpverb,
(const char *)handle->purl->path,
"HTTP/1.1");
- if (request == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not allocate hrb_t request.\n");
- }
+ if(request == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request.");
HDassert( request->magic == S3COMMS_HRB_MAGIC );
now = gmnow();
- if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not format ISO8601 time.\n");
- }
+ if(ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not format ISO8601 time.");
- if (FAIL ==
- H5FD_s3comms_hrb_node_set(
- &headers,
- "x-amz-date",
- (const char *)iso8601now) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to set x-amz-date header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if(FAIL == H5FD_s3comms_hrb_node_set( &headers, "x-amz-date", (const char *)iso8601now))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-date header")
+ if(headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
- if (FAIL ==
- H5FD_s3comms_hrb_node_set(
- &headers,
- "x-amz-content-sha256",
- (const char *)EMPTY_SHA256) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to set x-amz-content-sha256 header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if(FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-content-sha256", (const char *)EMPTY_SHA256))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-content-sha256 header")
+ if(headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
- if (rangebytesstr != NULL) {
- if (FAIL ==
- H5FD_s3comms_hrb_node_set(
- &headers,
- "Range",
- (const char *)rangebytesstr) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to set range header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if(rangebytesstr != NULL) {
+ if(FAIL == H5FD_s3comms_hrb_node_set( &headers, "Range", rangebytesstr))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set range header")
+ if(headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
}
- if (FAIL ==
- H5FD_s3comms_hrb_node_set(
- &headers,
- "Host",
- (const char *)handle->purl->host) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to set host header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ if(FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", handle->purl->host))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set host header")
+ if(headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
HDassert( headers->magic == S3COMMS_HRB_NODE_MAGIC );
request->first_header = headers;
/**** COMPUTE AUTHORIZATION ****/
- if (FAIL == /* buffer1 -> canonical request */
- H5FD_s3comms_aws_canonical_request(
- buffer1,
- 512,
- signed_headers,
- 48,
- request) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "(placeholder flags)\n");
- }
- if ( FAIL == /* buffer2->string-to-sign */
- H5FD_s3comms_tostringtosign(buffer2,
- buffer1,
- iso8601now,
- handle->region) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "(placeholder flags)\n");
- }
- if (FAIL == /* buffer1 -> signature */
- H5FD_s3comms_HMAC_SHA256(handle->signing_key,
- SHA256_DIGEST_LENGTH,
- buffer2,
- HDstrlen(buffer2),
- buffer1) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "(placeholder flags)\n");
- }
+ /* buffer1 -> canonical request */
+ if(FAIL == H5FD_s3comms_aws_canonical_request(buffer1, 512, signed_headers, 48, request))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad canonical request");
+ /* buffer2->string-to-sign */
+ if(FAIL == H5FD_s3comms_tostringtosign(buffer2, buffer1, iso8601now, handle->region))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad string-to-sign");
+ /* buffer1 -> signature */
+ if(FAIL == H5FD_s3comms_HMAC_SHA256(handle->signing_key, SHA256_DIGEST_LENGTH, buffer2, HDstrlen(buffer2), buffer1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad signature");
iso8601now[8] = 0; /* trim to yyyyMMDD */
- ret = S3COMMS_FORMAT_CREDENTIAL(buffer2,
- handle->secret_id,
- iso8601now,
- handle->region,
- "s3");
- if (ret == 0 || ret >= S3COMMS_MAX_CREDENTIAL_SIZE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to format aws4 credential string");
-
- ret = HDsnprintf(
- authorization,
- 512,
+ ret = S3COMMS_FORMAT_CREDENTIAL(buffer2, handle->secret_id, iso8601now, handle->region, "s3");
+ if(ret == 0 || ret >= S3COMMS_MAX_CREDENTIAL_SIZE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 credential string");
+
+ ret = HDsnprintf( authorization, 512,
"AWS4-HMAC-SHA256 Credential=%s,SignedHeaders=%s,Signature=%s",
- buffer2,
- signed_headers,
- buffer1);
- if (ret <= 0 || ret >= 512) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to format aws4 authorization string");
- }
+ buffer2, signed_headers, buffer1);
+ if(ret <= 0 || ret >= 512)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format aws4 authorization string");
- /* append authorization header to http request buffer
- */
- if (H5FD_s3comms_hrb_node_set(
- &headers,
- "Authorization",
- (const char *)authorization)
- == FAIL)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to set Authorization header")
- }
- if (headers == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem building headers list. "
- "(placeholder flags)\n");
- }
+ /* append authorization header to http request buffer */
+ if(H5FD_s3comms_hrb_node_set(&headers, "Authorization", (const char *)authorization) == FAIL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set Authorization header")
+ if(headers == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list.");
- /* update hrb's "first header" pointer
- */
+ /* update hrb's "first header" pointer */
request->first_header = headers;
/**** SET CURLHANDLE HTTP HEADERS FROM GENERATED DATA ****/
node = request->first_header;
- while (node != NULL) {
+ while(node != NULL) {
HDassert( node->magic == S3COMMS_HRB_NODE_MAGIC );
- curlheaders = curl_slist_append(curlheaders,
- (const char *)node->cat);
- if (curlheaders == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not append header to curl slist. "
- "(placeholder flags)\n");
- }
+ curlheaders = curl_slist_append(curlheaders, (const char *)node->cat);
+ if(curlheaders == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not append header to curl slist.");
node = node->next;
}
- /* sanity-check
- */
- if (curlheaders == NULL) {
+ /* sanity-check */
+ if(curlheaders == NULL)
/* above loop was probably never run */
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "curlheaders was never populated.\n");
- }
-
- /* finally, set http headers in curl handle
- */
- if (curl_easy_setopt(
- curlh,
- CURLOPT_HTTPHEADER,
- curlheaders)
- != CURLE_OK)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "error while setting CURL option "
- "(CURLOPT_HTTPHEADER). (placeholder flags)");
- }
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "curlheaders was never populated.");
+ /* finally, set http headers in curl handle */
+ if(curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, curlheaders) != CURLE_OK)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HTTPHEADER).");
} /* end if should authenticate (info provided) */
/*******************
@@ -1813,107 +1475,79 @@ H5FD_s3comms_s3r_read(s3r_t *handle,
char curlerrbuf[CURL_ERROR_SIZE];
curlerrbuf[0] = '\0';
- if (CURLE_OK !=
- curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem setting error buffer")
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, curlerrbuf))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem setting error buffer")
p_status = curl_easy_perform(curlh);
- if (p_status != CURLE_OK) {
- if (CURLE_OK !=
- curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem getting response code")
- }
+ if(p_status != CURLE_OK) {
+ if(CURLE_OK != curl_easy_getinfo(curlh, CURLINFO_RESPONSE_CODE, &httpcode))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem getting response code")
HDfprintf(stderr, "CURL ERROR CODE: %d\nHTTP CODE: %d\n",
p_status, httpcode);
HDfprintf(stderr, "%s\n", curl_easy_strerror(p_status));
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL,
- "problem while performing request.\n");
- }
- if (CURLE_OK !=
- curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL) )
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem unsetting error buffer")
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "problem while performing request.");
}
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_ERRORBUFFER, NULL))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem unsetting error buffer")
} /* verbose error reporting */
#else
p_status = curl_easy_perform(curlh);
- if (p_status != CURLE_OK) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL,
- "curl cannot perform request\n")
- }
+ if(p_status != CURLE_OK)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request")
#endif
#if S3COMMS_DEBUG
- if (dest != NULL) {
+ if(dest != NULL) {
HDfprintf(stderr, "len: %d\n", (int)len);
HDfprintf(stderr, "CHECKING FOR BUFFER OVERFLOW\n");
- if (sds == NULL) {
+ if(sds == NULL)
HDfprintf(stderr, "sds is NULL!\n");
- }
else {
HDfprintf(stderr, "sds: 0x%lx\n", (long long)sds);
HDfprintf(stderr, "sds->size: %d\n", (int)sds->size);
- if (len > sds->size) {
+ if(len > sds->size)
HDfprintf(stderr, "buffer overwrite\n");
- }
}
}
- else {
+ else
HDfprintf(stderr, "performed on entire file\n");
- }
#endif
done:
/* clean any malloc'd resources
*/
- if (curlheaders != NULL) {
+ if(curlheaders != NULL) {
curl_slist_free_all(curlheaders);
curlheaders = NULL;
}
- if (rangebytesstr != NULL) {
+ if(rangebytesstr != NULL) {
H5MM_xfree(rangebytesstr);
rangebytesstr = NULL;
}
- if (sds != NULL) {
+ if(sds != NULL) {
H5MM_xfree(sds);
sds = NULL;
}
- if (request != NULL) {
- while (headers != NULL)
- if (FAIL ==
- H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL))
- {
- HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot release header node")
- }
+ if(request != NULL) {
+ while(headers != NULL)
+ if(FAIL == H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL))
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header node")
HDassert( NULL == headers );
- if (FAIL == H5FD_s3comms_hrb_destroy(&request)) {
- HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot release header request structure")
- }
+ if(FAIL == H5FD_s3comms_hrb_destroy(&request))
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header request structure")
HDassert( NULL == request );
}
- if (curlh != NULL) {
+ if(curlh != NULL) {
/* clear any Range */
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL) ) {
- HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot unset CURLOPT_RANGE")
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, NULL))
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_RANGE")
/* clear headers */
- if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL) ) {
- HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot unset CURLOPT_HTTPHEADER")
- }
+ if(CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HTTPHEADER, NULL))
+ HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot unset CURLOPT_HTTPHEADER")
}
FUNC_LEAVE_NOAPI(ret_value);
@@ -1951,9 +1585,8 @@ gmnow(void)
struct tm *ret_value = NULL;
/* Doctor assert, checks against error in time() */
- if ( (time_t)(-1) != time(now_ptr) ) {
- ret_value = gmtime(now_ptr);
- }
+ if((time_t)(-1) != HDtime(now_ptr))
+ ret_value = HDgmtime(now_ptr);
HDassert( ret_value != NULL );
@@ -2035,102 +1668,66 @@ H5FD_s3comms_aws_canonical_request(
HDfprintf(stdout, "called H5FD_s3comms_aws_canonical_request.\n");
#endif
- if (http_request == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "hrb object cannot be null.\n");
- }
+ if(http_request == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null.");
HDassert( http_request->magic == S3COMMS_HRB_MAGIC );
- if (canonical_request_dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "canonical request destination cannot be null.\n");
- }
+ if(canonical_request_dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null.");
- if (signed_headers_dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "signed headers destination cannot be null.\n");
- }
+ if(signed_headers_dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "signed headers destination cannot be null.");
- /* HTTP verb, resource path, and query string lines
- */
+ /* HTTP verb, resource path, and query string lines */
cr_len = (HDstrlen(http_request->verb) +
HDstrlen(http_request->resource) +
HDstrlen(query_params) +
(size_t)3); /* three newline chars */
- if (cr_len >= cr_size) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "not enough space in canonical request");
- }
- ret = HDsnprintf( /* TODO: compiler warning */
- canonical_request_dest,
- (cr_size-1),
+ if(cr_len >= cr_size)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request");
+ /* TODO: compiler warning */
+ ret = HDsnprintf(canonical_request_dest, (cr_size - 1),
"%s\n%s\n%s\n",
- http_request->verb,
- http_request->resource,
- query_params);
- if (ret < 0 || (size_t)ret >= cr_size) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to compose canonical request first line");
- }
+ http_request->verb, http_request->resource, query_params);
+ if(ret < 0 || (size_t)ret >= cr_size)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to compose canonical request first line");
- /* write in canonical headers, building signed headers concurrently
- */
+ /* write in canonical headers, building signed headers concurrently */
node = http_request->first_header; /* assumed sorted */
- while (node != NULL) {
+ while(node != NULL) {
HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC);
- ret = HDsnprintf(
- tmpstr,
- 256,
- "%s:%s\n",
- node->lowername,
- node->value);
- if (ret < 0 || ret >= 256) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to concatenate HTTP header %s:%s",
- node->lowername,
- node->value);
- }
+ ret = HDsnprintf( tmpstr, 256, "%s:%s\n", node->lowername, node->value);
+ if(ret < 0 || ret >= 256)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to concatenate HTTP header %s:%s", node->lowername, node->value);
cr_len += HDstrlen(tmpstr);
- if (cr_len + 1 > cr_size) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "not enough space in canonical request");
- }
- strcat(canonical_request_dest, tmpstr);
-
- ret = HDsnprintf(
- tmpstr,
- 256,
- "%s;",
- node->lowername);
- if (ret < 0 || ret >= 256) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to append semicolon to lowername %s",
- node->lowername);
- }
+ if(cr_len + 1 > cr_size)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request");
+ HDstrcat(canonical_request_dest, tmpstr);
+
+ ret = HDsnprintf( tmpstr, 256, "%s;", node->lowername);
+ if(ret < 0 || ret >= 256)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to append semicolon to lowername %s", node->lowername);
sh_len += HDstrlen(tmpstr);
- if (sh_len + 1 > sh_size) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "not enough space in signed headers");
- }
- strcat(signed_headers_dest, tmpstr);
+ if(sh_len + 1 > sh_size)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in signed headers");
+ HDstrcat(signed_headers_dest, tmpstr);
node = node->next;
} /* end while node is not NULL */
- /* remove tailing ';' from signed headers sequence
- */
+ /* remove trailing ';' from signed headers sequence */
signed_headers_dest[HDstrlen(signed_headers_dest) - 1] = '\0';
/* append signed headers and payload hash
* NOTE: at present, no HTTP body is handled, per the nature of
* requests/range-gets
*/
- strcat(canonical_request_dest, "\n");
- strcat(canonical_request_dest, signed_headers_dest);
- strcat(canonical_request_dest, "\n");
- strcat(canonical_request_dest, EMPTY_SHA256);
+ HDstrcat(canonical_request_dest, "\n");
+ HDstrcat(canonical_request_dest, signed_headers_dest);
+ HDstrcat(canonical_request_dest, "\n");
+ HDstrcat(canonical_request_dest, EMPTY_SHA256);
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -2184,30 +1781,20 @@ H5FD_s3comms_bytes_to_hex(
HDfprintf(stdout, "called H5FD_s3comms_bytes_to_hex.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "hex destination cannot be null.\n")
- }
- if (msg == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "bytes sequence cannot be null.\n")
- }
+ if(dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hex destination cannot be null.")
+ if(msg == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bytes sequence cannot be null.")
for (i = 0; i < msg_len; i++) {
- int chars_written = HDsnprintf(&(dest[i * 2]),
- 3, /* 'X', 'X', '\n' */
- (lowercase == TRUE) ? "%02x" : "%02X",
- msg[i]);
- if (chars_written != 2) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem while writing hex chars for %c",
- msg[i]);
- }
+ int chars_written = HDsnprintf(&(dest[i * 2]), 3, /* 'X', 'X', '\n' */
+ (lowercase == TRUE) ? "%02x" : "%02X", msg[i]);
+ if(chars_written != 2)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem while writing hex chars for %c", msg[i]);
}
done:
FUNC_LEAVE_NOAPI(ret_value);
-
} /* end H5FD_s3comms_bytes_to_hex() */
@@ -2239,13 +1826,18 @@ H5FD_s3comms_free_purl(parsed_url_t *purl)
HDprintf("called H5FD_s3comms_free_purl.\n");
#endif
- if (purl != NULL) {
+ if(purl != NULL) {
HDassert( purl->magic == S3COMMS_PARSED_URL_MAGIC );
- if (purl->scheme != NULL) { H5MM_xfree(purl->scheme); }
- if (purl->host != NULL) { H5MM_xfree(purl->host); }
- if (purl->port != NULL) { H5MM_xfree(purl->port); }
- if (purl->path != NULL) { H5MM_xfree(purl->path); }
- if (purl->query != NULL) { H5MM_xfree(purl->query); }
+ if(purl->scheme != NULL)
+ H5MM_xfree(purl->scheme);
+ if(purl->host != NULL)
+ H5MM_xfree(purl->host);
+ if(purl->port != NULL)
+ H5MM_xfree(purl->port);
+ if(purl->path != NULL)
+ H5MM_xfree(purl->path);
+ if(purl->query != NULL)
+ H5MM_xfree(purl->query);
purl->magic += 1ul;
H5MM_xfree(purl);
}
@@ -2302,29 +1894,14 @@ H5FD_s3comms_HMAC_SHA256(
HDfprintf(stdout, "called H5FD_s3comms_HMAC_SHA256.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "destination cannot be null.");
- }
+ if(dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.");
- HMAC(EVP_sha256(),
- key,
- (int)key_len,
- (const unsigned char *)msg,
- msg_len,
- md,
- &md_len);
-
- if (H5FD_s3comms_bytes_to_hex(
- dest,
- (const unsigned char *)md,
- (size_t)md_len,
- true)
- == FAIL)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not convert to hex string.");
- }
+ HMAC(EVP_sha256(), key, (int)key_len, (const unsigned char *)msg,
+ msg_len, md, &md_len);
+
+ if(H5FD_s3comms_bytes_to_hex(dest, (const unsigned char *)md, (size_t)md_len, true) == FAIL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not convert to hex string.");
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -2407,93 +1984,73 @@ H5FD__s3comms_load_aws_creds_from_file(
int found_setting = 0;
char *line_buffer = &(buffer[0]);
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#if S3COMMS_DEBUG
HDfprintf(stdout, "called load_aws_creds_from_file.\n");
#endif
/* format target line for start of profile */
- if (32 < HDsnprintf(profile_line, 32, "[%s]", profile_name)) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
- "unable to format profile label")
- }
+ if(32 < HDsnprintf(profile_line, 32, "[%s]", profile_name))
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format profile label")
/* look for start of profile */
do {
/* clear buffer */
- for (buffer_i=0; buffer_i < 128; buffer_i++) {
+ for(buffer_i=0; buffer_i < 128; buffer_i++)
buffer[buffer_i] = 0;
- }
line_buffer = fgets(line_buffer, 128, file);
- if (line_buffer == NULL) { /* reached end of file */
+ if(line_buffer == NULL) /* reached end of file */
goto done;
- }
- } while (strncmp(line_buffer, profile_line, HDstrlen(profile_line)));
+ } while (HDstrncmp(line_buffer, profile_line, HDstrlen(profile_line)));
/* extract credentials from lines */
do {
/* clear buffer */
- for (buffer_i=0; buffer_i < 128; buffer_i++) {
+ for(buffer_i=0; buffer_i < 128; buffer_i++)
buffer[buffer_i] = 0;
- }
/* collect a line from file */
line_buffer = fgets(line_buffer, 128, file);
- if (line_buffer == NULL) {
+ if(line_buffer == NULL)
goto done; /* end of file */
- }
/* loop over names to see if line looks like assignment */
- for (setting_i = 0; setting_i < setting_count; setting_i++) {
+ for(setting_i = 0; setting_i < setting_count; setting_i++) {
size_t setting_name_len = 0;
const char *setting_name = NULL;
char line_prefix[128];
setting_name = setting_names[setting_i];
setting_name_len = HDstrlen(setting_name);
- if (HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
- "unable to format line prefix")
- }
+ if(HDsnprintf(line_prefix, 128, "%s=", setting_name) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format line prefix")
/* found a matching name? */
- if (!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) {
+ if(!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) {
found_setting = 1;
/* skip NULL destination buffer */
- if (setting_pointers[setting_i] == NULL) {
+ if(setting_pointers[setting_i] == NULL)
break;
- }
/* advance to end of name in string */
do {
line_buffer++;
} while (*line_buffer != 0 && *line_buffer != '=');
- if (*line_buffer == 0 || *(line_buffer+1) == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "incomplete assignment in file")
- }
+ if(*line_buffer == 0 || *(line_buffer+1) == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incomplete assignment in file")
line_buffer++; /* was pointing at '='; advance */
/* copy line buffer into out pointer */
- if (HDstrncpy(
- setting_pointers[setting_i],
- (const char *)line_buffer,
- HDstrlen(line_buffer))
- == NULL)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
- "unable to copy line into pointer")
- }
+ HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer, HDstrlen(line_buffer));
/* "trim" tailing whitespace by replacing with null terminator*/
buffer_i = 0;
- while (!isspace(setting_pointers[setting_i][buffer_i])) {
+ while(!HDisspace(setting_pointers[setting_i][buffer_i]))
buffer_i++;
- }
setting_pointers[setting_i][buffer_i] = '\0';
break; /* have read setting; don't compare with others */
@@ -2561,76 +2118,46 @@ H5FD_s3comms_load_aws_profile(const char *profile_name,
#else
ret = HDsnprintf(awspath, 117, "%s/.aws/", getenv("HOME")) ;
#endif
- if (ret < 0 || (size_t)ret >= 117) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
- "unable to format home-aws path")
- }
+ if(ret < 0 || (size_t)ret >= 117)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format home-aws path")
ret = HDsnprintf(filepath, 128, "%s%s", awspath, "credentials");
- if (ret < 0 || (size_t)ret >= 128) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
- "unable to format credentials path")
- }
-
- credfile = fopen(filepath, "r");
- if (credfile != NULL) {
- if (H5FD__s3comms_load_aws_creds_from_file(
- credfile,
- profile_name,
- key_id_out,
- secret_access_key_out,
- aws_region_out)
- == FAIL)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to load from aws credentials")
- }
- if (fclose(credfile) == EOF) {
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL,
- "unable to close credentials file")
- }
+ if(ret < 0 || (size_t)ret >= 128)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format credentials path")
+
+ credfile = HDfopen(filepath, "r");
+ if(credfile != NULL) {
+ if(H5FD__s3comms_load_aws_creds_from_file(credfile, profile_name, key_id_out,
+ secret_access_key_out, aws_region_out) == FAIL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws credentials")
+ if(HDfclose(credfile) == EOF)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close credentials file")
credfile = NULL;
} /* end if credential file opened */
ret = HDsnprintf(filepath, 128, "%s%s", awspath, "config");
- if (ret < 0 || (size_t)ret >= 128) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL,
- "unable to format config path")
- }
- credfile = fopen(filepath, "r");
- if (credfile != NULL) {
- if (H5FD__s3comms_load_aws_creds_from_file(
- credfile,
- profile_name,
+ if(ret < 0 || (size_t)ret >= 128)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, FAIL, "unable to format config path")
+ credfile = HDfopen(filepath, "r");
+ if(credfile != NULL) {
+ if(H5FD__s3comms_load_aws_creds_from_file( credfile, profile_name,
(*key_id_out == 0) ? key_id_out : NULL,
(*secret_access_key_out == 0) ? secret_access_key_out : NULL,
- (*aws_region_out == 0) ? aws_region_out : NULL)
- == FAIL)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to load from aws config")
- }
- if (fclose(credfile) == EOF) {
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL,
- "unable to close config file")
- }
+ (*aws_region_out == 0) ? aws_region_out : NULL) == FAIL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to load from aws config")
+ if(HDfclose(credfile) == EOF)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close config file")
credfile = NULL;
} /* end if credential file opened */
/* fail if not all three settings were loaded */
- if (*key_id_out == 0 ||
- *secret_access_key_out == 0 ||
- *aws_region_out == 0)
- {
+ if(*key_id_out == 0 || *secret_access_key_out == 0 || *aws_region_out == 0)
ret_value = FAIL;
- }
done:
- if (credfile != NULL) {
- if (fclose(credfile) == EOF) {
- HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL,
- "problem error-closing aws configuration file")
- }
- }
+ if(credfile != NULL)
+ if(HDfclose(credfile) == EOF)
+ HDONE_ERROR(H5E_ARGS, H5E_ARGS, FAIL, "problem error-closing aws configuration file")
+
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_load_aws_profile() */
@@ -2675,16 +2202,14 @@ H5FD_s3comms_nlowercase(
HDfprintf(stdout, "called H5FD_s3comms_nlowercase.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "destination cannot be null.\n");
- }
+ if(dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.");
- if (len > 0) {
+ if(len > 0) {
HDmemcpy(dest, s, len);
do {
len--;
- dest[len] = (char)tolower( (int)dest[len] );
+ dest[len] = (char)HDtolower((int)dest[len]);
} while (len > 0);
}
@@ -2743,18 +2268,14 @@ H5FD_s3comms_parse_url(
HDprintf("called H5FD_s3comms_parse_url.\n");
#endif
- if (str == NULL || *str == '\0') {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "invalid url string");
- }
+ if(str == NULL || *str == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid url string");
urllen = (long int)HDstrlen(str);
purl = (parsed_url_t *)H5MM_malloc(sizeof(parsed_url_t));
- if (purl == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "can't allocate space for parsed_url_t");
- }
+ if(purl == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for parsed_url_t");
purl->magic = S3COMMS_PARSED_URL_MAGIC;
purl->scheme = NULL;
purl->host = NULL;
@@ -2767,38 +2288,27 @@ H5FD_s3comms_parse_url(
***************/
tmpstr = HDstrchr(curstr, ':');
- if (tmpstr == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "invalid SCHEME construction: probably not URL");
- }
+ if(tmpstr == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction: probably not URL");
len = tmpstr - curstr;
HDassert( (0 <= len) && (len < urllen) );
- /* check for restrictions
- */
- for (i = 0; i < len; i++) {
+ /* check for restrictions */
+ for(i = 0; i < len; i++) {
/* scheme = [a-zA-Z+-.]+ (terminated by ":") */
- if (!isalpha(curstr[i]) &&
- '+' != curstr[i] &&
- '-' != curstr[i] &&
- '.' != curstr[i])
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "invalid SCHEME construction");
- }
+ if(!HDisalpha(curstr[i]) && '+' != curstr[i] && '-' != curstr[i] &&
+ '.' != curstr[i])
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction");
}
- /* copy lowercased scheme to structure
- */
+
+ /* copy lowercased scheme to structure */
purl->scheme = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->scheme == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "can't allocate space for SCHEME");
- }
+ if(purl->scheme == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for SCHEME");
(void)HDstrncpy(purl->scheme, curstr, (size_t)len);
purl->scheme[len] = '\0';
- for ( i = 0; i < len; i++ ) {
- purl->scheme[i] = (char)tolower(purl->scheme[i]);
- }
+ for(i = 0; i < len; i++ )
+ purl->scheme[i] = (char)HDtolower(purl->scheme[i]);
/* Skip "://" */
tmpstr += 3;
@@ -2808,46 +2318,33 @@ H5FD_s3comms_parse_url(
* READ HOST *
*************/
- if (*curstr == '[') {
+ if(*curstr == '[') {
/* IPv6 */
- while (']' != *tmpstr) {
- if (tmpstr == 0) { /* end of string reached! */
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "reached end of URL: incomplete IPv6 HOST");
- }
+ while(']' != *tmpstr) {
+ /* end of string reached! */
+ if(tmpstr == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "reached end of URL: incomplete IPv6 HOST");
tmpstr++;
}
tmpstr++;
} /* end if (IPv6) */
else {
- while (0 != *tmpstr) {
- if (':' == *tmpstr ||
- '/' == *tmpstr ||
- '?' == *tmpstr)
- {
+ while(0 != *tmpstr) {
+ if(':' == *tmpstr || '/' == *tmpstr || '?' == *tmpstr)
break;
- }
tmpstr++;
}
} /* end else (IPv4) */
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "HOST substring cannot be empty");
- }
- else
- if (len > urllen) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem with length of HOST substring");
- }
+ if(len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HOST substring cannot be empty");
+ else if(len > urllen)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of HOST substring");
- /* copy host
- */
+ /* copy host */
purl->host = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->host == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "can't allocate space for HOST");
- }
+ if(purl->host == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for HOST");
(void)HDstrncpy(purl->host, curstr, (size_t)len);
purl->host[len] = 0;
@@ -2855,36 +2352,24 @@ H5FD_s3comms_parse_url(
* READ PORT *
*************/
- if (':' == *tmpstr) {
+ if(':' == *tmpstr) {
tmpstr += 1; /* advance past ':' */
curstr = tmpstr;
- while ((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr)) {
+ while((0 != *tmpstr) && ('/' != *tmpstr) && ('?' != *tmpstr))
tmpstr++;
- }
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "PORT element cannot be empty");
- }
- else
- if (len > urllen) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem with length of PORT substring");
- }
- for (i = 0; i < len; i ++) {
- if (!isdigit(curstr[i])) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "PORT is not a decimal string");
- }
- }
-
- /* copy port
- */
+ if(len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT element cannot be empty");
+ else if(len > urllen)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PORT substring");
+ for(i = 0; i < len; i ++)
+ if(!HDisdigit(curstr[i]))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "PORT is not a decimal string");
+
+ /* copy port */
purl->port = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->port == NULL) { /* cannot malloc */
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "can't allocate space for PORT");
- }
+ if(purl->port == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PORT");
(void)HDstrncpy(purl->port, curstr, (size_t)len);
purl->port[len] = 0;
} /* end if PORT element */
@@ -2893,27 +2378,21 @@ H5FD_s3comms_parse_url(
* READ PATH *
*************/
- if ('/' == *tmpstr) {
+ if('/' == *tmpstr) {
/* advance past '/' */
tmpstr += 1;
curstr = tmpstr;
- /* seek end of PATH
- */
- while ((0 != *tmpstr) && ('?' != *tmpstr)) {
+ /* seek end of PATH */
+ while((0 != *tmpstr) && ('?' != *tmpstr))
tmpstr++;
- }
len = tmpstr - curstr;
- if (len > urllen) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem with length of PATH substring");
- }
- if (len > 0) {
+ if(len > urllen)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of PATH substring");
+ if(len > 0) {
purl->path = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->path == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "can't allocate space for PATH");
- } /* cannot malloc path pointer */
+ if(purl->path == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for PATH");
(void)HDstrncpy(purl->path, curstr, (size_t)len);
purl->path[len] = 0;
}
@@ -2923,25 +2402,19 @@ H5FD_s3comms_parse_url(
* READ QUERY *
**************/
- if ('?' == *tmpstr) {
+ if('?' == *tmpstr) {
tmpstr += 1;
curstr = tmpstr;
- while (0 != *tmpstr) {
+ while(0 != *tmpstr)
tmpstr++;
- }
len = tmpstr - curstr;
- if (len == 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "QUERY cannot be empty");
- } else if (len > urllen) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem with length of QUERY substring");
- }
+ if(len == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "QUERY cannot be empty");
+ else if(len > urllen)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem with length of QUERY substring");
purl->query = (char *)H5MM_malloc(sizeof(char) * (size_t)(len + 1));
- if (purl->query == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL,
- "can't allocate space for QUERY");
- } /* cannot malloc path pointer */
+ if(purl->query == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "can't allocate space for QUERY");
(void)HDstrncpy(purl->query, curstr, (size_t)len);
purl->query[len] = 0;
} /* end if QUERY exists */
@@ -2950,9 +2423,9 @@ H5FD_s3comms_parse_url(
ret_value = SUCCEED;
done:
- if (ret_value == FAIL) {
+ if(ret_value == FAIL)
H5FD_s3comms_free_purl(purl);
- }
+
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_s3comms_parse_url() */
@@ -3016,9 +2489,8 @@ H5FD_s3comms_percent_encode_char(
HDfprintf(stdout, "called H5FD_s3comms_percent_encode_char.\n");
#endif
- if (repr == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.\n")
- }
+ if(repr == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`.")
#if S3COMMS_DEBUG
H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, FALSE);
@@ -3026,7 +2498,7 @@ H5FD_s3comms_percent_encode_char(
HDfprintf(stdout, " CHAR-HEX: \"%s\"\n", hex);
#endif
- if (c <= (unsigned char)0x7f) {
+ if(c <= (unsigned char)0x7f) {
/* character represented in a single "byte"
* and single percent-code
*/
@@ -3035,11 +2507,8 @@ H5FD_s3comms_percent_encode_char(
#endif
*repr_len = 3;
chars_written = HDsnprintf(repr, 4, "%%%02X", c);
- if (chars_written < 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot write char %c",
- c);
- }
+ if(chars_written < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
} /* end if single-byte unicode char */
else {
/* multi-byte, multi-percent representation
@@ -3092,16 +2561,9 @@ H5FD_s3comms_percent_encode_char(
acc += (stack_size > 2) ? 0x20 : 0; /* 0x00100000 */
acc += (stack_size > 3) ? 0x10 : 0; /* 0x00010000 */
stack_size--;
- chars_written = HDsnprintf(
- repr,
- 4,
- "%%%02X",
- (unsigned char)(acc + stack[stack_size]));
- if (chars_written < 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot write char %c",
- c);
- }
+ chars_written = HDsnprintf( repr, 4, "%%%02X", (unsigned char)(acc + stack[stack_size]));
+ if(chars_written < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
*repr_len += 3;
/************************
@@ -3109,17 +2571,11 @@ H5FD_s3comms_percent_encode_char(
************************/
/* 10xxxxxx */
- for (i = 0; i < stack_size; i++) {
- chars_written = HDsnprintf(
- &repr[i*3 + 3],
- 4,
- "%%%02X",
- (unsigned char)(0x80 + stack[stack_size - 1 - i]));
- if (chars_written < 0) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "cannot write char %c",
- c);
- }
+ for(i = 0; i < stack_size; i++) {
+ chars_written = HDsnprintf( &repr[i*3 + 3], 4,
+ "%%%02X", (unsigned char)(0x80 + stack[stack_size - 1 - i]));
+ if(chars_written < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot write char %c", c);
*repr_len += 3;
} /* end for each continuation byte */
} /* end else (multi-byte) */
@@ -3190,38 +2646,24 @@ H5FD_s3comms_signing_key(
HDfprintf(stdout, "called H5FD_s3comms_signing_key.\n");
#endif
- if (md == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Destination `md` cannot be NULL.\n")
- }
- if (secret == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "`secret` cannot be NULL.\n")
- }
- if (region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "`region` cannot be NULL.\n")
- }
- if (iso8601now == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "`iso8601now` cannot be NULL.\n")
- }
+ if(md == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Destination `md` cannot be NULL.")
+ if(secret == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`secret` cannot be NULL.")
+ if(region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`region` cannot be NULL.")
+ if(iso8601now == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "`iso8601now` cannot be NULL.")
AWS4_secret_len = 4 + HDstrlen(secret) + 1;
AWS4_secret = (char*)H5MM_malloc(sizeof(char *) * AWS4_secret_len);
- if (AWS4_secret == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Could not allocate space.\n")
- }
+ if(AWS4_secret == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Could not allocate space.")
- /* prepend "AWS4" to start of the secret key
- */
+ /* prepend "AWS4" to start of the secret key */
ret = HDsnprintf(AWS4_secret, AWS4_secret_len,"%s%s", "AWS4", secret);
- if ((size_t)ret != (AWS4_secret_len - 1)) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem writing AWS4+secret `%s`",
- secret);
- }
+ if((size_t)ret != (AWS4_secret_len - 1))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem writing AWS4+secret `%s`", secret);
/* hash_func, key, len(key), msg, len(msg), digest_dest, digest_len_dest
* we know digest length, so ignore via NULL
@@ -3320,37 +2762,26 @@ H5FD_s3comms_tostringtosign(
HDfprintf(stdout, "called H5FD_s3comms_tostringtosign.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "destination buffer cannot be null.\n")
- }
- if (req == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "canonical request cannot be null.\n")
- }
- if (now == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Timestring cannot be NULL.\n")
- }
- if (region == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "Region cannot be NULL.\n")
- }
+ if(dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer cannot be null.")
+ if(req == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request cannot be null.")
+ if(now == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Timestring cannot be NULL.")
+ if(region == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Region cannot be NULL.")
- for (i = 0; i < 128; i++) {
+ for(i = 0; i < 128; i++)
tmp[i] = '\0';
- }
- for (i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) {
+ for(i = 0; i < SHA256_DIGEST_LENGTH * 2 + 1; i++) {
checksum[i] = '\0';
hexsum[i] = '\0';
}
HDstrncpy(day, now, 8);
day[8] = '\0';
ret = HDsnprintf(tmp, 127, "%s/%s/s3/aws4_request", day, region);
- if (ret <= 0 || ret >= 127) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "problem adding day and region to string")
- }
+ if(ret <= 0 || ret >= 127)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem adding day and region to string")
HDmemcpy((dest + d), "AWS4-HMAC-SHA256\n", 17);
d = 17;
@@ -3363,24 +2794,14 @@ H5FD_s3comms_tostringtosign(
d += HDstrlen(tmp);
dest[d++] = '\n';
- SHA256((const unsigned char *)req,
- HDstrlen(req),
- checksum);
+ SHA256((const unsigned char *)req, HDstrlen(req), checksum);
- if (H5FD_s3comms_bytes_to_hex(
- hexsum,
- (const unsigned char *)checksum,
- SHA256_DIGEST_LENGTH,
- true)
- == FAIL)
- {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "could not create hex string");
- }
+ if(H5FD_s3comms_bytes_to_hex(hexsum, (const unsigned char *)checksum,
+ SHA256_DIGEST_LENGTH, true) == FAIL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not create hex string");
- for (i = 0; i < SHA256_DIGEST_LENGTH * 2; i++) {
+ for(i = 0; i < SHA256_DIGEST_LENGTH * 2; i++)
dest[d++] = hexsum[i];
- }
dest[d] = '\0';
@@ -3432,21 +2853,16 @@ H5FD_s3comms_trim(char *dest,
HDfprintf(stdout, "called H5FD_s3comms_trim.\n");
#endif
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "destination cannot be null.")
- }
- if (s == NULL) {
+ if(dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be null.")
+ if(s == NULL)
s_len = 0;
- }
- if (s_len > 0) {
+ if(s_len > 0) {
/* Find first non-whitespace character from start;
* reduce total length per character.
*/
- while ((s_len > 0) &&
- isspace((unsigned char)s[0]) && s_len > 0)
- {
+ while((s_len > 0) && HDisspace((unsigned char)s[0]) && s_len > 0) {
s++;
s_len--;
}
@@ -3455,14 +2871,13 @@ H5FD_s3comms_trim(char *dest,
* reduce length per-character.
* If length is 0 already, there is no non-whitespace character.
*/
- if (s_len > 0) {
+ if(s_len > 0) {
do {
s_len--;
- } while( isspace((unsigned char)s[s_len]) );
+ } while(HDisspace((unsigned char)s[s_len]));
s_len++;
- /* write output into dest
- */
+ /* write output into dest */
HDmemcpy(dest, s, s_len);
}
}
@@ -3534,54 +2949,36 @@ H5FD_s3comms_uriencode(
HDfprintf(stdout, "H5FD_s3comms_uriencode called.\n");
#endif
- if (s == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "source string cannot be NULL");
- }
- if (dest == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "destination cannot be NULL");
- }
+ if(s == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source string cannot be NULL");
+ if(dest == NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination cannot be NULL");
/* Write characters to destination, converting to percent-encoded
* "hex-utf-8" strings if necessary.
* e.g., '$' -> "%24"
*/
- for (s_off = 0; s_off < s_len; s_off++) {
+ for(s_off = 0; s_off < s_len; s_off++) {
c = s[s_off];
- if (isalnum(c) ||
- c == '.' ||
- c == '-' ||
- c == '_' ||
- c == '~' ||
- (c == '/' && encode_slash == FALSE))
- {
+ if(HDisalnum(c) || c == '.' || c == '-' || c == '_' ||
+ c == '~' || (c == '/' && encode_slash == FALSE))
dest[dest_off++] = c;
- }
else {
hex_off = 0;
- if (H5FD_s3comms_percent_encode_char(
- hex_buffer,
- (const unsigned char)c,
- &hex_len)
- == FAIL)
- {
+ if(H5FD_s3comms_percent_encode_char(hex_buffer, (const unsigned char)c,
+ &hex_len) == FAIL) {
hex_buffer[0] = c;
hex_buffer[1] = 0;
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "unable to percent-encode character \'%s\' "
- "at %d in \"%s\"", hex_buffer, (int)s_off, s);
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to percent-encode character \'%s\' " "at %d in \"%s\"", hex_buffer, (int)s_off, s);
}
- for (hex_off = 0; hex_off < hex_len; hex_off++) {
+ for(hex_off = 0; hex_off < hex_len; hex_off++)
dest[dest_off++] = hex_buffer[hex_off];
- }
} /* end else (not a regular character) */
} /* end for each character */
- if (dest_off < s_len)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
- "buffer overflow");
+ if(dest_off < s_len)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buffer overflow");
*n_written = dest_off;
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 3551905..f2ceb3b 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Thursday, July 29, 1999
*
* Purpose: The POSIX unbuffered file driver using only the HDF5 public
@@ -95,7 +95,6 @@ typedef struct H5FD_sec2_t {
* a single file.
*/
hbool_t fam_to_single;
-
} H5FD_sec2_t;
/*
@@ -113,37 +112,37 @@ typedef struct H5FD_sec2_t {
* which can be addressed entirely by the second
* argument of the file seek function.
*/
-#define MAXADDR (((haddr_t)1<<(8*sizeof(HDoff_t)-1))-1)
-#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR))
+#define MAXADDR (((haddr_t)1 << (8 * sizeof(HDoff_t) - 1)) - 1)
+#define ADDR_OVERFLOW(A) (HADDR_UNDEF == (A) || ((A) & ~(haddr_t)MAXADDR))
#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR)
#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \
- HADDR_UNDEF==(A)+(Z) || \
- (HDoff_t)((A)+(Z))<(HDoff_t)(A))
+ HADDR_UNDEF == (A) + (Z) || \
+ (HDoff_t)((A) + (Z)) < (HDoff_t)(A))
/* Prototypes */
-static herr_t H5FD_sec2_term(void);
-static H5FD_t *H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id,
+static herr_t H5FD__sec2_term(void);
+static H5FD_t *H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
-static herr_t H5FD_sec2_close(H5FD_t *_file);
-static int H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_sec2_query(const H5FD_t *_f1, unsigned long *flags);
-static haddr_t H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type);
-static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
-static herr_t H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
+static herr_t H5FD__sec2_close(H5FD_t *_file);
+static int H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__sec2_query(const H5FD_t *_f1, unsigned long *flags);
+static haddr_t H5FD__sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static haddr_t H5FD__sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type);
+static herr_t H5FD__sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle);
+static herr_t H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, void *buf);
-static herr_t H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
+static herr_t H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, const void *buf);
-static herr_t H5FD_sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_sec2_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_sec2_unlock(H5FD_t *_file);
+static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__sec2_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__sec2_unlock(H5FD_t *_file);
static const H5FD_class_t H5FD_sec2_g = {
"sec2", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_sec2_term, /* terminate */
+ H5FD__sec2_term, /* terminate */
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
@@ -154,23 +153,23 @@ static const H5FD_class_t H5FD_sec2_g = {
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
- H5FD_sec2_open, /* open */
- H5FD_sec2_close, /* close */
- H5FD_sec2_cmp, /* cmp */
- H5FD_sec2_query, /* query */
+ H5FD__sec2_open, /* open */
+ H5FD__sec2_close, /* close */
+ H5FD__sec2_cmp, /* cmp */
+ H5FD__sec2_query, /* query */
NULL, /* get_type_map */
NULL, /* alloc */
NULL, /* free */
- H5FD_sec2_get_eoa, /* get_eoa */
- H5FD_sec2_set_eoa, /* set_eoa */
- H5FD_sec2_get_eof, /* get_eof */
- H5FD_sec2_get_handle, /* get_handle */
- H5FD_sec2_read, /* read */
- H5FD_sec2_write, /* write */
+ H5FD__sec2_get_eoa, /* get_eoa */
+ H5FD__sec2_set_eoa, /* set_eoa */
+ H5FD__sec2_get_eof, /* get_eof */
+ H5FD__sec2_get_handle, /* get_handle */
+ H5FD__sec2_read, /* read */
+ H5FD__sec2_write, /* write */
NULL, /* flush */
- H5FD_sec2_truncate, /* truncate */
- H5FD_sec2_lock, /* lock */
- H5FD_sec2_unlock, /* unlock */
+ H5FD__sec2_truncate, /* truncate */
+ H5FD__sec2_lock, /* lock */
+ H5FD__sec2_unlock, /* unlock */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -235,7 +234,7 @@ done:
/*---------------------------------------------------------------------------
- * Function: H5FD_sec2_term
+ * Function: H5FD__sec2_term
*
* Purpose: Shut down the VFD
*
@@ -247,15 +246,15 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_term(void)
+H5FD__sec2_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Reset VFL ID */
H5FD_SEC2_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_sec2_term() */
+} /* end H5FD__sec2_term() */
/*-------------------------------------------------------------------------
@@ -292,7 +291,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_open
+ * Function: H5FD__sec2_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -307,7 +306,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
+H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
H5FD_sec2_t *file = NULL; /* sec2 VFD info */
int fd = -1; /* File descriptor */
@@ -318,7 +317,7 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
h5_stat_t sb;
H5FD_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check on file offsets */
HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t));
@@ -407,11 +406,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_open() */
+} /* end H5FD__sec2_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_close
+ * Function: H5FD__sec2_close
*
* Purpose: Closes an HDF5 file.
*
@@ -424,12 +423,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_close(H5FD_t *_file)
+H5FD__sec2_close(H5FD_t *_file)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(file);
@@ -443,11 +442,11 @@ H5FD_sec2_close(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_close() */
+} /* end H5FD__sec2_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_cmp
+ * Function: H5FD__sec2_cmp
*
* Purpose: Compares two files belonging to this driver using an
* arbitrary (but consistent) ordering.
@@ -462,13 +461,13 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_sec2_t *f1 = (const H5FD_sec2_t *)_f1;
const H5FD_sec2_t *f2 = (const H5FD_sec2_t *)_f2;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
#ifdef H5_HAVE_WIN32_API
if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1)
@@ -497,11 +496,11 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_cmp() */
+} /* end H5FD__sec2_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_query
+ * Function: H5FD__sec2_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -514,11 +513,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
+H5FD__sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; /* sec2 VFD info */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Set the VFL feature flags that this driver supports */
/* Notice: the Mirror VFD Writer currently uses only the Sec2 driver as
@@ -543,11 +542,11 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_sec2_query() */
+} /* end H5FD__sec2_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_get_eoa
+ * Function: H5FD__sec2_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
* is the first address past the last byte allocated in the
@@ -561,18 +560,18 @@ 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 H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eoa)
-} /* end H5FD_sec2_get_eoa() */
+} /* end H5FD__sec2_get_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_set_eoa
+ * Function: H5FD__sec2_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -586,20 +585,20 @@ H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
file->eoa = addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_sec2_set_eoa() */
+} /* end H5FD__sec2_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_get_eof
+ * Function: H5FD__sec2_get_eof
*
* Purpose: Returns the end-of-file marker, which is the greater of
* either the filesystem end-of-file or the HDF5 end-of-address
@@ -614,18 +613,18 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eof)
-} /* end H5FD_sec2_get_eof() */
+} /* end H5FD__sec2_get_eof() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_get_handle
+ * Function: H5FD__sec2_get_handle
*
* Purpose: Returns the file handle of sec2 file driver.
*
@@ -637,12 +636,12 @@ H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_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;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
if(!file_handle)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid")
@@ -651,11 +650,11 @@ H5FD_sec2_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_handl
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_get_handle() */
+} /* end H5FD__sec2_get_handle() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_read
+ * Function: H5FD__sec2_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
* into buffer BUF according to data transfer properties in
@@ -671,14 +670,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_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;
HDoff_t offset = (HDoff_t)addr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -691,17 +690,15 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pread) */
- if(addr != file->pos || OP_READ != file->op) {
+ if(addr != file->pos || OP_READ != file->op)
if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
- }
#endif /* H5_HAVE_PREADWRITE */
/* Read data, being careful of interrupted system calls, partial results,
* and the end of the file.
*/
while(size > 0) {
-
h5_posix_io_t bytes_in = 0; /* # of bytes to read */
h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
@@ -758,11 +755,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_read() */
+} /* end H5FD__sec2_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_write
+ * Function: H5FD__sec2_write
*
* Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR
* from buffer BUF according to data transfer properties in
@@ -776,14 +773,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_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;
HDoff_t offset = (HDoff_t)addr;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file && file->pub.cls);
HDassert(buf);
@@ -796,17 +793,15 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
#ifndef H5_HAVE_PREADWRITE
/* Seek to the correct location (if we don't have pwrite) */
- if(addr != file->pos || OP_WRITE != file->op) {
+ if(addr != file->pos || OP_WRITE != file->op)
if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
- }
#endif /* H5_HAVE_PREADWRITE */
/* Write the data, being careful of interrupted system calls and partial
* results
*/
while(size > 0) {
-
h5_posix_io_t bytes_in = 0; /* # of bytes to write */
h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */
@@ -859,11 +854,11 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_write() */
+} /* end H5FD__sec2_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_truncate
+ * Function: H5FD__sec2_truncate
*
* Purpose: Makes sure that the true file size is the same (or larger)
* than the end-of-address.
@@ -876,12 +871,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_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 */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -928,11 +923,11 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_truncate() */
+} /* end H5FD__sec2_truncate() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_lock
+ * Function: H5FD__sec2_lock
*
* Purpose: To place an advisory lock on a file.
* The lock type to apply depends on the parameter "rw":
@@ -946,13 +941,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_lock(H5FD_t *_file, hbool_t rw)
+H5FD__sec2_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */
int lock_flags; /* file locking flags */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -969,11 +964,11 @@ H5FD_sec2_lock(H5FD_t *_file, hbool_t rw)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_lock() */
+} /* end H5FD__sec2_lock() */
/*-------------------------------------------------------------------------
- * Function: H5FD_sec2_unlock
+ * Function: H5FD__sec2_unlock
*
* Purpose: To remove the existing lock on the file
*
@@ -984,12 +979,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_sec2_unlock(H5FD_t *_file)
+H5FD__sec2_unlock(H5FD_t *_file)
{
H5FD_sec2_t *file = (H5FD_sec2_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
HDassert(file);
@@ -1002,5 +997,5 @@ H5FD_sec2_unlock(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_sec2_unlock() */
+} /* end H5FD__sec2_unlock() */
diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h
index a4ade0b..d669582 100644
--- a/src/H5FDsec2.h
+++ b/src/H5FDsec2.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the sec2 driver.
diff --git a/src/H5FDspace.c b/src/H5FDspace.c
index e1f0cb2..22d7e22 100644
--- a/src/H5FDspace.c
+++ b/src/H5FDspace.c
@@ -15,7 +15,7 @@
*
* Created: H5FDspace.c
* Jan 3 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Space allocation routines for the file driver code.
*
@@ -84,7 +84,7 @@ H5FL_DEFINE(H5FD_free_t);
/*-------------------------------------------------------------------------
- * Function: H5FD_extend
+ * Function: H5FD__extend
*
* Purpose: Extend the EOA space of a file.
*
@@ -99,12 +99,12 @@ H5FL_DEFINE(H5FD_free_t);
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size)
+H5FD__extend(H5FD_t *file, H5FD_mem_t type, hsize_t size)
{
haddr_t eoa; /* Address of end-of-allocated space */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* check args */
HDassert(file);
@@ -129,7 +129,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hsize_t size)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_extend() */
+} /* end H5FD__extend() */
/*-------------------------------------------------------------------------
@@ -203,7 +203,7 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed")
} /* end if */
else {
- ret_value = H5FD_extend(file, type, size + extra);
+ ret_value = H5FD__extend(file, type, size + extra);
if(!H5F_addr_defined(ret_value))
HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver eoa update request failed")
} /* end else */
@@ -439,7 +439,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_
/* Check if the block is exactly at the end of the file */
if(H5F_addr_eq(blk_end, eoa)) {
/* Extend the object by extending the underlying file */
- if(HADDR_UNDEF == H5FD_extend(file, type, extra_requested))
+ if(HADDR_UNDEF == H5FD__extend(file, type, extra_requested))
HGOTO_ERROR(H5E_VFL, H5E_CANTEXTEND, FAIL, "driver extend request failed")
/* Mark EOA info dirty in cache, so change will get encoded */
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 4ed3c4a..18a8735 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -27,8 +27,6 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5FDsec2.h" /* Generic Functions */
-#include "H5FDstdio.h" /* Generic Functions */
#include "H5Pprivate.h" /* Property lists */
/* The driver identification number, initialized at runtime */
@@ -83,9 +81,8 @@ typedef struct H5FD_splitter_t {
#define H5FD_SPLITTER_WO_ERROR(file, funcname, errmajor, errminor, ret, mesg) \
{ \
H5FD__splitter_log_error((file), (funcname), (mesg)); \
- if (FALSE == (file)->fa.ignore_wo_errs) { \
+ if(FALSE == (file)->fa.ignore_wo_errs) \
HGOTO_ERROR((errmajor), (errminor), (ret), (mesg)) \
- } \
}
#define H5FD_SPLITTER_DEBUG_OP_CALLS 0 /* debugging print toggle; 0 disables */
@@ -93,7 +90,7 @@ typedef struct H5FD_splitter_t {
#if H5FD_SPLITTER_DEBUG_OP_CALLS
#define H5FD_SPLITTER_LOG_CALL(name) do { \
HDprintf("called %s()\n", (name)); \
- fflush(stdout); \
+ HDfflush(stdout); \
} while (0)
#else
#define H5FD_SPLITTER_LOG_CALL(name) /* no-op */
@@ -103,73 +100,75 @@ typedef struct H5FD_splitter_t {
/* Print error messages from W/O channel to log file */
static herr_t H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg);
-
static int H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr);
/* Prototypes */
-static herr_t H5FD_splitter_term(void);
-static hsize_t H5FD_splitter_sb_size(H5FD_t *_file);
-static herr_t H5FD_splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/);
-static herr_t H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf);
-static void *H5FD_splitter_fapl_get(H5FD_t *_file);
-static void *H5FD_splitter_fapl_copy(const void *_old_fa);
-static herr_t H5FD_splitter_fapl_free(void *_fapl);
-static H5FD_t *H5FD_splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static herr_t H5FD_splitter_close(H5FD_t *_file);
-static int H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
-static herr_t H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */);
-static herr_t H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map);
-static haddr_t H5FD_splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
-static herr_t H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
-static haddr_t H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
-static herr_t H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr);
-static haddr_t H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
-static herr_t H5FD_splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle);
-static herr_t H5FD_splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf);
-static herr_t H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf);
-static herr_t H5FD_splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
-static herr_t H5FD_splitter_lock(H5FD_t *_file, hbool_t rw);
-static herr_t H5FD_splitter_unlock(H5FD_t *_file);
+static herr_t H5FD__splitter_term(void);
+static hsize_t H5FD__splitter_sb_size(H5FD_t *_file);
+static herr_t H5FD__splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/);
+static herr_t H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf);
+static void *H5FD__splitter_fapl_get(H5FD_t *_file);
+static void *H5FD__splitter_fapl_copy(const void *_old_fa);
+static herr_t H5FD__splitter_fapl_free(void *_fapl);
+static H5FD_t *H5FD__splitter_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static herr_t H5FD__splitter_close(H5FD_t *_file);
+static int H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */);
+static herr_t H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map);
+static haddr_t H5FD__splitter_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size);
+static herr_t H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size);
+static haddr_t H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
+static herr_t H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr);
+static haddr_t H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type);
+static herr_t H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void** file_handle);
+static herr_t H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf);
+static herr_t H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf);
+static herr_t H5FD__splitter_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
+static herr_t H5FD__splitter_lock(H5FD_t *_file, hbool_t rw);
+static herr_t H5FD__splitter_unlock(H5FD_t *_file);
static const H5FD_class_t H5FD_splitter_g = {
"splitter", /* name */
MAXADDR, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
- H5FD_splitter_term, /* terminate */
- H5FD_splitter_sb_size, /* sb_size */
- H5FD_splitter_sb_encode, /* sb_encode */
- H5FD_splitter_sb_decode, /* sb_decode */
+ H5FD__splitter_term, /* terminate */
+ H5FD__splitter_sb_size, /* sb_size */
+ H5FD__splitter_sb_encode, /* sb_encode */
+ H5FD__splitter_sb_decode, /* sb_decode */
sizeof(H5FD_splitter_fapl_t), /* fapl_size */
- H5FD_splitter_fapl_get, /* fapl_get */
- H5FD_splitter_fapl_copy, /* fapl_copy */
- H5FD_splitter_fapl_free, /* fapl_free */
+ H5FD__splitter_fapl_get, /* fapl_get */
+ H5FD__splitter_fapl_copy, /* fapl_copy */
+ H5FD__splitter_fapl_free, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
- H5FD_splitter_open, /* open */
- H5FD_splitter_close, /* close */
- H5FD_splitter_cmp, /* cmp */
- H5FD_splitter_query, /* query */
- H5FD_splitter_get_type_map, /* get_type_map */
- H5FD_splitter_alloc, /* alloc */
- H5FD_splitter_free, /* free */
- H5FD_splitter_get_eoa, /* get_eoa */
- H5FD_splitter_set_eoa, /* set_eoa */
- H5FD_splitter_get_eof, /* get_eof */
- H5FD_splitter_get_handle, /* get_handle */
- H5FD_splitter_read, /* read */
- H5FD_splitter_write, /* write */
- H5FD_splitter_flush, /* flush */
- H5FD_splitter_truncate, /* truncate */
- H5FD_splitter_lock, /* lock */
- H5FD_splitter_unlock, /* unlock */
+ H5FD__splitter_open, /* open */
+ H5FD__splitter_close, /* close */
+ H5FD__splitter_cmp, /* cmp */
+ H5FD__splitter_query, /* query */
+ H5FD__splitter_get_type_map, /* get_type_map */
+ H5FD__splitter_alloc, /* alloc */
+ H5FD__splitter_free, /* free */
+ H5FD__splitter_get_eoa, /* get_eoa */
+ H5FD__splitter_set_eoa, /* set_eoa */
+ H5FD__splitter_get_eof, /* get_eof */
+ H5FD__splitter_get_handle, /* get_handle */
+ H5FD__splitter_read, /* read */
+ H5FD__splitter_write, /* write */
+ H5FD__splitter_flush, /* flush */
+ H5FD__splitter_truncate, /* truncate */
+ H5FD__splitter_lock, /* lock */
+ H5FD__splitter_unlock, /* unlock */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
/* Declare a free list to manage the H5FD_splitter_t struct */
H5FL_DEFINE_STATIC(H5FD_splitter_t);
+/* Declare a free list to manage the H5FD_splitter_fapl_t struct */
+H5FL_DEFINE_STATIC(H5FD_splitter_fapl_t);
+
/*-------------------------------------------------------------------------
* Function: H5FD__init_package
@@ -186,11 +185,10 @@ H5FD__init_package(void)
FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD__init_package");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (H5FD_splitter_init() < 0) {
+ if(H5FD_splitter_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize splitter VFD")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -214,11 +212,10 @@ H5FD_splitter_init(void)
FUNC_ENTER_NOAPI(FAIL)
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_init");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (H5I_VFL != H5I_get_type(H5FD_SPLITTER_g)) {
+ if(H5I_VFL != H5I_get_type(H5FD_SPLITTER_g))
H5FD_SPLITTER_g = H5FDregister(&H5FD_splitter_g);
- }
ret_value = H5FD_SPLITTER_g;
@@ -228,7 +225,7 @@ done:
/*---------------------------------------------------------------------------
- * Function: H5FD_splitter_term
+ * Function: H5FD__splitter_term
*
* Purpose: Shut down the splitter VFD.
*
@@ -236,17 +233,17 @@ done:
*---------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_term(void)
+H5FD__splitter_term(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_term");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Reset VFL ID */
H5FD_SPLITTER_g = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5FD_splitter_term() */
+} /* end H5FD__splitter_term() */
/*-------------------------------------------------------------------------
@@ -265,25 +262,22 @@ H5FD__copy_plist(hid_t fapl_id,
int ret_value = 0;
H5P_genplist_t *plist_ptr = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD__copy_plist");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(id_out_ptr != NULL);
- if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) {
+ if(FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list");
- }
plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id);
- if (NULL == plist_ptr) {
+ if(NULL == plist_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "unable to get property list");
- }
*id_out_ptr = H5P_copy_plist(plist_ptr, FALSE);
- if (H5I_INVALID_HID == *id_out_ptr) {
+ if(H5I_INVALID_HID == *id_out_ptr)
HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, -1, "unable to copy file access property list");
- }
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -302,28 +296,21 @@ done:
herr_t
H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config)
{
- H5FD_splitter_fapl_t info;
+ H5FD_splitter_fapl_t *info = NULL;
H5P_genplist_t *plist_ptr = NULL;
herr_t ret_value = SUCCEED;
- H5Eclear2(H5E_DEFAULT);
-
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*Dr", fapl_id, vfd_config);
- H5FD_SPLITTER_LOG_CALL("H5Pset_fapl_splitter");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (H5FD_SPLITTER_MAGIC != vfd_config->magic) {
+ if(H5FD_SPLITTER_MAGIC != vfd_config->magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)")
- }
- if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invlaid config (version number mismatch)")
- }
-
- if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) {
+ if(H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != vfd_config->version)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid config (version number mismatch)")
+ if(NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid property list")
- }
-
/* Make sure that the W/O channel supports write-only capability.
* Some drivers (e.g. family or multi) do revision of the superblock
@@ -331,55 +318,54 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config)
* Uses the feature flag H5FD_FEAT_DEFAULT_VFD_COMPATIBLE as the
* determining attribute.
*/
- if (H5P_DEFAULT != vfd_config->wo_fapl_id) {
+ if(H5P_DEFAULT != vfd_config->wo_fapl_id) {
H5FD_class_t *wo_driver = NULL;
H5FD_driver_prop_t wo_driver_prop;
H5P_genplist_t *wo_plist_ptr = NULL;
unsigned long wo_driver_flags = 0;
wo_plist_ptr = (H5P_genplist_t *)H5I_object(vfd_config->wo_fapl_id);
- if (NULL == wo_plist_ptr) {
+ if(NULL == wo_plist_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- }
- if (H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0) {
+ if(H5P_peek(wo_plist_ptr, H5F_ACS_FILE_DRV_NAME, &wo_driver_prop) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info")
- }
wo_driver = (H5FD_class_t *)H5I_object(wo_driver_prop.driver_id);
- if (NULL == wo_driver) {
+ if(NULL == wo_driver)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid driver ID in file access property list")
- }
- if (H5FD_driver_query(wo_driver, &wo_driver_flags) < 0) {
+ if(H5FD_driver_query(wo_driver, &wo_driver_flags) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't query VFD flags")
- }
- if (0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags)) {
+ if(0 == (H5FD_FEAT_DEFAULT_VFD_COMPATIBLE & wo_driver_flags))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "unsuitable W/O driver")
- }
} /* end if W/O VFD is non-default */
+ info = H5FL_CALLOC(H5FD_splitter_fapl_t);
+ if(NULL == info)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to allocate file access property list struct")
- info.ignore_wo_errs = vfd_config->ignore_wo_errs;
- HDstrncpy(info.wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX);
- HDstrncpy(info.log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX);
- info.rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
- info.wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
+ info->ignore_wo_errs = vfd_config->ignore_wo_errs;
+ HDstrncpy(info->wo_path, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(info->log_file_path, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX);
+ info->rw_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
+ info->wo_fapl_id = H5P_FILE_ACCESS_DEFAULT; /* pre-set value */
/* Set non-default channel FAPL IDs in splitter configuration info */
- if (H5P_DEFAULT != vfd_config->rw_fapl_id) {
- if (FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS)) {
+ if(H5P_DEFAULT != vfd_config->rw_fapl_id) {
+ if(FALSE == H5P_isa_class(vfd_config->rw_fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- }
- info.rw_fapl_id = vfd_config->rw_fapl_id;
+ info->rw_fapl_id = vfd_config->rw_fapl_id;
}
- if (H5P_DEFAULT != vfd_config->wo_fapl_id) {
- if (FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS)) {
+ if(H5P_DEFAULT != vfd_config->wo_fapl_id) {
+ if(FALSE == H5P_isa_class(vfd_config->wo_fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list")
- }
- info.wo_fapl_id = vfd_config->wo_fapl_id;
+ info->wo_fapl_id = vfd_config->wo_fapl_id;
}
- ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, &info);
+ ret_value = H5P_set_driver(plist_ptr, H5FD_SPLITTER, info);
done:
+ if(info)
+ info = H5FL_FREE(H5FD_splitter_fapl_t, info);
+
FUNC_LEAVE_API(ret_value)
} /* end H5Pset_fapl_splitter() */
@@ -406,48 +392,39 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config_out)
FUNC_ENTER_API(FAIL)
H5TRACE2("e", "i*Dr", fapl_id, config_out);
- H5FD_SPLITTER_LOG_CALL("H5Pget_fapl_splitter");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
- if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) {
+ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- }
- if (config_out == NULL) {
+ if(config_out == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out pointer is null")
- }
- if (H5FD_SPLITTER_MAGIC != config_out->magic) {
+ if(H5FD_SPLITTER_MAGIC != config_out->magic)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (magic number mismatch)")
- }
- if (H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version) {
+ if(H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION != config_out->version)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "info-out pointer invalid (version unsafe)")
- }
/* Pre-set out FAPL IDs with intent to replace these values */
config_out->rw_fapl_id = H5I_INVALID_HID;
config_out->wo_fapl_id = H5I_INVALID_HID;
/* Check and get the splitter fapl */
- if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) {
+ if(NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
- }
- if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr)) {
+ if(H5FD_SPLITTER != H5P_peek_driver(plist_ptr))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver")
- }
- if (NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr))) {
+ if(NULL == (fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr)))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unable to get specific-driver info")
- }
HDstrncpy(config_out->wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
HDstrncpy(config_out->log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
config_out->ignore_wo_errs = fapl_ptr->ignore_wo_errs;
/* Copy R/W and W/O FAPLs */
- if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0) {
+ if(H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(config_out->rw_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy R/W FAPL");
- }
- if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0) {
+ if(H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(config_out->wo_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "can't copy W/O FAPL");
- }
done:
FUNC_LEAVE_API(ret_value)
@@ -455,7 +432,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_flush
+ * Function: H5FD__splitter_flush
*
* Purpose: Flushes all data to disk for both channels.
*
@@ -463,32 +440,28 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
+H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_flush");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Public API for dxpl "context" */
- if (H5FDflush(file->rw_file, dxpl_id, closing) < 0) {
+ if(H5FDflush(file->rw_file, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush R/W file")
- }
- if (H5FDflush(file->wo_file, dxpl_id, closing) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_flush",
- H5E_VFL, H5E_CANTFLUSH, FAIL,
- "unable to flush W/O file")
- }
+ if(H5FDflush(file->wo_file, dxpl_id, closing) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_flush() */
+} /* end H5FD__splitter_flush() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_read
+ * Function: H5FD__splitter_read
*
* Purpose: Reads SIZE bytes of data from the R/W channel, beginning at
* address ADDR into buffer BUF according to data transfer
@@ -502,45 +475,37 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_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__splitter_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)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_read");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(file && file->pub.cls);
HDassert(buf);
/* Check for overflow conditions */
- if (!H5F_addr_defined(addr)) {
+ if(!H5F_addr_defined(addr))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined, addr = %llu", (unsigned long long)addr)
- }
- if (REGION_OVERFLOW(addr, size)) {
+ if(REGION_OVERFLOW(addr, size))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu", (unsigned long long)addr)
- }
/* Only read from R/W channel */
/* Public API for dxpl "context" */
- if (H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0) {
+ if(H5FDread(file->rw_file, type, dxpl_id, addr, size, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "Reading from R/W channel failed")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_read() */
+} /* end H5FD__splitter_read() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_write
+ * Function: H5FD__splitter_write
*
* Purpose: Writes SIZE bytes of data to R/W and W/O channels, beginning
* at address ADDR from buffer BUF according to data transfer
@@ -550,38 +515,34 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf)
+H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id,
+ haddr_t addr, size_t size, const void *buf)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
H5P_genplist_t *plist_ptr = NULL;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_write");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id))) {
+ if(NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
- }
/* Write to each file */
/* Public API for dxpl "context" */
- if (H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0) {
+ if(H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "R/W file write failed")
- }
- if (H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_write",
- H5E_VFL, H5E_WRITEERROR, FAIL,
- "unable to write W/O file")
- }
+ if(H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_write() */
+} /* end H5FD__splitter_write() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_fapl_get
+ * Function: H5FD__splitter_fapl_get
*
* Purpose: Returns a file access property list which indicates how the
* specified file is being accessed. The return list could be
@@ -593,23 +554,23 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5FD_splitter_fapl_get(H5FD_t *_file)
+H5FD__splitter_fapl_get(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_get");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- ret_value = H5FD_splitter_fapl_copy(&(file->fa));
+ ret_value = H5FD__splitter_fapl_copy(&(file->fa));
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD__splitter_fapl_get() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_fapl_copy
+ * Function: H5FD__splitter_fapl_copy
*
* Purpose: Copies the file access properties.
*
@@ -618,56 +579,45 @@ H5FD_splitter_fapl_get(H5FD_t *_file)
*-------------------------------------------------------------------------
*/
static void *
-H5FD_splitter_fapl_copy(const void *_old_fa)
+H5FD__splitter_fapl_copy(const void *_old_fa)
{
const H5FD_splitter_fapl_t *old_fa_ptr = (const H5FD_splitter_fapl_t *)_old_fa;
H5FD_splitter_fapl_t *new_fa_ptr = NULL;
void *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_copy");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(old_fa_ptr);
- new_fa_ptr = (H5FD_splitter_fapl_t *)H5MM_calloc(sizeof(H5FD_splitter_fapl_t));
- if (NULL == new_fa_ptr) {
+ new_fa_ptr = H5FL_CALLOC(H5FD_splitter_fapl_t);
+ if(NULL == new_fa_ptr)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL")
- }
- if (HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t)) == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to shallow-copy info")
- }
- if (HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy write-only channel file path")
- }
- if (HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_ARGS, H5E_CANTCOPY, NULL, "unable to copy log file path")
- }
+ HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_splitter_fapl_t));
+ HDstrncpy(new_fa_ptr->wo_path, old_fa_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(new_fa_ptr->log_file_path, old_fa_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
/* Copy R/W and W/O FAPLs */
- if (H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0) {
+ if(H5FD__copy_plist(old_fa_ptr->rw_fapl_id, &(new_fa_ptr->rw_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL");
- }
- if (H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0) {
+ if(H5FD__copy_plist(old_fa_ptr->wo_fapl_id, &(new_fa_ptr->wo_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL");
- }
ret_value = (void *)new_fa_ptr;
done:
- if (NULL == ret_value) {
- if (new_fa_ptr) {
- H5MM_free(new_fa_ptr);
- }
- }
+ if(NULL == ret_value)
+ if(new_fa_ptr)
+ new_fa_ptr = H5FL_FREE(H5FD_splitter_fapl_t, new_fa_ptr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_fapl_copy() */
+} /* end H5FD__splitter_fapl_copy() */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_fapl_free
+ * Function: H5FD__splitter_fapl_free
*
* Purpose: Releases the file access lists
*
@@ -675,35 +625,33 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_fapl_free(void *_fapl)
+H5FD__splitter_fapl_free(void *_fapl)
{
H5FD_splitter_fapl_t *fapl = (H5FD_splitter_fapl_t*)_fapl;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_fapl_free");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(fapl);
- if (H5I_dec_ref(fapl->rw_fapl_id) < 0) {
+ if(H5I_dec_ref(fapl->rw_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close R/W FAPL ID")
- }
- if (H5I_dec_ref(fapl->wo_fapl_id) < 0) {
+ if(H5I_dec_ref(fapl->wo_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close W/O FAPL ID")
- }
/* Free the property list */
- H5MM_free(fapl);
+ fapl = H5FL_FREE(H5FD_splitter_fapl_t, fapl);
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_fapl_free() */
+} /* end H5FD__splitter_fapl_free() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_open
+ * Function: H5FD__splitter_open
*
* Purpose: Create and/or opens a file as an HDF5 file.
*
@@ -714,123 +662,99 @@ done:
*-------------------------------------------------------------------------
*/
static H5FD_t *
-H5FD_splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr)
+H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, haddr_t maxaddr)
{
H5FD_splitter_t *file_ptr = NULL; /* Splitter VFD info */
const H5FD_splitter_fapl_t *fapl_ptr = NULL; /* Driver-specific property list */
H5P_genplist_t *plist_ptr = NULL;
H5FD_t *ret_value = NULL;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_open");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
- if (!name || !*name) {
+ if(!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name")
- }
- if (0 == maxaddr || HADDR_UNDEF == maxaddr) {
+ if(0 == maxaddr || HADDR_UNDEF == maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr")
- }
- if (ADDR_OVERFLOW(maxaddr)) {
+ if(ADDR_OVERFLOW(maxaddr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr")
- }
- if ( (H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) ||
- (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id)) )
- {
+ if((H5P_FILE_ACCESS_DEFAULT == splitter_fapl_id) ||
+ (H5FD_SPLITTER != H5Pget_driver(splitter_fapl_id)) )
/* presupposes that H5P_FILE_ACCESS_DEFAULT is not a splitter */
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "driver is not splitter")
- }
file_ptr = (H5FD_splitter_t *)H5FL_CALLOC(H5FD_splitter_t);
- if (NULL == file_ptr) {
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
- }
+ if(NULL == file_ptr)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate file struct")
file_ptr->fa.rw_fapl_id = H5I_INVALID_HID;
file_ptr->fa.wo_fapl_id = H5I_INVALID_HID;
/* Get the driver-specific file access properties */
plist_ptr = (H5P_genplist_t *)H5I_object(splitter_fapl_id);
- if (NULL == plist_ptr) {
+ if(NULL == plist_ptr)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
- }
fapl_ptr = (const H5FD_splitter_fapl_t *)H5P_peek_driver_info(plist_ptr);
- if (NULL == fapl_ptr) {
+ if(NULL == fapl_ptr)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get VFL driver info")
- }
/* Copy simpler info */
- if (HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy write-only path")
- }
- if (HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX) == NULL) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTCOPY, NULL, "unable to copy logfile path")
- }
+ HDstrncpy(file_ptr->fa.wo_path, fapl_ptr->wo_path, H5FD_SPLITTER_PATH_MAX);
+ HDstrncpy(file_ptr->fa.log_file_path, fapl_ptr->log_file_path, H5FD_SPLITTER_PATH_MAX);
file_ptr->fa.ignore_wo_errs = fapl_ptr->ignore_wo_errs;
/* Copy R/W and W/O channel FAPLs. */
- if (H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0) {
+ if(H5FD__copy_plist(fapl_ptr->rw_fapl_id, &(file_ptr->fa.rw_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy R/W FAPL");
- }
- if (H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0) {
+ if(H5FD__copy_plist(fapl_ptr->wo_fapl_id, &(file_ptr->fa.wo_fapl_id)) < 0)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy W/O FAPL");
- }
/* Prepare log file if necessary.
* If application wants to ignore the errors from W/O channel and
* provided a name for the log file, then open it
*/
- if (!file_ptr->logfp) {
- if (file_ptr->fa.log_file_path[0] != '\0') {
+ if(!file_ptr->logfp) {
+ if(file_ptr->fa.log_file_path[0] != '\0') {
file_ptr->logfp = HDfopen(file_ptr->fa.log_file_path, "w");
- if (file_ptr->logfp == NULL) {
+ if(file_ptr->logfp == NULL)
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open log file")
- }
} /* end if logfile path given */
} /* end if logfile pointer/handle does not exist */
file_ptr->rw_file = H5FD_open(name, flags, fapl_ptr->rw_fapl_id, HADDR_UNDEF);
- if (!file_ptr->rw_file) {
+ if(!file_ptr->rw_file)
HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open R/W file")
- }
file_ptr->wo_file = H5FD_open(fapl_ptr->wo_path, flags, fapl_ptr->wo_fapl_id, HADDR_UNDEF);
- if (!file_ptr->wo_file) {
- H5FD_SPLITTER_WO_ERROR(file_ptr, "H5FD_splitter_open",
- H5E_VFL, H5E_CANTOPENFILE, NULL,
- "unable to open W/O file")
- }
+ if(!file_ptr->wo_file)
+ H5FD_SPLITTER_WO_ERROR(file_ptr, FUNC, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file")
ret_value = (H5FD_t*)file_ptr;
done:
- if (NULL == ret_value) {
- if (file_ptr) {
- if (H5I_INVALID_HID != file_ptr->fa.rw_fapl_id) {
+ if(NULL == ret_value) {
+ if(file_ptr) {
+ if(H5I_INVALID_HID != file_ptr->fa.rw_fapl_id)
H5I_dec_ref(file_ptr->fa.rw_fapl_id);
- }
- if (H5I_INVALID_HID != file_ptr->fa.wo_fapl_id) {
+ if(H5I_INVALID_HID != file_ptr->fa.wo_fapl_id)
H5I_dec_ref(file_ptr->fa.wo_fapl_id);
- }
- if (file_ptr->rw_file) {
+ if(file_ptr->rw_file)
H5FD_close(file_ptr->rw_file);
- }
- if (file_ptr->wo_file) {
+ if(file_ptr->wo_file)
H5FD_close(file_ptr->wo_file);
- }
- if (file_ptr->logfp) {
+ if(file_ptr->logfp)
HDfclose(file_ptr->logfp);
- }
H5FL_FREE(H5FD_splitter_t, file_ptr);
}
} /* end if error */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_open() */
+} /* end H5FD__splitter_open() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_close
+ * Function: H5FD__splitter_close
*
* Purpose: Closes files on both read-write and write-only channels.
*
@@ -839,39 +763,31 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_close(H5FD_t *_file)
+H5FD__splitter_close(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_close");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
- if (H5I_dec_ref(file->fa.rw_fapl_id) < 0) {
+ if(H5I_dec_ref(file->fa.rw_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close R/W FAPL")
- }
- if (H5I_dec_ref(file->fa.wo_fapl_id) < 0) {
+ if(H5I_dec_ref(file->fa.wo_fapl_id) < 0)
HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close W/O FAPL")
- }
- if (file->rw_file) {
- if (H5FD_close(file->rw_file) == FAIL) {
+ if(file->rw_file)
+ if(H5FD_close(file->rw_file) == FAIL)
HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close R/W file")
- }
- }
- if (file->wo_file) {
- if (H5FD_close(file->wo_file) == FAIL) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_close",
- H5E_VFL, H5E_CANTCLOSEFILE, FAIL,
- "unable to close W/O file")
- }
- }
+ if(file->wo_file)
+ if(H5FD_close(file->wo_file) == FAIL)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close W/O file")
- if (file->logfp) {
+ if(file->logfp) {
HDfclose(file->logfp);
file->logfp = NULL;
}
@@ -882,11 +798,11 @@ H5FD_splitter_close(H5FD_t *_file)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_close() */
+} /* end H5FD__splitter_close() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_get_eoa
+ * Function: H5FD__splitter_get_eoa
*
* Purpose: Returns the end-of-address marker for the file. The EOA
* marker is the first address past the last byte allocated in
@@ -898,30 +814,29 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
haddr_t ret_value = HADDR_UNDEF;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eoa");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if ((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF) {
+ if((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, HADDR_UNDEF, "unable to get eoa")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_eoa */
+} /* end H5FD__splitter_get_eoa */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_set_eoa
+ * Function: H5FD__splitter_set_eoa
*
* Purpose: Set the end-of-address marker for the file. This function is
* called shortly after an existing HDF5 file is opened in order
@@ -931,37 +846,33 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
+H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_set_eoa";)
+ H5FD_SPLITTER_LOG_CALL(FUNC)
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
HDassert(file->wo_file);
- if (H5FD_set_eoa(file->rw_file, type, addr) < 0) {
+ if(H5FD_set_eoa(file->rw_file, type, addr) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "H5FDset_eoa failed for R/W file")
- }
- if (H5FD_set_eoa(file->wo_file, type, addr) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_set_eoa",
- H5E_VFL, H5E_CANTSET, FAIL,
- "unable to set EOA for W/O file")
- }
+ if(H5FD_set_eoa(file->wo_file, type, addr) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_set_eoa() */
+} /* end H5FD__splitter_set_eoa() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_get_eof
+ * Function: H5FD__splitter_get_eof
*
* Purpose: Returns the end-of-address marker for the file. The EOA
* marker is the first address past the last byte allocated in
@@ -973,30 +884,29 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
+H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_eof");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type))) {
+ if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type)))
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "unable to get eof")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_eof */
+} /* end H5FD__splitter_get_eof */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_truncate
+ * Function: H5FD__splitter_truncate
*
* Purpose: Notify driver to truncate the file back to the allocated size.
*
@@ -1004,36 +914,32 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
+H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_truncate");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(file);
HDassert(file->rw_file);
HDassert(file->wo_file);
- if (H5FDtruncate(file->rw_file, dxpl_id, closing) < 0) {
+ if(H5FDtruncate(file->rw_file, dxpl_id, closing) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate R/W file")
- }
- if (H5FDtruncate(file->wo_file, dxpl_id, closing) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_truncate",
- H5E_VFL, H5E_CANTUPDATE, FAIL,
- "unable to truncate W/O file")
- }
+ if(H5FDtruncate(file->wo_file, dxpl_id, closing) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_truncate */
+} /* end H5FD__splitter_truncate */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_sb_size
+ * Function: H5FD__splitter_sb_size
*
* Purpose: Obtains the number of bytes required to store the driver file
* access data in the HDF5 superblock.
@@ -1047,29 +953,28 @@ done:
*-------------------------------------------------------------------------
*/
static hsize_t
-H5FD_splitter_sb_size(H5FD_t *_file)
+H5FD__splitter_sb_size(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
hsize_t ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_size");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (file->rw_file) {
+ if(file->rw_file)
ret_value = H5FD_sb_size(file->rw_file);
- }
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_sb_size */
+} /* end H5FD__splitter_sb_size */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_sb_encode
+ * Function: H5FD__splitter_sb_encode
*
* Purpose: Encode driver-specific data into the output arguments.
*
@@ -1077,30 +982,29 @@ H5FD_splitter_sb_size(H5FD_t *_file)
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/)
+H5FD__splitter_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_encode");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0) {
+ if(file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL, "unable to encode the superblock in R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_sb_encode */
+} /* end H5FD__splitter_sb_encode */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_sb_decode
+ * Function: H5FD__splitter_sb_decode
*
* Purpose: Decodes the driver information block.
*
@@ -1110,30 +1014,29 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
+H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_sb_decode");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Sanity check */
HDassert(file);
HDassert(file->rw_file);
- if (H5FD_sb_load(file->rw_file, name, buf) < 0) {
+ if(H5FD_sb_load(file->rw_file, name, buf) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode the superblock in R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_sb_decode */
+} /* end H5FD__splitter_sb_decode */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_cmp
+ * Function: H5FD__splitter_cmp
*
* Purpose: Compare the keys of two files.
*
@@ -1142,15 +1045,15 @@ done:
*-------------------------------------------------------------------------
*/
static int
-H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
+H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
{
const H5FD_splitter_t *f1 = (const H5FD_splitter_t *)_f1;
const H5FD_splitter_t *f2 = (const H5FD_splitter_t *)_f2;
herr_t ret_value = 0; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_cmp");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(f1);
HDassert(f2);
@@ -1158,11 +1061,11 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
ret_value = H5FD_cmp(f1->rw_file, f2->rw_file);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_cmp */
+} /* end H5FD__splitter_cmp */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_get_handle
+ * Function: H5FD__splitter_get_handle
*
* Purpose: Returns a pointer to the file handle of low-level virtual
* file driver.
@@ -1171,17 +1074,15 @@ H5FD_splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_get_handle(
- H5FD_t *_file,
- hid_t H5_ATTR_UNUSED fapl,
- void **file_handle)
+H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl,
+ void **file_handle)
{
H5FD_splitter_t *file = (H5FD_splitter_t*)_file;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_handle");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
@@ -1189,18 +1090,16 @@ H5FD_splitter_get_handle(
HDassert(file_handle);
/* Only do for R/W channel */
- if (H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0)
- {
+ if(H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to get handle of R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_handle */
+} /* end H5FD__splitter_get_handle */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_lock
+ * Function: H5FD__splitter_lock
*
* Purpose: Sets a file lock.
*
@@ -1208,37 +1107,32 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_lock(H5FD_t *_file, hbool_t rw)
+H5FD__splitter_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_lock");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
HDassert(file);
HDassert(file->rw_file);
/* Place the lock on each file */
- if (H5FD_lock(file->rw_file, rw) < 0) {
+ if(H5FD_lock(file->rw_file, rw) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock R/W file")
- }
- if (file->wo_file != NULL) {
- if (H5FD_lock(file->wo_file, rw) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_lock",
- H5E_VFL, H5E_CANTLOCK, FAIL,
- "unable to lock W/O file")
- }
- }
+ if(file->wo_file != NULL)
+ if(H5FD_lock(file->wo_file, rw) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTLOCK, FAIL, "unable to lock W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_lock */
+} /* end H5FD__splitter_lock */
/*--------------------------------------------------------------------------
- * Function: H5FD_splitter_unlock
+ * Function: H5FD__splitter_unlock
*
* Purpose: Removes a file lock.
*
@@ -1246,37 +1140,33 @@ done:
*--------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_unlock(H5FD_t *_file)
+H5FD__splitter_unlock(H5FD_t *_file)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_unlock");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
/* Remove the lock on each file */
- if (H5FD_unlock(file->rw_file) < 0) {
+ if(H5FD_unlock(file->rw_file) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock R/W file")
- }
- if (file->wo_file != NULL) {
- if (H5FD_unlock(file->wo_file) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL,
- "unable to unlock W/O file")
- }
- }
+ if(file->wo_file != NULL)
+ if(H5FD_unlock(file->wo_file) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTUNLOCK, FAIL, "unable to unlock W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_unlock */
+} /* end H5FD__splitter_unlock */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_query
+ * Function: H5FD__splitter_query
*
* Purpose: Set the flags that this VFL driver is capable of supporting.
* (listed in H5FDpublic.h)
@@ -1285,40 +1175,37 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_query(const H5FD_t *_file, unsigned long *flags /* out */)
+H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_query");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
- if (file) {
+ if(file) {
HDassert(file);
HDassert(file->rw_file);
- if (H5FDquery(file->rw_file, flags) < 0) {
- HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL,
- "unable to query R/W file");
- }
+ if(H5FDquery(file->rw_file, flags) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to query R/W file");
}
else {
/* There is no file. Because this is a pure passthrough VFD,
* it has no features of its own.
*/
- if (flags) {
+ if(flags)
*flags = 0;
- }
}
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_query() */
+} /* end H5FD__splitter_query() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_alloc
+ * Function: H5FD__splitter_alloc
*
* Purpose: Allocate file memory.
*
@@ -1326,37 +1213,33 @@ done:
*-------------------------------------------------------------------------
*/
static haddr_t
-H5FD_splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
+H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_alloc");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
/* Allocate memory for each file, only return the return value for R/W file. */
- if ((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF) {
+ if((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate for R/W file")
- }
- if (H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_alloc",
- H5E_VFL, H5E_CANTINIT, HADDR_UNDEF,
- "unable to alloc for W/O file")
- }
+ if(H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to alloc for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_alloc() */
+} /* end H5FD__splitter_alloc() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_get_type_map
+ * Function: H5FD__splitter_get_type_map
*
* Purpose: Retrieve the memory type mapping for this file
*
@@ -1364,31 +1247,30 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
+H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map)
{
const H5FD_splitter_t *file = (const H5FD_splitter_t *)_file;
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_get_type_map");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
/* Retrieve memory type mapping for R/W channel only */
- if (H5FD_get_fs_type_map(file->rw_file, type_map) < 0) {
+ if(H5FD_get_fs_type_map(file->rw_file, type_map) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "unable to allocate for R/W file")
- }
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_get_type_map() */
+} /* end H5FD__splitter_get_type_map() */
/*-------------------------------------------------------------------------
- * Function: H5FD_splitter_free
+ * Function: H5FD__splitter_free
*
* Purpose: Free the resources for the splitter VFD.
*
@@ -1396,32 +1278,28 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size)
+H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size)
{
H5FD_splitter_t *file = (H5FD_splitter_t *)_file; /* VFD file struct */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
- H5FD_SPLITTER_LOG_CALL("H5FD_splitter_free");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(file->rw_file);
- if (H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0) {
+ if(H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free for R/W file")
- }
- if (H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0) {
- H5FD_SPLITTER_WO_ERROR(file, "H5FD_splitter_free",
- H5E_VFL, H5E_CANTINIT, FAIL,
- "unable to free for W/O file")
- }
+ if(H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0)
+ H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_splitter_free() */
+} /* end H5FD__splitter_free() */
/*-------------------------------------------------------------------------
@@ -1435,33 +1313,29 @@ done:
static herr_t
H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const char *msg)
{
- size_t size = 0;
- char *s = NULL;
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC_NOERR
- H5FD_SPLITTER_LOG_CALL("H5FD__splitter_log_error");
+ H5FD_SPLITTER_LOG_CALL(FUNC);
/* Check arguments */
HDassert(file);
HDassert(atfunc && *atfunc);
HDassert(msg && *msg);
- if (file->logfp != NULL) {
- size = strlen(atfunc) + strlen(msg) + 3; /* ':', ' ', '\n' */
- s = (char *)malloc(sizeof(char) * (size+1));
- if (NULL == s) {
+ if(file->logfp != NULL) {
+ size_t size;
+ char *s;
+
+ size = HDstrlen(atfunc) + HDstrlen(msg) + 3; /* ':', ' ', '\n' */
+ s = (char *)HDmalloc(sizeof(char) * (size + 1));
+ if(NULL == s)
ret_value = FAIL;
- }
- else
- if (size < (size_t)HDsnprintf(s, size+1, "%s: %s\n", atfunc, msg)) {
+ else if(size < (size_t)HDsnprintf(s, size+1, "%s: %s\n", atfunc, msg))
ret_value = FAIL;
- }
- else
- if (size != HDfwrite(s, 1, size, file->logfp)) {
+ else if(size != HDfwrite(s, 1, size, file->logfp))
ret_value = FAIL;
- }
HDfree(s);
}
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index d29a1b4..1d401c2 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
+/* Programmer: Robb Matzke
* Wednesday, October 22, 1997
*
* Purpose: The C STDIO virtual file driver which only uses calls from stdio.h.
diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h
index f99aacf..9a5bc78 100644
--- a/src/H5FDstdio.h
+++ b/src/H5FDstdio.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Monday, August 2, 1999
*
* Purpose: The public header file for the sec2 driver.
diff --git a/src/H5FDtest.c b/src/H5FDtest.c
index 2eb176d..7afc1bf 100644
--- a/src/H5FDtest.c
+++ b/src/H5FDtest.c
@@ -110,6 +110,5 @@ H5FD__supports_swmr_test(const char *vfd_name)
ret_value = !HDstrcmp(vfd_name, "log") || !HDstrcmp(vfd_name, "sec2");
FUNC_LEAVE_NOAPI(ret_value)
-
} /* end H5FD__supports_swmr_test() */
diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h
index 5cf68a1..5e23712 100644
--- a/src/H5FDwindows.h
+++ b/src/H5FDwindows.h
@@ -12,8 +12,8 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Scott Wegner <swegner@hdfgroup.org>
- * Based on code by Robb Matzke
+ * Programmer: Scott Wegner
+ * Based on code by Robb Matzke
* Thursday, May 24 2007
*
* Purpose: The public header file for the windows driver.
diff --git a/src/H5FL.c b/src/H5FL.c
index 66d27fb..e50616a 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, March 23, 2000
*
* Purpose: Manage priority queues of free-lists (of blocks of bytes).
diff --git a/src/H5FLmodule.h b/src/H5FLmodule.h
index 48b8d2b..dbce75c 100644
--- a/src/H5FLmodule.h
+++ b/src/H5FLmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h
index 94a51e5..a2c019a 100644
--- a/src/H5FLprivate.h
+++ b/src/H5FLprivate.h
@@ -15,12 +15,10 @@
*
* Created: H5FLprivate.h
* Mar 23 2000
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Private non-prototype header.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5FLprivate_H
diff --git a/src/H5FS.c b/src/H5FS.c
index 6d574c0..cb60c0e 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Tuesday, May 2, 2006
*
* Purpose: Free space tracking functions.
@@ -787,9 +787,6 @@ H5FS__dirty(H5FS_t *fspace)
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
-#ifdef QAK
-HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC);
-#endif /* QAK */
/* Sanity check */
HDassert(fspace);
@@ -1206,9 +1203,6 @@ void
H5FS__assert(const H5FS_t *fspace)
{
FUNC_ENTER_PACKAGE_NOERR
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->tot_sect_count);
-#endif /* QAK */
/* Checks for section info, if it's available */
if(fspace->sinfo) {
@@ -1224,9 +1218,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->
HDassert(fspace->tot_sect_count >= fspace->serial_sect_count);
HDassert(fspace->tot_sect_count >= fspace->ghost_sect_count);
HDassert(fspace->tot_sect_count == (fspace->serial_sect_count + fspace->ghost_sect_count));
-#ifdef QAK
- HDassert(fspace->serial_sect_count > 0 || fspace->ghost_sect_count == 0);
-#endif /* QAK */
FUNC_LEAVE_NOAPI_VOID
} /* end H5FS__assert() */
diff --git a/src/H5FScache.c b/src/H5FScache.c
index c3e3998..ed468b4 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -15,7 +15,7 @@
*
* Created: H5FScache.c
* May 2 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement file free space metadata cache methods.
*
@@ -163,7 +163,6 @@ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -235,7 +234,6 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 18 2013
*
*-------------------------------------------------------------------------
@@ -350,7 +348,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -796,7 +793,6 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* January 3, 2017
*
*-------------------------------------------------------------------------
@@ -860,7 +856,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* May 2 2006
*
*-------------------------------------------------------------------------
@@ -1032,7 +1027,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l
unsigned sect_cnt_size; /* The size of the section size counts */
/* Compute the size of the section counts */
- sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count);
+ sect_cnt_size = H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count);
/* Reset the section count, the "add" routine will update it */
old_tot_sect_count = fspace->tot_sect_count;
@@ -1132,7 +1127,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* August 14, 2013
*
*-------------------------------------------------------------------------
@@ -1300,7 +1294,7 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len,
/* Set up user data for iterator */
udata.sinfo = sinfo;
udata.image = &image;
- udata.sect_cnt_size = H5VM_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count);
+ 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++)
diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c
index c615b68..9708e9e 100644
--- a/src/H5FSdbg.c
+++ b/src/H5FSdbg.c
@@ -15,7 +15,7 @@
*
* Created: H5FSdbg.c
* May 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Dump debugging information about a free space manager
*
diff --git a/src/H5FSint.c b/src/H5FSint.c
index 6ba5748..926b818 100644
--- a/src/H5FSint.c
+++ b/src/H5FSint.c
@@ -15,7 +15,7 @@
*
* Created: H5FSint.c
* Fall 2012
- * Dana Robinson <derobins@hdfgroup.org>
+ * Dana Robinson
*
* Purpose: Internal routines for free space managers.
*
diff --git a/src/H5FSmodule.h b/src/H5FSmodule.h
index b2869dd..88c663b 100644
--- a/src/H5FSmodule.h
+++ b/src/H5FSmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h
index 2c56ab6..0cc328e 100644
--- a/src/H5FSpkg.h
+++ b/src/H5FSpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Tuesday, May 2, 2006
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h
index d2e1f90..e02a8e2 100644
--- a/src/H5FSprivate.h
+++ b/src/H5FSprivate.h
@@ -15,7 +15,7 @@
*
* Created: H5FSprivate.h
* May 2 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Private header for library accessible file free space routines.
*
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index d783901..269f63c 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Monday, July 31, 2006
*
* Purpose: Free space tracking functions.
@@ -144,10 +144,10 @@ HDfprintf(stderr, "%s: fspace->addr = %a\n", FUNC, fspace->addr);
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Set non-zero values */
- sinfo->nbins = H5VM_log2_gen(fspace->max_sect_size);
+ sinfo->nbins = H5VM__log2_gen(fspace->max_sect_size);
sinfo->sect_prefix_size = H5FS_SINFO_PREFIX_SIZE(f);
sinfo->sect_off_size = (fspace->max_sect_addr + 7) / 8;
- sinfo->sect_len_size = H5VM_limit_enc_size((uint64_t)fspace->max_sect_size);
+ sinfo->sect_len_size = H5VM__limit_enc_size((uint64_t)fspace->max_sect_size);
#ifdef H5FS_SINFO_DEBUG
HDfprintf(stderr, "%s: fspace->max_sect_size = %Hu\n", FUNC, fspace->max_sect_size);
HDfprintf(stderr, "%s: fspace->max_sect_addr = %u\n", FUNC, fspace->max_sect_addr);
@@ -518,12 +518,6 @@ H5FS__sect_serialize_size(H5FS_t *fspace)
/* Check arguments. */
HDassert(fspace);
-#ifdef QAK
-HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->sect_size);
-HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count);
-HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS__sect_serialize_size", fspace->alloc_sect_size);
-HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count);
-#endif /* QAK */
/* Compute the size of the buffer required to serialize all the sections */
if(fspace->serial_sect_count > 0) {
@@ -533,11 +527,7 @@ HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_se
sect_buf_size = fspace->sinfo->sect_prefix_size;
/* Count for each differently sized serializable section */
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS__sect_serialize_size", fspace->sinfo->serial_size_count);
-HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS__sect_serialize_size", fspace->serial_sect_count);
-#endif /* QAK */
- sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count);
+ sect_buf_size += fspace->sinfo->serial_size_count * H5VM__limit_enc_size((uint64_t)fspace->serial_sect_count);
/* Size for each differently sized serializable section */
sect_buf_size += fspace->sinfo->serial_size_count * fspace->sinfo->sect_len_size;
@@ -604,10 +594,6 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls,
fspace->serial_sect_count++;
/* Increment amount of space required to serialize all sections */
-#ifdef QAK
-HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
-HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
-#endif /* QAK */
fspace->sinfo->serial_size += cls->serial_size;
/* Update the free space sections' serialized size */
@@ -664,10 +650,6 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls)
fspace->serial_sect_count--;
/* Decrement amount of space required to serialize all sections */
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
-HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
-#endif /* QAK */
fspace->sinfo->serial_size -= cls->serial_size;
/* Update the free space sections' serialized size */
@@ -710,9 +692,6 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node
* the bin's skiplist is also a skiplist...)
*/
sinfo->bins[bin].tot_sect_count--;
-#ifdef QAK
-HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count);
-#endif /* QAK */
/* Check for 'ghost' or 'serializable' section */
if(cls->flags & H5FS_CLS_GHOST_OBJ) {
@@ -798,7 +777,7 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls,
HDassert(cls);
/* Determine correct bin which holds items of at least the section's size */
- bin = H5VM_log2_gen(sect->size);
+ bin = H5VM__log2_gen(sect->size);
HDassert(bin < sinfo->nbins);
if(sinfo->bins[bin].bin_list == NULL)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?")
@@ -853,9 +832,6 @@ H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls,
if(!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
H5FS_section_info_t *tmp_sect_node; /* Temporary section node */
-#ifdef QAK
-HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, (unsigned)sect->type);
-#endif /* QAK */
tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, &sect->addr);
if(tmp_sect_node == NULL || tmp_sect_node != sect)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list")
@@ -866,9 +842,6 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk")
/* Decrement amount of free space managed */
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
fspace->tot_space -= sect->size;
done:
@@ -982,9 +955,6 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls,
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
-#ifdef QAK
-HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr);
-#endif /* QAK */
/* Check arguments. */
HDassert(sinfo);
@@ -993,16 +963,15 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s
HDassert(sect->size);
/* Determine correct bin which holds items of the section's size */
- bin = H5VM_log2_gen(sect->size);
+ bin = H5VM__log2_gen(sect->size);
HDassert(bin < sinfo->nbins);
if(sinfo->bins[bin].bin_list == NULL) {
if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes")
} /* end if */
- else {
+ else
/* Check for node list of the correct size already */
fspace_node = (H5FS_node_t *)H5SL_search(sinfo->bins[bin].bin_list, &sect->size);
- } /* end else */
/* Check if we need to create a new skip list for nodes of this size */
if(fspace_node == NULL) {
@@ -1030,9 +999,6 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, s
/* (Different from the # of items in the bin's skiplist, since each node on
* the bin's skiplist is also a skiplist...)
*/
-#ifdef QAK
-HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count);
-#endif /* QAK */
sinfo->bins[bin].tot_sect_count++;
if(cls->flags & H5FS_CLS_GHOST_OBJ) {
sinfo->bins[bin].ghost_sect_count++;
@@ -1095,9 +1061,6 @@ H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls,
/* Add section to the address-ordered list of sections, if allowed */
if(!(cls->flags & H5FS_CLS_SEPAR_OBJ)) {
-#ifdef QAK
-HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type);
-#endif /* QAK */
if(fspace->sinfo->merge_list == NULL)
if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections")
@@ -1146,21 +1109,12 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags)
cls = &fspace->sect_cls[sect->type];
/* Add section to size tracked data structures */
-#ifdef QAK
-HDfprintf(stderr, "%s: Check 1.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
if(H5FS__sect_link_size(fspace->sinfo, cls, sect) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures")
-#ifdef QAK
-HDfprintf(stderr, "%s: Check 2.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
/* Update rest of free space manager data structures for section addition */
if(H5FS__sect_link_rest(fspace, cls, sect, flags) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to non-size tracking data structures")
-#ifdef QAK
-HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space);
-#endif /* QAK */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1304,9 +1258,6 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data)
} while(modified);
} /* end if */
HDassert(*sect);
-#ifdef QAK
-HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
-#endif /* QAK */
/* Loop until no more shrinking */
do {
@@ -1319,10 +1270,6 @@ HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sec
if((status = (*sect_cls->can_shrink)(*sect, op_data)) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container")
if(status > 0) {
-#ifdef QAK
-HDfprintf(stderr, "%s: Can shrink!\n", FUNC);
-#endif /* QAK */
-
/* Remove SECT from free-space manager */
/* (only possible to happen on second+ pass through loop) */
if(remove_sect) {
@@ -1365,18 +1312,7 @@ HDfprintf(stderr, "%s: Can shrink!\n", FUNC);
if(remove_sect && (*sect != NULL))
*sect = NULL;
-#ifdef QAK
-HDfprintf(stderr, "%s: Done shrinking\n", FUNC);
-if(*sect)
- HDfprintf(stderr, "%s: (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED"));
-else
- HDfprintf(stderr, "%s: *sect = %p\n", FUNC, *sect);
-#endif /* QAK */
-
done:
-#ifdef QAK
-HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
-#endif /* QAK */
FUNC_LEAVE_NOAPI(ret_value)
} /* H5FS__sect_merge() */
@@ -1704,12 +1640,8 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node
HDassert(node);
/* Determine correct bin which holds items of at least the section's size */
- bin = H5VM_log2_gen(request);
+ bin = H5VM__log2_gen(request);
HDassert(bin < fspace->sinfo->nbins);
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins);
-HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin);
-#endif /* QAK */
alignment = fspace->alignment;
if(!((alignment > 1) && (request >= fspace->align_thres)))
alignment = 0; /* no alignment */
@@ -1841,10 +1773,6 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **
FUNC_ENTER_NOAPI(FAIL)
-#ifdef QAK
-HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request);
-#endif /* QAK */
-
/* Check arguments. */
HDassert(fspace);
HDassert(fspace->nclasses);
@@ -1852,11 +1780,6 @@ HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request);
HDassert(node);
/* Check for any sections on free space list */
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count);
-HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count);
-HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_sect_count);
-#endif /* QAK */
if(fspace->tot_sect_count > 0) {
/* Get a pointer to the section info */
if(H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0)
@@ -1871,9 +1794,6 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se
if(ret_value > 0) {
/* Note that we've modified the section info */
sinfo_modified = TRUE;
-#ifdef QAK
-HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = %u\n", FUNC, (*node)->size, (*node)->addr, (*node)->type);
-#endif /* QAK */
} /* end if */
} /* end if */
@@ -1890,7 +1810,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5FS_iterate_sect_cb
+ * Function: H5FS__iterate_sect_cb
*
* Purpose: Skip list iterator callback to iterate over free space sections
* of a particular size
@@ -1903,13 +1823,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FS_iterate_sect_cb(void *_item, void H5_ATTR_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 */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect_info);
@@ -1922,11 +1842,11 @@ H5FS_iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FS_iterate_sect_cb() */
+} /* H5FS__iterate_sect_cb() */
/*-------------------------------------------------------------------------
- * Function: H5FS_iterate_node_cb
+ * Function: H5FS__iterate_node_cb
*
* Purpose: Skip list iterator callback to iterate over free space sections
* in a bin
@@ -1939,13 +1859,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FS_iterate_node_cb(void *_item, void H5_ATTR_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 */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(fspace_node);
@@ -1954,12 +1874,12 @@ H5FS_iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata)
/* Iterate through all the sections of this size */
HDassert(fspace_node->sect_list);
- if(H5SL_iterate(fspace_node->sect_list, H5FS_iterate_sect_cb, udata) < 0)
+ if(H5SL_iterate(fspace_node->sect_list, H5FS__iterate_sect_cb, udata) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FS_iterate_node_cb() */
+} /* H5FS__iterate_node_cb() */
/*-------------------------------------------------------------------------
@@ -1987,10 +1907,6 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data)
HDassert(fspace);
HDassert(op);
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count);
-#endif /* QAK */
-
/* Set up user data for iterator */
udata.fspace = fspace;
udata.op = op;
@@ -2006,14 +1922,11 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c
sinfo_valid = TRUE;
/* Iterate over all the bins */
-#ifdef QAK
-HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC);
-#endif /* QAK */
for(bin = 0; bin < fspace->sinfo->nbins; bin++) {
/* Check if there are any sections in this bin */
if(fspace->sinfo->bins[bin].bin_list) {
/* Iterate over list of section size nodes for bin */
- if(H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS_iterate_node_cb, &udata) < 0)
+ if(H5SL_iterate(fspace->sinfo->bins[bin].bin_list, H5FS__iterate_node_cb, &udata) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes")
} /* end if */
} /* end for */
@@ -2098,10 +2011,6 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect,
old_class = sect->type;
old_cls = &fspace->sect_cls[sect->type];
new_cls = &fspace->sect_cls[new_class];
-#ifdef QAK
-HDfprintf(stderr, "%s: old_cls->flags = %x\n", FUNC, old_cls->flags);
-HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags);
-#endif /* QAK */
/* Check if the section's class change will affect the # of serializable or ghost sections */
if((old_cls->flags & H5FS_CLS_GHOST_OBJ) != (new_cls->flags & H5FS_CLS_GHOST_OBJ)) {
@@ -2114,15 +2023,12 @@ HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags);
to_ghost = FALSE;
else
to_ghost = TRUE;
-#ifdef QAK
-HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost);
-#endif /* QAK */
/* Sanity check */
HDassert(fspace->sinfo->bins);
/* Determine correct bin which holds items of at least the section's size */
- bin = H5VM_log2_gen(sect->size);
+ bin = H5VM__log2_gen(sect->size);
HDassert(bin < fspace->sinfo->nbins);
HDassert(fspace->sinfo->bins[bin].bin_list);
@@ -2180,15 +2086,9 @@ HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost);
to_mergable = TRUE;
else
to_mergable = FALSE;
-#ifdef QAK
-HDfprintf(stderr, "%s: to_mergable = %u\n", FUNC, to_mergable);
-#endif /* QAK */
/* Add or remove section from merge list, as appropriate */
if(to_mergable) {
-#ifdef QAK
-HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, (unsigned)sect->type);
-#endif /* QAK */
if(fspace->sinfo->merge_list == NULL)
if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for merging free space sections")
@@ -2198,9 +2098,6 @@ HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUN
else {
H5FS_section_info_t *tmp_sect_node; /* Temporary section node */
-#ifdef QAK
-HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, (unsigned)sect->type);
-#endif /* QAK */
tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, &sect->addr);
if(tmp_sect_node == NULL || tmp_sect_node != sect)
HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list")
@@ -2246,9 +2143,6 @@ H5FS__sect_assert(const H5FS_t *fspace)
hsize_t separate_obj; /* The number of separate objects managed */
FUNC_ENTER_PACKAGE_NOERR
-#ifdef QAK
-HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fspace->tot_sect_count);
-#endif /* QAK */
/* Initialize state */
separate_obj = 0;
@@ -2305,9 +2199,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fsp
/* Get section node & it's class */
sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node);
cls = &fspace->sect_cls[sect->type];
-#ifdef QAK
-HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS__sect_assert", sect->size, sect->addr, sect->type);
-#endif /* QAK */
/* Sanity check section */
HDassert(H5F_addr_defined(sect->addr));
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index 74a170b..5ad7634 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -15,7 +15,7 @@
*
* Created: H5Faccum.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File metadata "accumulator" routines. (Used to
* cache small metadata I/Os and group them into a
@@ -105,7 +105,6 @@ H5FL_BLK_DEFINE_STATIC(meta_accum);
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -154,7 +153,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t new_alloc_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(new_size - 1)));
+ new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(new_size - 1)));
/* Reallocate the metadata accumulator buffer */
if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size)))
@@ -274,7 +273,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jun 11 2009
*
*-------------------------------------------------------------------------
@@ -298,7 +296,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file,
size_t new_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)((size + accum->size) - 1)));
+ new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)((size + accum->size) - 1)));
/* Check for accumulator getting too big */
if(new_size > H5F_ACCUM_MAX_SIZE) {
@@ -413,7 +411,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -612,7 +609,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t new_alloc_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_alloc_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1)));
+ new_alloc_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1)));
/* Reallocate the metadata accumulator buffer */
if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_alloc_size)))
@@ -656,7 +653,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t clear_size; /* Size of memory that needs clearing */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1)));
+ new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1)));
/* Grow the metadata accumulator buffer */
if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size)))
@@ -704,7 +701,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t new_size; /* New size of accumulator */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
- new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1)));
+ new_size = (size_t)1 << (1 + H5VM__log2_gen((uint64_t)(size - 1)));
/* Reallocate the metadata accumulator buffer */
if(NULL == (accum->buf = H5FL_BLK_REALLOC(meta_accum, accum->buf, new_size)))
@@ -841,7 +838,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -1007,7 +1003,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
@@ -1050,7 +1045,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Jan 10 2008
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c
index 26452b6..2b368d5 100644
--- a/src/H5Fcwfs.c
+++ b/src/H5Fcwfs.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Tuesday, July 19, 2011
*
* Purpose: Each file has a small cache of global heap collections called
diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c
index 535b43d..09f6829 100644
--- a/src/H5Fdbg.c
+++ b/src/H5Fdbg.c
@@ -11,7 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+/* Programmer: Quincey Koziol
* Wednesday, July 9, 2003
*
* Purpose: File object debugging functions.
@@ -39,7 +39,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 1 1997
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c
index a047161..76a0991 100644
--- a/src/H5Fdeprec.c
+++ b/src/H5Fdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Fdeprec.c
* October 1 2009
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Deprecated functions from the H5F interface. These
* functions are here for compatibility purposes and may be
diff --git a/src/H5Fefc.c b/src/H5Fefc.c
index 77d29f5..c9a3a00 100644
--- a/src/H5Fefc.c
+++ b/src/H5Fefc.c
@@ -15,7 +15,7 @@
*
* Created: H5Defc.c
* December 13, 2010
- * Neil Fortner <nfortne2@hdfgroup.org>
+ * Neil Fortner
*
* Purpose: External file caching routines - implements a
* cache of external files to minimize the number of
diff --git a/src/H5Ffake.c b/src/H5Ffake.c
index 67bd180..36fea5b 100644
--- a/src/H5Ffake.c
+++ b/src/H5Ffake.c
@@ -34,7 +34,6 @@
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 2, 2006
*
*-------------------------------------------------------------------------
@@ -79,7 +78,6 @@ done:
* Failure: negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Oct 2, 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 0bda894..f206199 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -1854,7 +1854,7 @@ H5F__post_open(H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F__flush() */
+} /* end H5F__post_open() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Fio.c b/src/H5Fio.c
index 34dd0d6..7a901aa 100644
--- a/src/H5Fio.c
+++ b/src/H5Fio.c
@@ -15,7 +15,7 @@
*
* Created: H5Fio.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File I/O routines.
*
@@ -86,7 +86,6 @@
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
@@ -130,7 +129,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
@@ -175,7 +173,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
@@ -220,7 +217,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 10 1997
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h
index 0481512..fb362fc 100644
--- a/src/H5Fmodule.h
+++ b/src/H5Fmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5Fmount.c b/src/H5Fmount.c
index 5e6b899..9d32fa5 100644
--- a/src/H5Fmount.c
+++ b/src/H5Fmount.c
@@ -627,7 +627,7 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs)
/*-------------------------------------------------------------------------
- * Function: H5F_flush_mounts_recurse
+ * Function: H5F__flush_mounts_recurse
*
* Purpose: Flush a mount hierarchy, recursively
*
@@ -639,20 +639,20 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs)
*-------------------------------------------------------------------------
*/
static herr_t
-H5F_flush_mounts_recurse(H5F_t *f)
+H5F__flush_mounts_recurse(H5F_t *f)
{
unsigned nerrors = 0; /* Errors from recursive flushes */
unsigned u; /* Index variable */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
/* Flush all child files, not stopping for errors */
for(u = 0; u < f->shared->mtab.nmounts; u++)
- if(H5F_flush_mounts_recurse(f->shared->mtab.child[u].file) < 0)
+ if(H5F__flush_mounts_recurse(f->shared->mtab.child[u].file) < 0)
nerrors++;
/* Call the "real" flush routine, for this file */
@@ -665,7 +665,7 @@ H5F_flush_mounts_recurse(H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5F_flush_mounts_recurse() */
+} /* end H5F__flush_mounts_recurse() */
/*-------------------------------------------------------------------------
@@ -695,7 +695,7 @@ H5F_flush_mounts(H5F_t *f)
f = f->parent;
/* Flush the mounted file hierarchy */
- if(H5F_flush_mounts_recurse(f) < 0)
+ if(H5F__flush_mounts_recurse(f) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy")
done:
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index 0c46f59..8189821 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -15,7 +15,7 @@
*
* Created: H5Fmpi.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: MPI-related routines.
*
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 46185ff..fe58fdb 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Programmer: Quincey Koziol
* Thursday, September 28, 2000
*
* Purpose: This file contains declarations which are visible only within
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index c5d4c89..1cfd103 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -116,16 +116,16 @@ typedef struct H5F_t H5F_t;
/* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */
/* (Assumes that the high bits of the integer are zero) */
# define UINT64ENCODE_VARLEN(p, n) { \
- uint64_t __n = (uint64_t)(n); \
- unsigned _s = H5VM_limit_enc_size(__n); \
- \
- *(p)++ = (uint8_t)_s; \
- UINT64ENCODE_VAR(p, __n, _s); \
+ uint64_t __n = (uint64_t)(n); \
+ unsigned _s = H5VM__limit_enc_size(__n); \
+ \
+ *(p)++ = (uint8_t)_s; \
+ UINT64ENCODE_VAR(p, __n, _s); \
}
# define H5_ENCODE_UNSIGNED(p, n) { \
- HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
- UINT32ENCODE(p, n) \
+ HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \
+ UINT32ENCODE(p, n) \
}
/* Assumes the endianness of uint64_t is the same as double */
diff --git a/src/H5Fquery.c b/src/H5Fquery.c
index e1b11c8..565f492 100644
--- a/src/H5Fquery.c
+++ b/src/H5Fquery.c
@@ -15,7 +15,7 @@
*
* Created: H5Fquery.c
* Jan 10 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File structure query routines.
*
@@ -763,7 +763,6 @@ H5F_sieve_buf_size(const H5F_t *f)
* Failure: (should not happen)
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Jul 8 2005
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fspace.c b/src/H5Fspace.c
index 6baf163..3d969f9 100644
--- a/src/H5Fspace.c
+++ b/src/H5Fspace.c
@@ -15,7 +15,7 @@
*
* Created: H5Fspace.c
* Dec 30 2013
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Space allocation routines for the file.
*
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 4af9256..da4e013 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -317,7 +317,6 @@ done:
* Failure: FAIL
*
* Programmer: Bill Wendling
- * wendling@ncsa.uiuc.edu
* Sept 12, 2003
*
*-------------------------------------------------------------------------
@@ -895,8 +894,13 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read)
HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension")
}
else {
- if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0)
+ if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) {
+#if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */
+ f->shared->sblock = NULL;
+#endif /* JRM */
+
HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension")
+ }
if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0)
HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension")
@@ -1060,7 +1064,6 @@ done:
* Failure: FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sept 15, 2003
*
*-------------------------------------------------------------------------
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index 119548c..329bf21 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -15,7 +15,7 @@
*
* Created: H5Fsuper_cache.c
* Aug 15 2009
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement file superblock & driver info metadata cache methods.
*
@@ -309,7 +309,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 17, 2013
*
*-------------------------------------------------------------------------
@@ -338,7 +337,6 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* November 17, 2016
*
*-------------------------------------------------------------------------
@@ -428,7 +426,6 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 18 2013
*
*-------------------------------------------------------------------------
@@ -621,7 +618,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 19, 2013
*
*-------------------------------------------------------------------------
@@ -654,7 +650,6 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 19 2013
*
*-------------------------------------------------------------------------
@@ -798,7 +793,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
@@ -833,7 +827,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
@@ -861,7 +854,6 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@lbl.gov
* November 17, 2016
*
*-------------------------------------------------------------------------
@@ -905,7 +897,6 @@ done:
* Failure: NULL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20 2013
*
*-------------------------------------------------------------------------
@@ -966,7 +957,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
@@ -1000,7 +990,6 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20 2013
*
*-------------------------------------------------------------------------
@@ -1064,7 +1053,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* July 20, 2013
*
*-------------------------------------------------------------------------
diff --git a/src/H5Ftest.c b/src/H5Ftest.c
index 49a2a22..97c7e3e 100644
--- a/src/H5Ftest.c
+++ b/src/H5Ftest.c
@@ -15,7 +15,7 @@
*
* Created: H5Ftest.c
* Jan 3 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: File testing routines.
*
diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c
index 71e0b2d..918e18c 100644
--- a/src/H5Gbtree2.c
+++ b/src/H5Gbtree2.c
@@ -15,7 +15,7 @@
*
* Created: H5Gbtree2.c
* Sep 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: v2 B-tree callbacks for indexing fields on links
*
@@ -75,27 +75,27 @@ typedef struct H5G_fh_ud_cmp_t {
/* v2 B-tree function callbacks */
/* v2 B-tree driver callbacks for 'creation order' index */
-static herr_t H5G_dense_btree2_corder_store(void *native, const void *udata);
-static herr_t H5G_dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result);
-static herr_t H5G_dense_btree2_corder_encode(uint8_t *raw, const void *native,
+static herr_t H5G__dense_btree2_corder_store(void *native, const void *udata);
+static herr_t H5G__dense_btree2_corder_compare(const void *rec1, const void *rec2, int *result);
+static herr_t H5G__dense_btree2_corder_encode(uint8_t *raw, const void *native,
void *ctx);
-static herr_t H5G_dense_btree2_corder_decode(const uint8_t *raw, void *native,
+static herr_t H5G__dense_btree2_corder_decode(const uint8_t *raw, void *native,
void *ctx);
-static herr_t H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth,
+static herr_t H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth,
const void *record, const void *_udata);
/* v2 B-tree driver callbacks for 'name' index */
-static herr_t H5G_dense_btree2_name_store(void *native, const void *udata);
+static herr_t H5G__dense_btree2_name_store(void *native, const void *udata);
static herr_t H5G__dense_btree2_name_compare(const void *rec1, const void *rec2, int *result);
-static herr_t H5G_dense_btree2_name_encode(uint8_t *raw, const void *native,
+static herr_t H5G__dense_btree2_name_encode(uint8_t *raw, const void *native,
void *ctx);
-static herr_t H5G_dense_btree2_name_decode(const uint8_t *raw, void *native,
+static herr_t H5G__dense_btree2_name_decode(const uint8_t *raw, void *native,
void *ctx);
-static herr_t H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth,
+static herr_t H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth,
const void *record, const void *_udata);
/* Fractal heap function callbacks */
-static herr_t H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data);
+static herr_t H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *op_data);
/*********************/
@@ -108,11 +108,11 @@ const H5B2_class_t H5G_BT2_NAME[1]={{ /* B-tree class information */
sizeof(H5G_dense_bt2_name_rec_t), /* Size of native record */
NULL, /* Create client callback context */
NULL, /* Destroy client callback context */
- H5G_dense_btree2_name_store, /* Record storage callback */
- H5G__dense_btree2_name_compare, /* Record comparison callback */
- H5G_dense_btree2_name_encode, /* Record encoding callback */
- H5G_dense_btree2_name_decode, /* Record decoding callback */
- H5G_dense_btree2_name_debug /* Record debugging callback */
+ H5G__dense_btree2_name_store, /* Record storage callback */
+ H5G__dense_btree2_name_compare, /* Record comparison callback */
+ H5G__dense_btree2_name_encode, /* Record encoding callback */
+ H5G__dense_btree2_name_decode, /* Record decoding callback */
+ H5G__dense_btree2_name_debug /* Record debugging callback */
}};
/* v2 B-tree class for indexing 'creation order' field of links */
@@ -122,11 +122,11 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */
sizeof(H5G_dense_bt2_corder_rec_t), /* Size of native record */
NULL, /* Create client callback context */
NULL, /* Destroy client callback context */
- H5G_dense_btree2_corder_store, /* Record storage callback */
- H5G_dense_btree2_corder_compare, /* Record comparison callback */
- H5G_dense_btree2_corder_encode, /* Record encoding callback */
- H5G_dense_btree2_corder_decode, /* Record decoding callback */
- H5G_dense_btree2_corder_debug /* Record debugging callback */
+ H5G__dense_btree2_corder_store, /* Record storage callback */
+ H5G__dense_btree2_corder_compare, /* Record comparison callback */
+ H5G__dense_btree2_corder_encode, /* Record encoding callback */
+ H5G__dense_btree2_corder_decode, /* Record decoding callback */
+ H5G__dense_btree2_corder_debug /* Record debugging callback */
}};
/*****************************/
@@ -141,7 +141,7 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_fh_name_cmp
+ * Function: H5G__dense_fh_name_cmp
*
* Purpose: Compares the name of a link in a fractal heap to another
* name
@@ -149,19 +149,18 @@ const H5B2_class_t H5G_BT2_CORDER[1]={{ /* B-tree class information */
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_cmp_t *udata = (H5G_fh_ud_cmp_t *)_udata; /* User data for 'op' callback */
H5O_link_t *lnk; /* Pointer to link created from heap object */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
@@ -181,11 +180,11 @@ H5G_dense_fh_name_cmp(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_fh_name_cmp() */
+} /* end H5G__dense_fh_name_cmp() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_store
+ * Function: H5G__dense_btree2_name_store
*
* Purpose: Store user information into native record for v2 B-tree
*
@@ -198,19 +197,19 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_store(void *_nrecord, const void *_udata)
+H5G__dense_btree2_name_store(void *_nrecord, const void *_udata)
{
const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata;
H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Copy user information info native record */
nrecord->hash = udata->common.name_hash;
H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_store() */
+} /* H5G__dense_btree2_name_store() */
/*-------------------------------------------------------------------------
@@ -240,16 +239,6 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int
HDassert(bt2_udata);
HDassert(bt2_rec);
-#ifdef QAK
-{
-unsigned u;
-
-HDfprintf(stderr, "%s: bt2_udata = {'%s', %x}\n", "H5G__dense_btree2_name_compare", bt2_udata->name, (unsigned)bt2_udata->name_hash);
-HDfprintf(stderr, "%s: bt2_rec = {%x, ", "H5G__dense_btree2_name_compare", (unsigned)bt2_rec->hash);
-for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
- HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
-}
-#endif /* QAK */
/* Check hash value */
if(bt2_udata->name_hash < bt2_rec->hash)
*result = (-1);
@@ -272,7 +261,7 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
fh_udata.cmp = 0;
/* Check if the user's link and the B-tree's link have the same name */
- if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G_dense_fh_name_cmp, &fh_udata) < 0)
+ if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G__dense_fh_name_cmp, &fh_udata) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records")
/* Callback will set comparison value */
@@ -285,7 +274,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_encode
+ * Function: H5G__dense_btree2_name_encode
*
* Purpose: Encode native information into raw form for storing on disk
*
@@ -298,22 +287,22 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Encode the record's fields */
UINT32ENCODE(raw, nrecord->hash)
H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_encode() */
+} /* H5G__dense_btree2_name_encode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_decode
+ * Function: H5G__dense_btree2_name_decode
*
* Purpose: Decode raw disk form of record into native form
*
@@ -326,22 +315,22 @@ H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Decode the record's fields */
UINT32DECODE(raw, nrecord->hash)
H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_decode() */
+} /* H5G__dense_btree2_name_decode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_name_debug
+ * Function: H5G__dense_btree2_name_debug
*
* Purpose: Debug native form of record
*
@@ -354,13 +343,13 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth,
+H5G__dense_btree2_name_debug(FILE *stream, int indent, int fwidth,
const void *_nrecord, const void H5_ATTR_UNUSED *_udata)
{
const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord;
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDfprintf(stream, "%*s%-*s {%x, ", indent, "", fwidth, "Record:",
(unsigned)nrecord->hash);
@@ -368,11 +357,11 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth,
HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_name_debug() */
+} /* H5G__dense_btree2_name_debug() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_store
+ * Function: H5G__dense_btree2_corder_store
*
* Purpose: Store user information into native record for v2 B-tree
*
@@ -385,23 +374,23 @@ H5G_dense_btree2_name_debug(FILE *stream, int indent, int fwidth,
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata)
+H5G__dense_btree2_corder_store(void *_nrecord, const void *_udata)
{
const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata;
H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Copy user information info native record */
nrecord->corder = udata->common.corder;
H5MM_memcpy(nrecord->id, udata->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_store() */
+} /* H5G__dense_btree2_corder_store() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_compare
+ * Function: H5G__dense_btree2_corder_compare
*
* Purpose: Compare two native information records, according to some key
*
@@ -415,27 +404,17 @@ H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result)
+H5G__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, int *result)
{
const H5G_bt2_ud_common_t *bt2_udata = (const H5G_bt2_ud_common_t *)_bt2_udata;
const H5G_dense_bt2_corder_rec_t *bt2_rec = (const H5G_dense_bt2_corder_rec_t *)_bt2_rec;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Sanity check */
HDassert(bt2_udata);
HDassert(bt2_rec);
-#ifdef QAK
-{
-unsigned u;
-
-HDfprintf(stderr, "%s: bt2_udata->corder = %Hd\n", "H5G_dense_btree2_corder_compare", (hsize_t)bt2_udata->corder);
-HDfprintf(stderr, "%s: bt2_rec = {%Hu, ", "H5G_dense_btree2_corder_compare", (hsize_t)bt2_rec->corder);
-for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
- HDfprintf(stderr, "%02x%s", bt2_rec->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
-}
-#endif /* QAK */
/* Check creation order value */
if(bt2_udata->corder < bt2_rec->corder)
*result = -1;
@@ -445,11 +424,11 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
*result = 0;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_compare() */
+} /* H5G__dense_btree2_corder_compare() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_encode
+ * Function: H5G__dense_btree2_corder_encode
*
* Purpose: Encode native information into raw form for storing on disk
*
@@ -462,22 +441,22 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Encode the record's fields */
INT64ENCODE(raw, nrecord->corder)
H5MM_memcpy(raw, nrecord->id, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_encode() */
+} /* H5G__dense_btree2_corder_encode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_decode
+ * Function: H5G__dense_btree2_corder_decode
*
* Purpose: Decode raw disk form of record into native form
*
@@ -490,22 +469,22 @@ H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void H5_ATTR_
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
+H5G__dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_UNUSED *ctx)
{
H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Decode the record's fields */
INT64DECODE(raw, nrecord->corder)
H5MM_memcpy(nrecord->id, raw, (size_t)H5G_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_decode() */
+} /* H5G__dense_btree2_corder_decode() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_btree2_corder_debug
+ * Function: H5G__dense_btree2_corder_debug
*
* Purpose: Debug native form of record
*
@@ -518,13 +497,13 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void H5_ATTR_
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth,
+H5G__dense_btree2_corder_debug(FILE *stream, int indent, int fwidth,
const void *_nrecord, const void H5_ATTR_UNUSED *_udata)
{
const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord;
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
HDfprintf(stream, "%*s%-*s {%llu, ", indent, "", fwidth, "Record:",
(unsigned long long)nrecord->corder);
@@ -532,5 +511,5 @@ H5G_dense_btree2_corder_debug(FILE *stream, int indent, int fwidth,
HDfprintf(stderr, "%02x%s", nrecord->id[u], (u < (H5G_DENSE_FHEAP_ID_LEN - 1) ? " " : "}\n"));
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5G_dense_btree2_corder_debug() */
+} /* H5G__dense_btree2_corder_debug() */
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index 13a33a3..22b0488 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -15,7 +15,7 @@
*
* Created: H5Gcache.c
* Feb 5 2008
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Implement group metadata cache methods.
*
diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c
index 1a76012..d14ec20 100644
--- a/src/H5Gcompact.c
+++ b/src/H5Gcompact.c
@@ -15,7 +15,7 @@
*
* Created: H5Gcompact.c
* Sep 5 2005
- * Quincey Koziol <koziol@ncsa.uiuc.edu>
+ * Quincey Koziol
*
* Purpose: Functions for handling compact storage.
*
@@ -75,7 +75,6 @@ static herr_t H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
@@ -178,7 +177,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 6 2005
*
*-------------------------------------------------------------------------
@@ -257,7 +255,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_compact_remove_common_cb
+ * Function: H5G__compact_remove_common_cb
*
* Purpose: Common callback routine for deleting 'link' message for a
* particular name.
@@ -265,19 +263,18 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata)
+H5G__compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_udata)
{
const H5O_link_t *lnk = (const H5O_link_t *)_mesg; /* Pointer to link */
H5G_iter_rm_t *udata = (H5G_iter_rm_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(lnk);
@@ -295,7 +292,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, voi
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_compact_remove_common_cb() */
+} /* end H5G__compact_remove_common_cb() */
/*-------------------------------------------------------------------------
@@ -328,7 +325,7 @@ H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r,
udata.name = name;
/* Iterate over the link messages to delete the right one */
- if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0)
+ if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message")
done:
@@ -376,7 +373,7 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo,
udata.name = ltable.lnks[n].name;
/* Iterate over the link messages to delete the right one */
- if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0)
+ if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G__compact_remove_common_cb, &udata, TRUE) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message")
done:
@@ -441,7 +438,6 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -487,7 +483,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -533,7 +528,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gdense.c b/src/H5Gdense.c
index a2ef55c..8545d73 100644
--- a/src/H5Gdense.c
+++ b/src/H5Gdense.c
@@ -15,7 +15,7 @@
*
* Created: H5Gdense.c
* Sep 9 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Routines for operating on "dense" link storage for a
* group in a file.
@@ -250,7 +250,6 @@ typedef struct {
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 9 2006
*
*-------------------------------------------------------------------------
@@ -294,17 +293,11 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline)
/* Retrieve the heap's address in the file */
if(H5HF_get_heap_addr(fheap, &(linfo->fheap_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get fractal heap address")
-#ifdef QAK
-HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr);
-#endif /* QAK */
/* Retrieve the heap's ID length in the file */
if(H5HF_get_id_len(fheap, &fheap_id_len) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length")
HDassert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN);
-#ifdef QAK
-HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
-#endif /* QAK */
/* Create the name index v2 B-tree */
HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam));
@@ -321,9 +314,6 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len);
/* Retrieve the v2 B-tree's address in the file */
if(H5B2_get_addr(bt2_name, &(linfo->name_bt2_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for name index")
-#ifdef QAK
-HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr);
-#endif /* QAK */
/* Check if we should create a creation order index v2 B-tree */
if(linfo->index_corder) {
@@ -342,9 +332,6 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr)
/* Retrieve the v2 B-tree's address in the file */
if(H5B2_get_addr(bt2_corder, &(linfo->corder_bt2_addr)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get v2 B-tree address for creation order index")
-#ifdef QAK
-HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_addr);
-#endif /* QAK */
} /* end if */
done:
@@ -368,7 +355,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -394,17 +380,10 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk)
HDassert(f);
HDassert(linfo);
HDassert(lnk);
-#ifdef QAK
-HDfprintf(stderr, "%s: linfo->fheap_addr = %a\n", FUNC, linfo->fheap_addr);
-HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr);
-#endif /* QAK */
/* Find out the size of buffer needed for serialized link */
if((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size")
-#ifdef QAK
-HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDstrlen(lnk->name), link_size);
-#endif /* QAK */
/* Wrap the local buffer for serialized link */
if(NULL == (wb = H5WB_wrap(link_buf, sizeof(link_buf))))
@@ -472,26 +451,25 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_lookup_cb
+ * Function: H5G__dense_lookup_cb
*
* Purpose: Callback when a link is located in an index
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk)
+H5G__dense_lookup_cb(const void *_lnk, void *_user_lnk)
{
const H5O_link_t *lnk = (const H5O_link_t *)_lnk; /* Record from B-tree */
H5O_link_t *user_lnk = (H5O_link_t *)_user_lnk; /* User data from v2 B-tree link lookup */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -505,7 +483,7 @@ H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_lookup_cb() */
+} /* end H5G__dense_lookup_cb() */
/*-------------------------------------------------------------------------
@@ -516,7 +494,6 @@ done:
* Return: Non-negative (TRUE/FALSE) on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
@@ -553,7 +530,7 @@ H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name,
udata.fheap = fheap;
udata.name = name;
udata.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0);
- udata.found_op = H5G_dense_lookup_cb; /* v2 B-tree comparison callback */
+ udata.found_op = H5G__dense_lookup_cb; /* v2 B-tree comparison callback */
udata.found_op_data = lnk;
/* Find & copy the named link in the 'name' index */
@@ -572,7 +549,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_lookup_by_idx_fh_cb
+ * Function: H5G__dense_lookup_by_idx_fh_cb
*
* Purpose: Callback for fractal heap operator, to make copy of link when
* when lookup up a link by index
@@ -580,19 +557,18 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_lookup_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_lbi_t *udata = (H5G_fh_ud_lbi_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t *tmp_lnk = NULL; /* Temporary pointer to link */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information & keep a copy */
if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
@@ -608,31 +584,30 @@ done:
H5O_msg_free(H5O_LINK_ID, tmp_lnk);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_lookup_by_idx_fh_cb() */
+} /* end H5G__dense_lookup_by_idx_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_lookup_by_idx_bt2_cb
+ * Function: H5G__dense_lookup_by_idx_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage lookup by index
*
* Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_lbi_t *bt2_udata = (H5G_bt2_ud_lbi_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_lbi_t fh_udata; /* User data for fractal heap 'op' callback */
int ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Prepare user data for callback */
/* down */
@@ -640,12 +615,12 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.lnk = bt2_udata->lnk;
/* Call fractal heap 'op' routine, to copy the link information */
- if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0)
+ if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_lookup_by_idx_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "link found callback failed")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_lookup_by_idx_bt2_cb() */
+} /* end H5G__dense_lookup_by_idx_bt2_cb() */
/*-------------------------------------------------------------------------
@@ -657,7 +632,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 7 2006
*
*-------------------------------------------------------------------------
@@ -727,7 +701,7 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo,
udata.lnk = lnk;
/* Find & copy the link in the appropriate index */
- if(H5B2_index(bt2, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0)
+ if(H5B2_index(bt2, order, n, H5G__dense_lookup_by_idx_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index")
} /* end if */
else { /* Otherwise, we need to build a table of the links and sort it */
@@ -758,7 +732,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_build_table_cb
+ * Function: H5G__dense_build_table_cb
*
* Purpose: Callback routine for building table of links from dense
* link storage.
@@ -767,18 +741,17 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sept 25 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata)
+H5G__dense_build_table_cb(const H5O_link_t *lnk, void *_udata)
{
H5G_dense_bt_ud_t *udata = (H5G_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(lnk);
@@ -794,7 +767,7 @@ H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_build_table_cb() */
+} /* end H5G__dense_build_table_cb() */
/*-------------------------------------------------------------------------
@@ -843,7 +816,7 @@ H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
udata.curr_lnk = 0;
/* Iterate over the links in the group, building a table of the link messages */
- if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0)
+ if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G__dense_build_table_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links")
/* Sort link table in correct iteration order */
@@ -859,7 +832,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_iterate_fh_cb
+ * Function: H5G__dense_iterate_fh_cb
*
* Purpose: Callback for fractal heap operator, to make user's callback
* when iterating over links
@@ -867,18 +840,17 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information & keep a copy */
/* (we make a copy instead of calling the user/library callback directly in
@@ -892,30 +864,29 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_iterate_fh_cb() */
+} /* end H5G__dense_iterate_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_iterate_bt2_cb
+ * Function: H5G__dense_iterate_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage iterator
*
* Return: H5_ITER_ERROR/H5_ITER_CONT/H5_ITER_STOP
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_it_t *bt2_udata = (H5G_bt2_ud_it_t *)_bt2_udata; /* User data for callback */
herr_t ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check for skipping links */
if(bt2_udata->skip > 0)
@@ -928,7 +899,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.f = bt2_udata->f;
/* Call fractal heap 'op' routine, to copy the link information */
- if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_iterate_fh_cb, &fh_udata) < 0)
+ if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_iterate_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed")
/* Make the callback */
@@ -948,7 +919,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_iterate_bt2_cb() */
+} /* end H5G__dense_iterate_bt2_cb() */
/*-------------------------------------------------------------------------
@@ -959,14 +930,14 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 11 2006
*
*-------------------------------------------------------------------------
*/
herr_t
H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data)
+ H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op,
+ void *op_data)
{
H5HF_t *fheap = NULL; /* Fractal heap handle */
H5G_link_table_t ltable = {0, NULL}; /* Table of links */
@@ -1036,7 +1007,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type,
/* Iterate over the records in the v2 B-tree's "native" order */
/* (by hash of name) */
- if((ret_value = H5B2_iterate(bt2, H5G_dense_iterate_bt2_cb, &udata)) < 0)
+ if((ret_value = H5B2_iterate(bt2, H5G__dense_iterate_bt2_cb, &udata)) < 0)
HERROR(H5E_SYM, H5E_BADITER, "link iteration failed");
/* Update the last link examined, if requested */
@@ -1067,7 +1038,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_get_name_by_idx_fh_cb
+ * Function: H5G__dense_get_name_by_idx_fh_cb
*
* Purpose: Callback for fractal heap operator, to retrieve name according
* to an index
@@ -1075,19 +1046,18 @@ done:
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_gnbi_t *udata = (H5G_fh_ud_gnbi_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t *lnk; /* Pointer to link created from heap object */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
@@ -1108,31 +1078,30 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_get_name_by_idx_fh_cb() */
+} /* end H5G__dense_get_name_by_idx_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_get_name_by_idx_bt2_cb
+ * Function: H5G__dense_get_name_by_idx_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage 'get name by idx' call
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_gnbi_t *bt2_udata = (H5G_bt2_ud_gnbi_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_gnbi_t fh_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Prepare user data for callback */
/* down */
@@ -1141,7 +1110,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.name_size = bt2_udata->name_size;
/* Call fractal heap 'op' routine, to perform user callback */
- if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0)
+ if(H5HF_op(bt2_udata->fheap, record->id, H5G__dense_get_name_by_idx_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link found callback failed")
/* Set the name's full length to return */
@@ -1149,7 +1118,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_get_name_by_idx_bt2_cb() */
+} /* end H5G__dense_get_name_by_idx_bt2_cb() */
/*-------------------------------------------------------------------------
@@ -1161,7 +1130,6 @@ done:
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 19 2006
*
*-------------------------------------------------------------------------
@@ -1231,7 +1199,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type,
udata.name_size = size;
/* Retrieve the name according to the v2 B-tree's index order */
- if(H5B2_index(bt2, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0)
+ if(H5B2_index(bt2, order, n, H5G__dense_get_name_by_idx_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree")
/* Set return value */
@@ -1271,27 +1239,26 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_fh_cb
+ * Function: H5G__dense_remove_fh_cb
*
* Purpose: Callback for fractal heap operator when removing links
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_rm_t *udata = (H5G_fh_ud_rm_t *)_udata; /* User data for fractal heap 'op' callback */
H5O_link_t *lnk = NULL; /* Pointer to link created from heap object */
H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
@@ -1332,31 +1299,30 @@ done:
H5O_msg_free(H5O_LINK_ID, lnk);
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_fh_cb() */
+} /* end H5G__dense_remove_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_bt2_cb
+ * Function: H5G__dense_remove_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage record removal
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
{
const H5G_dense_bt2_name_rec_t *record = (const H5G_dense_bt2_name_rec_t *)_record;
H5G_bt2_ud_rm_t *bt2_udata = (H5G_bt2_ud_rm_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_rm_t fh_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Set up the user data for fractal heap 'op' callback */
fh_udata.f = bt2_udata->common.f;
@@ -1365,7 +1331,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.replace_names = bt2_udata->replace_names;
/* Call fractal heap 'op' routine, to perform user callback */
- if(H5HF_op(bt2_udata->common.fheap, record->id, H5G_dense_remove_fh_cb, &fh_udata) < 0)
+ if(H5HF_op(bt2_udata->common.fheap, record->id, H5G__dense_remove_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed")
/* Remove record from fractal heap, if requested */
@@ -1375,7 +1341,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_bt2_cb() */
+} /* end H5G__dense_remove_bt2_cb() */
/*-------------------------------------------------------------------------
@@ -1386,7 +1352,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1430,7 +1395,7 @@ H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_
udata.replace_names = TRUE;
/* Remove the record from the name index v2 B-tree */
- if(H5B2_remove(bt2, &udata, H5G_dense_remove_bt2_cb, &udata) < 0)
+ if(H5B2_remove(bt2, &udata, H5G__dense_remove_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree")
done:
@@ -1445,25 +1410,24 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_by_idx_fh_cb
+ * Function: H5G__dense_remove_by_idx_fh_cb
*
* Purpose: Callback for fractal heap operator when removing links by index
*
* Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 15 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
+H5G__dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
{
H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Decode link information */
if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, obj_len, (const unsigned char *)obj)))
@@ -1473,24 +1437,23 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t obj_len, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_by_idx_fh_cb() */
+} /* end H5G__dense_remove_by_idx_fh_cb() */
/*-------------------------------------------------------------------------
- * Function: H5G_dense_remove_by_idx_bt2_cb
+ * Function: H5G__dense_remove_by_idx_bt2_cb
*
* Purpose: v2 B-tree callback for dense link storage record removal by index
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 15 2006
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
+H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
{
H5G_bt2_ud_rmbi_t *bt2_udata = (H5G_bt2_ud_rmbi_t *)_bt2_udata; /* User data for callback */
H5G_fh_ud_rmbi_t fh_udata; /* User data for fractal heap 'op' callback */
@@ -1498,7 +1461,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
const uint8_t *heap_id; /* Heap ID for link */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Determine the index being used */
if(bt2_udata->idx_type == H5_INDEX_NAME) {
@@ -1521,7 +1484,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata)
fh_udata.lnk = NULL;
/* Call fractal heap 'op' routine, to perform user callback */
- if(H5HF_op(bt2_udata->fheap, heap_id, H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0)
+ if(H5HF_op(bt2_udata->fheap, heap_id, H5G__dense_remove_by_idx_fh_cb, &fh_udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed")
HDassert(fh_udata.lnk);
@@ -1579,7 +1542,7 @@ done:
HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for 'other' index")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_dense_remove_by_idx_bt2_cb() */
+} /* end H5G__dense_remove_by_idx_bt2_cb() */
/*-------------------------------------------------------------------------
@@ -1591,7 +1554,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 14 2006
*
*-------------------------------------------------------------------------
@@ -1662,7 +1624,7 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful
udata.grp_full_path_r = grp_full_path_r;
/* Remove the record from the name index v2 B-tree */
- if(H5B2_remove_by_idx(bt2, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0)
+ if(H5B2_remove_by_idx(bt2, order, n, H5G__dense_remove_by_idx_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree")
} /* end if */
else { /* Otherwise, we need to build a table of the links and sort it */
@@ -1700,7 +1662,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 12 2006
*
*-------------------------------------------------------------------------
@@ -1743,7 +1704,7 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link)
udata.replace_names = FALSE;
/* Delete the name index, adjusting the ref. count on links removed */
- if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0)
+ if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G__dense_remove_bt2_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index")
/* Close the fractal heap */
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index 126456b..1d85eb7 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -15,7 +15,7 @@
*
* Created: H5Gdeprec.c
* June 21 2006
- * James Laird <jlaird@ncsa.uiuc.edu>
+ * James Laird
*
* Purpose: Deprecated functions from the H5G interface. These
* functions are here for compatibility purposes and may be
@@ -986,7 +986,7 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, c
H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_STATIC;
+ FUNC_ENTER_STATIC
/* Check if the name in this group resolved to a valid link */
if(lnk == NULL && obj_loc == NULL)
@@ -1082,7 +1082,7 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link,
HDassert(name && *name);
/* Reset stat buffer */
- if (statbuf)
+ if(statbuf)
HDmemset(statbuf, 0, sizeof(H5G_stat_t));
/* Set up user data for retrieving information */
@@ -1091,11 +1091,11 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link,
udata.loc_file = loc->oloc->file;
/* Traverse the group hierarchy to locate the object to get info about */
- if (H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : (H5G_TARGET_SLINK | H5G_TARGET_UDLINK)), H5G__get_objinfo_cb, &udata) < 0)
+ if(H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : (H5G_TARGET_SLINK | H5G_TARGET_UDLINK)), H5G__get_objinfo_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist");
/* If we're pointing at a soft or UD link, get the real link length and type */
- if (statbuf && follow_link == 0) {
+ if(statbuf && follow_link == 0) {
H5L_info2_t linfo; /* Link information buffer */
herr_t ret;
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 19aef10..632ffa0 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -12,7 +12,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Programmer: Robb Matzke
* Friday, September 19, 1997
*/
@@ -86,7 +86,6 @@ H5FL_BLK_EXTERN(str_buf);
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -128,7 +127,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -194,7 +192,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -234,7 +231,6 @@ done:
* Failure: Negative
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Jul 18 1997
*
*-------------------------------------------------------------------------
@@ -306,7 +302,6 @@ done:
* Failure: Negative
*
* Programmer: Pedro Vicente
- * pvn@ncsa.uiuc.edu
* ???day, August ??, 2002
*
* Notes: 'depth' parameter determines how much of the group entry
@@ -385,7 +380,6 @@ H5G__ent_reset(H5G_entry_t *ent)
* Failure: Negative
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 20 2005
*
*-------------------------------------------------------------------------
@@ -530,7 +524,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 29 1997
*
*-------------------------------------------------------------------------
diff --git a/src/H5Gint.c b/src/H5Gint.c
index 0f9f9cb..c3c8719 100644
--- a/src/H5Gint.c
+++ b/src/H5Gint.c
@@ -15,7 +15,7 @@
*
* Created: H5Gint.c
* April 5 2007
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: General use, "internal" routines for groups.
*
@@ -88,6 +88,7 @@ typedef struct {
/********************/
static herr_t H5G__open_oid(H5G_t *grp);
+static herr_t H5G__visit_cb(const H5O_link_t *lnk, void *_udata);
/*********************/
@@ -179,7 +180,6 @@ done:
* Failure: NULL
*
* Programmer: Robb Matzke
- * matzke@llnl.gov
* Aug 11 1997
*
*-------------------------------------------------------------------------
@@ -719,7 +719,7 @@ H5G_unmount(H5G_t *grp)
/*-------------------------------------------------------------------------
- * Function: H5G_iterate_cb
+ * Function: H5G__iterate_cb
*
* Purpose: Callback function for iterating over links in a group
*
@@ -732,12 +732,12 @@ H5G_unmount(H5G_t *grp)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_iterate_cb(const H5O_link_t *lnk, void *_udata)
+H5G__iterate_cb(const H5O_link_t *lnk, void *_udata)
{
H5G_iter_appcall_ud_t *udata = (H5G_iter_appcall_ud_t *)_udata; /* User data for callback */
herr_t ret_value = H5_ITER_ERROR; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(lnk);
@@ -770,7 +770,7 @@ H5G_iterate_cb(const H5O_link_t *lnk, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_iterate_cb() */
+} /* end H5G__iterate_cb() */
/*-------------------------------------------------------------------------
@@ -818,7 +818,7 @@ H5G_iterate(H5G_loc_t *loc, const char *group_name,
udata.op_data = op_data;
/* Call the real group iteration routine */
- if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata)) < 0)
+ if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G__iterate_cb, &udata)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "error iterating over links")
done:
@@ -835,7 +835,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_free_visit_visited
+ * Function: H5G__free_visit_visited
*
* Purpose: Free the key for an object visited during a group traversal
*
@@ -847,18 +847,18 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/)
+H5G__free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
item = H5FL_FREE(H5_obj_t, item);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5G_free_visit_visited() */
+} /* end H5G__free_visit_visited() */
/*-------------------------------------------------------------------------
- * Function: H5G_visit_cb
+ * Function: H5G__visit_cb
*
* Purpose: Callback function for recursively visiting links from a group
*
@@ -871,7 +871,7 @@ H5G_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_visit_cb(const H5O_link_t *lnk, void *_udata)
+H5G__visit_cb(const H5O_link_t *lnk, void *_udata)
{
H5G_iter_visit_ud_t *udata = (H5G_iter_visit_ud_t *)_udata; /* User data for callback */
H5L_info2_t info; /* Link info */
@@ -884,7 +884,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata)
size_t len_needed; /* Length of path string needed */
herr_t ret_value = H5_ITER_CONT; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(lnk);
@@ -998,7 +998,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata)
udata->curr_loc = &obj_loc;
/* Iterate over links in group */
- ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata);
+ ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G__visit_cb, udata);
/* Restore location */
udata->curr_loc = old_loc;
@@ -1016,7 +1016,7 @@ done:
HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_visit_cb() */
+} /* end H5G__visit_cb() */
/*-------------------------------------------------------------------------
@@ -1140,14 +1140,14 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
} /* end if */
/* Call the link iteration routine */
- if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata)) < 0)
+ if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G__visit_cb, &udata)) < 0)
HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't visit links")
done:
/* Release user data resources */
H5MM_xfree(udata.path);
if(udata.visited)
- H5SL_destroy(udata.visited, H5G_free_visit_visited, NULL);
+ H5SL_destroy(udata.visited, H5G__free_visit_visited, NULL);
/* Release the group opened */
if(gid != H5I_INVALID_HID) {
diff --git a/src/H5Glink.c b/src/H5Glink.c
index cbe5307..8b8377a 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -63,10 +63,10 @@
/* Local Prototypes */
/********************/
-static int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2);
-static int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2);
-static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2);
-static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2);
+static int H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2);
/*********************/
@@ -86,7 +86,7 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_name_inc
+ * Function: H5G__link_cmp_name_inc
*
* Purpose: Callback routine for comparing two link names, in
* increasing alphabetic order
@@ -103,16 +103,16 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2)
+H5G__link_cmp_name_inc(const void *lnk1, const void *lnk2)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk1)->name, ((const H5O_link_t *)lnk2)->name))
-} /* end H5G_link_cmp_name_inc() */
+} /* end H5G__link_cmp_name_inc() */
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_name_dec
+ * Function: H5G__link_cmp_name_dec
*
* Purpose: Callback routine for comparing two link names, in
* decreasing alphabetic order
@@ -129,16 +129,16 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2)
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2)
+H5G__link_cmp_name_dec(const void *lnk1, const void *lnk2)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk2)->name, ((const H5O_link_t *)lnk1)->name))
-} /* end H5G_link_cmp_name_dec() */
+} /* end H5G__link_cmp_name_dec() */
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_corder_inc
+ * Function: H5G__link_cmp_corder_inc
*
* Purpose: Callback routine for comparing two link creation orders, in
* increasing order
@@ -154,11 +154,11 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2)
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
+H5G__link_cmp_corder_inc(const void *lnk1, const void *lnk2)
{
int ret_value = -1; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder)
ret_value = -1;
@@ -168,11 +168,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
ret_value = 0;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_link_cmp_corder_inc() */
+} /* end H5G__link_cmp_corder_inc() */
/*-------------------------------------------------------------------------
- * Function: H5G_link_cmp_corder_dec
+ * Function: H5G__link_cmp_corder_dec
*
* Purpose: Callback routine for comparing two link creation orders, in
* decreasing order
@@ -188,11 +188,11 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
*-------------------------------------------------------------------------
*/
static int
-H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2)
+H5G__link_cmp_corder_dec(const void *lnk1, const void *lnk2)
{
int ret_value = -1; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder)
ret_value = 1;
@@ -202,7 +202,7 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2)
ret_value = 0;
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5G_link_cmp_corder_dec() */
+} /* end H5G__link_cmp_corder_dec() */
/*-------------------------------------------------------------------------
@@ -434,18 +434,18 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type,
/* Pick appropriate sorting routine */
if(idx_type == H5_INDEX_NAME) {
if(order == H5_ITER_INC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_inc);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_inc);
else if(order == H5_ITER_DEC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_name_dec);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_dec);
else
HDassert(order == H5_ITER_NATIVE);
} /* end if */
else {
HDassert(idx_type == H5_INDEX_CRT_ORDER);
if(order == H5_ITER_INC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_inc);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_inc);
else if(order == H5_ITER_DEC)
- HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G_link_cmp_corder_dec);
+ HDqsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_dec);
else
HDassert(order == H5_ITER_NATIVE);
} /* end else */
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index 2461c51..3109b49 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -621,7 +621,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5G_loc_exists_cb
+ * Function: H5G__loc_exists_cb
*
* Purpose: Callback for checking if an object exists
*
@@ -633,13 +633,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name,
+H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name,
const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/,
H5G_own_loc_t *own_loc/*out*/)
{
H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check if the name in this group resolved to a valid object */
if(obj_loc == NULL)
@@ -655,7 +655,7 @@ H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UN
*own_loc = H5G_OWN_NONE;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5G_loc_exists_cb() */
+} /* end H5G__loc_exists_cb() */
/*-------------------------------------------------------------------------
@@ -687,7 +687,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name)
udata.exists = FALSE;
/* Traverse group hierarchy to locate object */
- if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata) < 0)
+ if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, &udata) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists")
/* Set return value */
diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h
index 19ea982..883aa6d 100644
--- a/src/H5Gmodule.h
+++ b/src/H5Gmodule.h
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Programmer: Quincey Koziol
* Saturday, September 12, 2015
*
* Purpose: This file contains declarations which define macros for the
diff --git a/src/H5Gname.c b/src/H5Gname.c