diff options
author | David Young <dyoung@hdfgroup.org> | 2019-12-19 19:43:54 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2019-12-19 19:43:54 (GMT) |
commit | dc15a6987e1b10f19a0a692fdd00d5e713701a9a (patch) | |
tree | a0318de2beca1a1928d4132b6e62cfaecf54fd29 /src/H5Ftest.c | |
parent | 10a7a4741500276804cb245fd8f860286642b76d (diff) | |
download | hdf5-dc15a6987e1b10f19a0a692fdd00d5e713701a9a.zip hdf5-dc15a6987e1b10f19a0a692fdd00d5e713701a9a.tar.gz hdf5-dc15a6987e1b10f19a0a692fdd00d5e713701a9a.tar.bz2 |
Use the "tail queue" from queue(3) for the delayed free list of shadow images.
Delete the little-used free-list length, dl_len, and just count up the list
entries when diagnostic code needs the length.
Extract the code for deferring shadow-image free into a new subroutine,
`vfd_swmr_idx_entry_defer_free()`.
Rename type `deferred_free_head_t` as `deferred_free_queue_t`.
Remove the disused H5F__LL_{REMOVE,PREPEND} macros.
Add some diagnostic code and #if 0'd assertions.
Change `qsort(ptr, n, sizeof(type), cmp)` to
`qsort(ptr, n, sizeof(*ptr), cmp)`.
Use a `continue` statement to lower a staircase in
H5F_update_vfd_swmr_metadata_file().
Add vfd_swmr_mdf_idx_entry_remove() to delete a shadow index entry and add the
image at that entry to a deferred-free list. Call it whenever a page is
evicted.
Update the comment in H5PB_remove_entry() that asks if we need to remove shadow
index entries: now we *do* remove them. Remove shadow index entries in
H5PB__evict_entry(). Also mention in the comment that the index-entry removal
performed by H5PB__evict_entry() ought to be sufficient.
Diffstat (limited to 'src/H5Ftest.c')
-rw-r--r-- | src/H5Ftest.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/H5Ftest.c b/src/H5Ftest.c index cebbbe9..90657ef 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -526,6 +526,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F__vfd_swmr_verify_md_hdr_and_idx() */ +static unsigned +count_old_images(old_image_queue_t *old_images) +{ + old_image_t *old_image; + unsigned count = 0; + + TAILQ_FOREACH(old_image, old_images, link) + count++; + + return count; +} /*------------------------------------------------------------------------- @@ -536,15 +547,15 @@ done: * --info read from the metadata file is as indicated by * the input: num_entries, index * --# of entries on the delayed list is as indicated by - * the input: num_dl_entries + * the input: nold_images * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5F__vfd_swmr_writer_md_test(hid_t file_id, unsigned num_entries, H5FD_vfd_swmr_idx_entry_t *index, - unsigned num_dl_entries) +H5F__vfd_swmr_writer_md_test(hid_t file_id, unsigned num_entries, + H5FD_vfd_swmr_idx_entry_t *index, unsigned nold_images) { H5F_t *f; /* File pointer */ int md_fd = -1; /* The metadata file descriptor */ @@ -566,7 +577,7 @@ H5F__vfd_swmr_writer_md_test(hid_t file_id, unsigned num_entries, H5FD_vfd_swmr_ HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "error updating the md file with the index") /* Verify the number of entries in the delayed list is as expected */ - if(f->shared->dl_len < num_dl_entries) + if(count_old_images(&f->shared->old_images) < nold_images) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect # of entries in the delayed list") /* Open the metadata file */ |