summaryrefslogtreecommitdiffstats
path: root/src/H5PB.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2022-03-26 18:14:37 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2022-03-26 18:14:37 (GMT)
commitfeff1e58a71f6f8ecc505495287d9b8bc22ddc9a (patch)
tree221eb81f6d0ca9f8235f254861b17221bd8eb2a0 /src/H5PB.c
parenta7b37b6ac5ef3703b52447a9e60419f435a7c082 (diff)
downloadhdf5-feff1e58a71f6f8ecc505495287d9b8bc22ddc9a.zip
hdf5-feff1e58a71f6f8ecc505495287d9b8bc22ddc9a.tar.gz
hdf5-feff1e58a71f6f8ecc505495287d9b8bc22ddc9a.tar.bz2
Address comments from selection I/O PR
Diffstat (limited to 'src/H5PB.c')
-rw-r--r--src/H5PB.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/H5PB.c b/src/H5PB.c
index 4fc9a52..b7c3526 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -1314,14 +1314,14 @@ done:
*
*-------------------------------------------------------------------------
*/
-htri_t
-H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type)
+herr_t
+H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled)
{
- H5PB_t *page_buf; /* Page buffering info for this file */
- hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */
- htri_t ret_value; /* Return value */
+ H5PB_t *page_buf; /* Page buffering info for this file */
+ hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI_NOERR
/* Sanity checks */
HDassert(f_sh);
@@ -1345,9 +1345,12 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type)
} /* end if */
#endif
- /* If page buffering is disabled, or the I/O size is larger than that of a
- * single page, or if this is a parallel raw data access, bypass page
- * buffering.
+ /* If page buffering is disabled, or if this is a parallel raw data access,
+ * bypass page buffering. Note that page buffering may stil be disabled for
+ * large metadata access or large non-parallel raw data access, but this
+ * function doesn't take I/O size into account so if it returns TRUE the
+ * page buffer may still be disabled for some I/O. If it returns FALSE it is
+ * always disabled for this access type.
*/
if (NULL == page_buf || (bypass_pb && H5FD_MEM_DRAW == type)) {
/* Update statistics, since wherever this function is called, if it
@@ -1359,13 +1362,12 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type)
} /* end if */
/* Page buffer is disabled, at least for this data access type */
- ret_value = FALSE;
+ *enabled = FALSE;
} /* end if */
else
/* Page buffer may be enabled */
- ret_value = TRUE;
+ *enabled = TRUE;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5PB_enabled() */