summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index adae24f..269f064 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -160,11 +160,11 @@
#define H5F_ACS_FILE_IMAGE_INFO_DEL H5P_file_image_info_del
#define H5F_ACS_FILE_IMAGE_INFO_COPY H5P_file_image_info_copy
#define H5F_ACS_FILE_IMAGE_INFO_CLOSE H5P_file_image_info_close
-/* Definition for # of read attempts */
-#define H5F_ACS_READ_ATTEMPTS_SIZE sizeof(unsigned)
-#define H5F_ACS_READ_ATTEMPTS_DEF 0
-#define H5F_ACS_READ_ATTEMPTS_ENC H5P__encode_unsigned
-#define H5F_ACS_READ_ATTEMPTS_DEC H5P__decode_unsigned
+/* Definition for # of metadata read attempts */
+#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned)
+#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0
+#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned
+#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned
/******************/
/* Local Typedefs */
@@ -251,7 +251,7 @@ static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF;
static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */
static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */
static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */
-static const unsigned H5F_def_read_attempts_g = H5F_ACS_READ_ATTEMPTS_DEF; /* Default setting for the # of read attempts */
+static const unsigned H5F_def_metadata_read_attempts_g = H5F_ACS_METADATA_READ_ATTEMPTS_DEF; /* Default setting for the # of metadata read attempts */
/*-------------------------------------------------------------------------
@@ -402,8 +402,8 @@ H5P_facc_reg_prop(H5P_genclass_t *pclass)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
/* Register the # of read attempts */
- if(H5P_register_real(pclass, H5F_ACS_READ_ATTEMPTS_NAME, H5F_ACS_READ_ATTEMPTS_SIZE, &H5F_def_read_attempts_g,
- NULL, NULL, NULL, H5F_ACS_READ_ATTEMPTS_ENC, H5F_ACS_READ_ATTEMPTS_DEC,
+ if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g,
+ NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC,
NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
done:
@@ -2991,13 +2991,15 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value)
/*-------------------------------------------------------------------------
- * Function: H5Pset_read_attempts
+ * Function: H5Pset_metadata_read_attempts
*
* Purpose: Sets the # of read attempts in the file access property list
* when reading metadata with checksum.
- * The # of read attempts set via this routine will apply only
- * when opening file with SWMR access. When opening file with
- * non-SWMR access, the # of read attempts will always be 1.
+ * The # of read attempts set via this routine will only apply
+ * when opening a file with SWMR access.
+ * The # of read attempts set via this routine does not have
+ * any effect when opening a file with non-SWMR access; for this
+ * case, the # of read attempts will be always be 1.
*
* Return: Non-negative on success/Negative on failure
*
@@ -3006,7 +3008,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_read_attempts(hid_t plist_id, unsigned attempts)
+H5Pset_metadata_read_attempts(hid_t plist_id, unsigned attempts)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* return value */
@@ -3016,25 +3018,25 @@ H5Pset_read_attempts(hid_t plist_id, unsigned attempts)
/* Cannot set the # of attempts to 0 */
if(attempts <= 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "number of attempts must be greater than 0");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "number of metadatata read attempts must be greater than 0");
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
/* Set values */
- if(H5P_set(plist, H5F_ACS_READ_ATTEMPTS_NAME, &attempts) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set # of read attempts")
+ if(H5P_set(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &attempts) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set # of metadata read attempts")
done:
FUNC_LEAVE_API(ret_value)
-} /* H5Pset_read_attempts() */
+} /* H5Pset_metadata_read_attempts() */
/*-------------------------------------------------------------------------
- * Function: H5Pget_read_attempts
+ * Function: H5Pget_metadata_read_attempts
*
- * Purpose: Returns the # of read attempts set in the file access property list.
+ * Purpose: Returns the # of metadata read attempts set in the file access property list.
*
* Return: Non-negative on success/Negative on failure
*
@@ -3043,7 +3045,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_read_attempts(hid_t plist_id, unsigned *attempts/*out*/)
+H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3058,13 +3060,13 @@ H5Pget_read_attempts(hid_t plist_id, unsigned *attempts/*out*/)
/* Get values */
if(attempts) {
/* Get the # of read attempts set */
- if(H5P_get(plist, H5F_ACS_READ_ATTEMPTS_NAME, attempts) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment")
+ if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts")
/* If not set, return the default value */
- if(*attempts == H5F_ACS_READ_ATTEMPTS_DEF) /* 0 */
- *attempts = H5F_READ_ATTEMPTS;
+ if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */
+ *attempts = H5F_METADATA_READ_ATTEMPTS;
}
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Pget_read_attempts() */
+} /* end H5Pget_metadata_read_attempts() */