summaryrefslogtreecommitdiffstats
path: root/src/H5FDvfd_swmr.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-03-23 13:48:05 (GMT)
committerGitHub <noreply@github.com>2022-03-23 13:48:05 (GMT)
commitfbb532cd633e216f47ce846493b38af02cfbb43a (patch)
tree1ef7bc9f25ec0832f8b25bb8ea4be34d53bd144d /src/H5FDvfd_swmr.c
parent78375882485a99a81caa933928ed08d7a38ef88b (diff)
downloadhdf5-fbb532cd633e216f47ce846493b38af02cfbb43a.zip
hdf5-fbb532cd633e216f47ce846493b38af02cfbb43a.tar.gz
hdf5-fbb532cd633e216f47ce846493b38af02cfbb43a.tar.bz2
VFD SWMR: Normalization with develop (#1506)
* Brought over plugin and test script changes * Removes remaining register keywords (#1481) * Fixed warnings in the aux process code * Minor fixes from develop * Minor changes from develop, fixed format warnings * Formatted source * Added HD prefix to timespec_get * Cleanup in new files * Removes the MANIFEST file and unused release files (#1497) * Removes the MANIFEST file and unused release files * Updated tar command * checkposix corrections * More checkposix fixes * Ripped out unused instrumentation functionality * Brought over cache tagging changes from develop * Changes to tagged metadata expulsion iteration * Fixed typo * Brought over H5O__free() changes from develop * Brings (unused) parallel page buffer test in line with develop * Moved the functionality in supervise.subr to test_vfd_swmr.sh * Tools VFD parameter updates * Committing clang-format changes * H5F VFD SWMR refactoring * Committing clang-format changes * Misc changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5FDvfd_swmr.c')
-rw-r--r--src/H5FDvfd_swmr.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/src/H5FDvfd_swmr.c b/src/H5FDvfd_swmr.c
index 11c177b..cd1a02e 100644
--- a/src/H5FDvfd_swmr.c
+++ b/src/H5FDvfd_swmr.c
@@ -235,9 +235,9 @@ H5FD__swmr_reader_open(H5FD_vfd_swmr_t *file)
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "could not allocate API elapsed ticks")
/* Retry on opening the metadata file */
- for (do_try = h5_retry_init(&retry, H5FD_VFD_SWMR_MD_FILE_RETRY_MAX, H5_RETRY_DEFAULT_MINIVAL,
+ for (do_try = H5_retry_init(&retry, H5FD_VFD_SWMR_MD_FILE_RETRY_MAX, H5_RETRY_DEFAULT_MINIVAL,
H5_RETRY_DEFAULT_MAXIVAL);
- do_try; do_try = h5_retry_next(&retry)) {
+ do_try; do_try = H5_retry_next(&retry)) {
if ((file->md_fd = HDopen(file->md_file_path, O_RDONLY)) >= 0)
break;
}
@@ -358,8 +358,6 @@ done:
static void
H5FD__swmr_reader_close(H5FD_vfd_swmr_t *file)
{
- vfd_swmr_reader_did_increase_tick_to(0);
-
if (file->api_elapsed_ticks != NULL)
H5MM_xfree(file->api_elapsed_ticks);
@@ -770,7 +768,7 @@ H5FD__vfd_swmr_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id
/* Try finding the addr from the index */
target_page = addr / fs_page_size;
- entry = vfd_swmr_pageno_to_mdf_idx_entry(index, num_entries, target_page, FALSE);
+ entry = H5FD_vfd_swmr_pageno_to_mdf_idx_entry(index, num_entries, target_page, FALSE);
if (entry == NULL) {
/* Cannot find addr in index, read from the underlying hdf5 file */
@@ -1011,9 +1009,9 @@ H5FD__vfd_swmr_load_hdr_and_idx(H5FD_vfd_swmr_t *file, hbool_t open)
FUNC_ENTER_STATIC
- for (do_try = h5_retry_init(&retry, H5FD_VFD_SWMR_MD_LOAD_RETRY_MAX, H5_RETRY_ONE_SECOND / 10,
+ for (do_try = H5_retry_init(&retry, H5FD_VFD_SWMR_MD_LOAD_RETRY_MAX, H5_RETRY_ONE_SECOND / 10,
H5_RETRY_ONE_SECOND);
- do_try; do_try = h5_retry_next(&retry)) {
+ do_try; do_try = H5_retry_next(&retry)) {
/* Load and decode the header. Go around again on a temporary
* failure (FALSE). Bail on an irrecoverable failure (FAIL).
@@ -1170,7 +1168,8 @@ H5FD__vfd_swmr_header_deserialize(H5FD_vfd_swmr_t *file, H5FD_vfd_swmr_md_header
UINT32DECODE(p, md_header->fs_page_size);
UINT64DECODE(p, md_header->tick_num);
UINT64DECODE(p, md_header->index_offset);
- if ((index_length = uint64_decode(&p)) > SIZE_MAX)
+ UINT64DECODE(p, index_length);
+ if (index_length > SIZE_MAX)
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "index is too large to hold in core")
md_header->index_length = (size_t)index_length;
@@ -1181,13 +1180,6 @@ H5FD__vfd_swmr_header_deserialize(H5FD_vfd_swmr_t *file, H5FD_vfd_swmr_md_header
/* Sanity check */
HDassert((size_t)(p - image) <= H5FD_MD_HEADER_SIZE);
-#if 0 /* JRM */
- HDfprintf(stderr,
- "---read header ps/tick/idx_off/idx_len = %d / %lld / %lld / %lld\n",
- md_header->fs_page_size, md_header->tick_num,
- md_header->index_offset, md_header->index_length);
-#endif /* JRM */
-
ret_value = TRUE;
done:
@@ -1320,12 +1312,6 @@ H5FD__vfd_swmr_index_deserialize(const H5FD_vfd_swmr_t *file, H5FD_vfd_swmr_md_i
/* Sanity check */
HDassert((size_t)(p - image) <= md_header->index_length);
-#if 0 /* JRM */
- HDfprintf(stderr,
- " ---- read index tick/num_entries = %lld / %d \n",
- md_index->tick_num, md_index->num_entries);
-#endif /* JRM */
-
done:
if (image != NULL)
image = H5MM_xfree(image);