diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-25 16:57:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-25 16:57:11 (GMT) |
commit | 859507f75757b890bf21dee43476a94bff526cb9 (patch) | |
tree | 38d60887a59840b05c7b13077c7e8164879738cf /src/H5FDstdio.c | |
parent | b043ee1241522fc0b87787ead985f5d9f3b7af26 (diff) | |
download | hdf5-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/H5FDstdio.c')
-rw-r--r-- | src/H5FDstdio.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 193c576..2070b1a 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -111,6 +111,9 @@ typedef struct H5FD_stdio_t { DWORD fileindexlo; DWORD fileindexhi; #endif + + /* Information from file open flags, for SWMR access */ + hbool_t swmr_read; /* Whether the file is open for SWMR read access */ } H5FD_stdio_t; #ifdef H5_HAVE_LSEEK64 @@ -410,6 +413,11 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, file->device = sb.st_dev; file->inode = sb.st_ino; #endif + + /* Check for SWMR reader access */ + if(flags & H5F_ACC_SWMR_READ) + file->swmr_read = 1; + return((H5FD_t*)file); } /* end H5FD_stdio_open() */ @@ -789,8 +797,14 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (REGION_OVERFLOW(addr, size)) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) - if (addr+size>file->eoa) - H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) + /* 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) + H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) /* Check easy cases */ if (0 == size) |