summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5FDdirect.c14
-rw-r--r--src/H5FDdirect.h2
-rw-r--r--src/H5FDhdfs.c8
-rw-r--r--src/H5FDhdfs.h2
-rw-r--r--src/H5FDmirror.c2
-rw-r--r--src/H5FDmpio.c29
-rw-r--r--src/H5FDmpio.h2
-rw-r--r--src/H5FDros3.c3
-rw-r--r--src/H5FDsplitter.c2
-rw-r--r--src/Makefile.am9
10 files changed, 24 insertions, 49 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index ac7720f..4c2d251 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -384,14 +384,13 @@ static void *
H5FD__direct_fapl_get(H5FD_t *_file)
{
H5FD_direct_t *file = (H5FD_direct_t *)_file;
- void * ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
- FUNC_ENTER_STATIC
+ FUNC_ENTER_STATIC_NOERR
/* Set return value */
ret_value = H5FD__direct_fapl_copy(&(file->fa));
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__direct_fapl_get() */
@@ -447,7 +446,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
int o_flags;
int fd = (-1);
H5FD_direct_t * file = NULL;
- H5FD_direct_fapl_t *fa;
+ const H5FD_direct_fapl_t *fa;
#ifdef H5_HAVE_WIN32_API
HFILE filehandle;
struct _BY_HANDLE_FILE_INFORMATION fileinfo;
@@ -496,7 +495,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
/* Get the driver specific information */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
- if (NULL == (fa = (H5FD_direct_fapl_t *)H5P_peek_driver_info(plist)))
+ if (NULL == (fa = (const H5FD_direct_fapl_t *)H5P_peek_driver_info(plist)))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "bad VFL driver info")
file->fd = fd;
@@ -546,7 +545,8 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
}
else {
file->fa.must_align = FALSE;
- HDftruncate(file->fd, (HDoff_t)0);
+ if (-1 == HDftruncate(file->fd, (HDoff_t)0))
+ HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file")
}
}
else {
@@ -793,7 +793,7 @@ 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_STATIC
+ FUNC_ENTER_STATIC_NOERR
FUNC_LEAVE_NOAPI(file->eof)
}
diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h
index 2d88a69..ea2b3f2 100644
--- a/src/H5FDdirect.h
+++ b/src/H5FDdirect.h
@@ -23,7 +23,7 @@
#ifdef H5_HAVE_DIRECT
#define H5FD_DIRECT (H5FD_direct_init())
#else
-#define H5FD_DIRECT (-1)
+#define H5FD_DIRECT (H5I_INVALID_HID)
#endif /* H5_HAVE_DIRECT */
#ifdef H5_HAVE_DIRECT
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index a7c6aae..b4aecfd 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -20,6 +20,9 @@
* 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 */
@@ -30,9 +33,6 @@
#ifdef H5_HAVE_LIBHDFS
-/* This source code file is part of the H5FD driver module */
-#include "H5FDdrvr_module.h"
-
/* HDFS routines */
#include "hdfs.h"
@@ -356,7 +356,7 @@ done:
hid_t
H5FD_hdfs_init(void)
{
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID;
#if HDFS_STATS
unsigned int bin_i;
#endif
diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h
index 9d14e9a..abe7682 100644
--- a/src/H5FDhdfs.h
+++ b/src/H5FDhdfs.h
@@ -25,7 +25,7 @@
#ifdef H5_HAVE_LIBHDFS
#define H5FD_HDFS (H5FD_hdfs_init())
#else /* H5_HAVE_LIBHDFS */
-#define H5FD_HDFS (-1)
+#define H5FD_HDFS (H5I_INVALID_HID)
#endif /* H5_HAVE_LIBHDFS */
#ifdef H5_HAVE_LIBHDFS
diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c
index 3895b42..8f1d25c 100644
--- a/src/H5FDmirror.c
+++ b/src/H5FDmirror.c
@@ -242,7 +242,7 @@ H5FD_mirror_init(void)
{
hid_t ret_value = H5I_INVALID_HID;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
LOG_OP_CALL(FUNC);
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 6042776..c16e01e 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1746,33 +1746,4 @@ H5FD__mpio_communicator(const H5FD_t *_file)
FUNC_LEAVE_NOAPI(file->comm)
} /* end H5FD__mpio_communicator() */
-/*-------------------------------------------------------------------------
- * Function: H5FD__mpio_get_info
- *
- * Purpose: Returns the file info of MPIO file driver.
- *
- * Returns: Non-negative if succeed or negative if fails.
- *
- * Programmer: John Mainzer
- * April 4, 2017
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5FD__mpio_get_info(H5FD_t *_file, void **mpi_info)
-{
- H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_STATIC
-
- if (!mpi_info)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mpi info not valid")
-
- *mpi_info = &(file->info);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5FD__mpio_get_info() */
-
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h
index c9280c7..0773d9e 100644
--- a/src/H5FDmpio.h
+++ b/src/H5FDmpio.h
@@ -25,7 +25,7 @@
#ifdef H5_HAVE_PARALLEL
#define H5FD_MPIO (H5FD_mpio_init())
#else
-#define H5FD_MPIO (-1)
+#define H5FD_MPIO (H5I_INVALID_HID)
#endif /* H5_HAVE_PARALLEL */
#ifdef H5_HAVE_PARALLEL
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index fa41b6f..cc27fd0 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -320,7 +320,7 @@ H5FD_ros3_init(void)
unsigned int bin_i;
#endif
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
#if ROS3_DEBUG
HDfprintf(stdout, "H5FD_ros3_init() called.\n");
@@ -340,7 +340,6 @@ H5FD_ros3_init(void)
}
#endif
- /* Set return value */
ret_value = H5FD_ROS3_g;
done:
diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c
index 5ba1a27..698ae7e 100644
--- a/src/H5FDsplitter.c
+++ b/src/H5FDsplitter.c
@@ -210,7 +210,7 @@ H5FD_splitter_init(void)
{
hid_t ret_value = H5I_INVALID_HID;
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
H5FD_SPLITTER_LOG_CALL(FUNC);
diff --git a/src/Makefile.am b/src/Makefile.am
index cbecccd..a333220 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,7 +39,7 @@ DISTCLEANFILES=H5pubconf.h
# library sources
libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \
- H5timer.c H5trace.c \
+ H5timer.c H5trace.c \
H5A.c H5Abtree2.c H5Adense.c H5Adeprec.c H5Aint.c H5Atest.c \
H5AC.c H5ACdbg.c H5ACproxy_entry.c \
H5B.c H5Bcache.c H5Bdbg.c \
@@ -61,7 +61,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5lib_settings.c H5system.c \
H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \
H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \
H5FAint.c H5FAstat.c H5FAtest.c \
- H5FD.c H5FDcore.c H5FDfamily.c H5FDhdfs.c H5FDint.c H5FDlog.c \
+ H5FD.c H5FDcore.c H5FDfamily.c H5FDint.c H5FDlog.c \
H5FDmulti.c H5FDsec2.c H5FDspace.c \
H5FDsplitter.c H5FDstdio.c H5FDtest.c \
H5FL.c H5FO.c H5FS.c H5FScache.c H5FSdbg.c H5FSint.c H5FSsection.c \
@@ -126,6 +126,11 @@ if DIRECT_VFD_CONDITIONAL
libhdf5_la_SOURCES += H5FDdirect.c
endif
+# Only compile the read-only HDFS VFD if necessary
+if HDFS_VFD_CONDITIONAL
+ libhdf5_la_SOURCES += H5FDhdfs.c
+endif
+
# Only compile the mirror VFD if necessary
if MIRROR_VFD_CONDITIONAL
libhdf5_la_SOURCES += H5FDmirror.c