summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr.c
diff options
context:
space:
mode:
authorvchoi <vchoi@jelly.ad.hdfgroup.org>2022-06-03 19:09:32 (GMT)
committervchoi <vchoi@jelly.ad.hdfgroup.org>2022-06-03 19:09:32 (GMT)
commitc766dc8d884a51a9e11af8627ecd3134c566b230 (patch)
treeb77f61f513ec2332059bc8048e6ce1af6af00d1b /test/vfd_swmr.c
parent54fdbd3af2102353ed3403754f54274839127f25 (diff)
downloadhdf5-c766dc8d884a51a9e11af8627ecd3134c566b230.zip
hdf5-c766dc8d884a51a9e11af8627ecd3134c566b230.tar.gz
hdf5-c766dc8d884a51a9e11af8627ecd3134c566b230.tar.bz2
Merge in VFD SWMR changes by John Mainzer.
Commit log message from John: Returned VFD SWMR to using the VFD SWMR reader VFD only in the reader case. In passing, added a private VFD SWMR reader VFD fapl entry that is pushed and popped off the FAPL during file open, and removed the code that set the VFD SWMR reader VFD as the driver in the FAPL when VFD SWMR is configured. This was necessary, as there is no mechanism to prevent the user from overwriting this entry on the FAPL before file open. While we don't use it now, it also gives us a mechanism for allowing the user to specify an underlying VFD for VFD SWMR. Modified code to compare file opens to compare the terminal VFDs, not the top level VFDs. Failure to do this allowed multiple opens of the same file with the same VFD but with different pass through VFDs to appear to be treated as different files -- with the obvious file corruption issues. To support this, added a new VFD ctl op code to return a pointer to the instance of H5FD_t associated with the terminal VFD. Note that this change does not address the case of the same file being opened twice with different terminal VFDs -- that will have to be addressed another day. Overview of major changes from John: 1) Reworked file open so that the VFD SWMR reader VFD is only used when a file is opened VFD SWMR reader. This required the following changes: a) Removed code to set the driver in H5Pset_vfd_swmr_config() b) Added a private fapl entry for the VFD SWMR reader VFD c) Modified H5F_open to test for VFD SWMR reader opens, and push the vfd swmr reader vfd FAPL entry on the VFD stack if so. In this case the entry is popped off the VFD stack on exit so as to avoid any net modification from the supplied FAPL. 2) Removed dedup code, and augmented H5FD_cmp() to provide the necessary functionality. This required the following changes: a) Added the get terminal VFD op code to the H5FD ctl call. This allows duplicate file opens with the same VFD but different overlying pass through VFDs to be recognized. Updated ctl callback in VFDs as required to support the new op code. b) Modified H5FD_cmp to use the above ctl op code to allow it to recognize duplicate file opens with the same VFD but with different overlying passthoguh VFDs. This is necessary to recognize duplicate VFD SWMR reader and regular opens. Note that this does not allow us to recognize duplicate opens with different terminal VFDs.
Diffstat (limited to 'test/vfd_swmr.c')
-rw-r--r--test/vfd_swmr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c
index 924da07..e4f337d 100644
--- a/test/vfd_swmr.c
+++ b/test/vfd_swmr.c
@@ -5402,7 +5402,7 @@ test_vfds_same_file_opens(hid_t orig_fapl, const char *env_h5_drvr)
if (H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
-#if 0 /* Use test cases #4 and #5 when John's changes are merged */
+#if 1 /* Use test cases #4 and #5 when John's changes are merged */
/*
* Case #4
* --Open the file as writer with both legacy SWMR and VFD SWMR configured .