summaryrefslogtreecommitdiffstats
path: root/src/H5Pfapl.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-11-14 19:15:23 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-11-14 19:15:23 (GMT)
commit227688c9cd99577df8dcba63875dca513593c739 (patch)
treedaf9c80f16bc6fee83bdeb51020d4180b97af824 /src/H5Pfapl.c
parentf2bb4e3dbc04d450098e0466e120a3f8a26d228c (diff)
downloadhdf5-227688c9cd99577df8dcba63875dca513593c739.zip
hdf5-227688c9cd99577df8dcba63875dca513593c739.tar.gz
hdf5-227688c9cd99577df8dcba63875dca513593c739.tar.bz2
Modifications for the following items in the punch list:
(A) #5: Add the "pb_expansion_threshold" field to the "H5F_vfd_swmr_config_t" structure and update H5Pset_vfd_swmr_config() and H5Pget_vfd_swmr_config() accordingly (B) #13 bullet 2: Comment H5F_vfd_swmr_config_t in H5Fpublic.h properly (copied from John's description in the RFC) (C) Change the field name "vfd_swmr_writer" to "writer" in "struct H5F_vfd_swmr_config_t" (as indicated on page 11 in the RFC) and all references to it
Diffstat (limited to 'src/H5Pfapl.c')
-rw-r--r--src/H5Pfapl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 71ab475..0f17959 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -3974,9 +3974,10 @@ H5P__facc_vfd_swmr_config_enc(const void *value, void **_pp, size_t *size)
INT32ENCODE(*pp, (int32_t)config->version);
INT32ENCODE(*pp, (int32_t)config->tick_len);
INT32ENCODE(*pp, (int32_t)config->max_lag);
- H5_ENCODE_UNSIGNED(*pp, config->vfd_swmr_writer);
+ H5_ENCODE_UNSIGNED(*pp, config->writer);
H5_ENCODE_UNSIGNED(*pp, config->flush_raw_data);
INT32ENCODE(*pp, (int32_t)config->md_pages_reserved);
+ INT32ENCODE(*pp, (int32_t)config->pb_expansion_threshold);
HDmemcpy(*pp, (const uint8_t *)(config->md_file_path), (size_t)(H5F__MAX_VFD_SWMR_FILE_NAME_LEN + 1));
*pp += H5F__MAX_VFD_SWMR_FILE_NAME_LEN + 1;
HDmemcpy(*pp, (const uint8_t *)(config->log_file_path), (size_t)(H5F__MAX_VFD_SWMR_FILE_NAME_LEN + 1));
@@ -3985,7 +3986,7 @@ H5P__facc_vfd_swmr_config_enc(const void *value, void **_pp, size_t *size)
} /* end if */
/* Compute encoded size */
- *size += ( (4 * sizeof(int32_t)) +
+ *size += ( (5 * sizeof(int32_t)) +
(2 * sizeof(unsigned)) +
(2 * (H5F__MAX_VFD_SWMR_FILE_NAME_LEN + 1)) );
@@ -4028,11 +4029,12 @@ H5P__facc_vfd_swmr_config_dec(const void **_pp, void *_value)
INT32DECODE(*pp, config->tick_len);
INT32DECODE(*pp, config->max_lag);
- H5_DECODE_UNSIGNED(*pp, config->vfd_swmr_writer);
+ H5_DECODE_UNSIGNED(*pp, config->writer);
H5_DECODE_UNSIGNED(*pp, config->flush_raw_data);
/* int */
INT32DECODE(*pp, config->md_pages_reserved);
+ INT32DECODE(*pp, config->pb_expansion_threshold);
HDstrcpy(config->md_file_path, (const char *)(*pp));
*pp += H5F__MAX_VFD_SWMR_FILE_NAME_LEN + 1;
@@ -5106,6 +5108,10 @@ H5Pset_vfd_swmr_config(hid_t plist_id, H5F_vfd_swmr_config_t *config_ptr)
if(config_ptr->md_pages_reserved < 1 )
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "md_pages_reserved must be at least 1")
+ /* This field must be in the range [0, 100] */
+ if(config_ptr->pb_expansion_threshold < 0 || config_ptr->pb_expansion_threshold > H5F__MAX_PB_EXPANSION_THRESHOLD)
+ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "pb_expansion_threshold out of range")
+
/* Must provide the path for the metadata file */
name_len = HDstrlen(config_ptr->md_file_path);
if(name_len == 0)
@@ -5118,7 +5124,7 @@ H5Pset_vfd_swmr_config(hid_t plist_id, H5F_vfd_swmr_config_t *config_ptr)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set metadata cache initial config")
/* Hard-wired to use SWMR VFD */
- if(!config_ptr->vfd_swmr_writer) {
+ if(!config_ptr->writer) {
if(H5P_set_driver(plist, H5FD_VFD_SWMR, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set VFD SWMR driver info")
}