summaryrefslogtreecommitdiffstats
path: root/src/H5FDwindows.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-25 16:57:11 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-25 16:57:11 (GMT)
commit859507f75757b890bf21dee43476a94bff526cb9 (patch)
tree38d60887a59840b05c7b13077c7e8164879738cf /src/H5FDwindows.c
parentb043ee1241522fc0b87787ead985f5d9f3b7af26 (diff)
downloadhdf5-859507f75757b890bf21dee43476a94bff526cb9.zip
hdf5-859507f75757b890bf21dee43476a94bff526cb9.tar.gz
hdf5-859507f75757b890bf21dee43476a94bff526cb9.tar.bz2
[svn-r17421] Description:
Change internal mechanism for disabling EOA checks when the SWMR read flag is set from setting the EOA to 'maxaddr' to setting a flag in the VFDs that talk to storage, since setting the EOA to 'maxaddr' causes problems when using the multi (and family, I think) VFDs. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode, check-vfd Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5FDwindows.c')
-rw-r--r--src/H5FDwindows.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c
index aca03c8..efdd0ba 100644
--- a/src/H5FDwindows.c
+++ b/src/H5FDwindows.c
@@ -93,6 +93,9 @@ typedef struct H5FD_windows_t {
DWORD fileindexhi;
DWORD volumeserialnumber;
+ /* Information from file open flags, for SWMR access */
+ hbool_t swmr_read; /* Whether the file is open for SWMR read access */
+
/* Information from properties set by 'h5repart' tool */
hbool_t fam_to_sec2; /* Whether to eliminate the family driver info
* and convert this file to a single file */
@@ -413,6 +416,10 @@ H5FD_windows_open(const char *name, unsigned flags, hid_t UNUSED fapl_id,
file->fileindexlo = fileinfo.nFileIndexLow;
file->volumeserialnumber = fileinfo.dwVolumeSerialNumber;
+ /* Check for SWMR reader access */
+ if(flags & H5F_ACC_SWMR_READ)
+ file->swmr_read = TRUE;
+
/* Check for non-default FAPL */
if(H5P_FILE_ACCESS_DEFAULT != fapl_id) {
H5P_genplist_t *plist; /* Property list pointer */
@@ -799,7 +806,13 @@ H5FD_windows_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined")
if (REGION_OVERFLOW(addr, size))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
- if (addr+size>file->eoa)
+ /* If the file is open for SWMR read access, allow access to data past
+ * the end of the allocated space (the 'eoa'). This is done because the
+ * eoa stored in the file's superblock might be out of sync with the
+ * objects being written within the file by the application performing
+ * SWMR write operations.
+ */
+ if(!file->swmr_read && (addr + size) > file->eoa)
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow")
/* Seek to the correct location */