summaryrefslogtreecommitdiffstats
path: root/src/H5FDint.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2014-12-29 06:02:06 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2014-12-29 06:02:06 (GMT)
commitb65eae7aeeabcb15b2ef002692e1d0435902d44a (patch)
tree78fb110371c0d23995028fa7fe5c59726b599d5c /src/H5FDint.c
parent662892e8b18db2dd5c1ebcd923c246adb4fe0fac (diff)
downloadhdf5-b65eae7aeeabcb15b2ef002692e1d0435902d44a.zip
hdf5-b65eae7aeeabcb15b2ef002692e1d0435902d44a.tar.gz
hdf5-b65eae7aeeabcb15b2ef002692e1d0435902d44a.tar.bz2
[svn-r25929] Description:
Clean up EOF code within library and add 'mem_type' parameter to 'get_eof' VFD callback, to avoid various ambiguous situations, particularly with the multi VFD. (Supports changes for 'avoid_truncate' feature also) Tested on: MacOSX/64 10.10.1 (amazon) w/serial & parallel h5committest forthcoming
Diffstat (limited to 'src/H5FDint.c')
-rw-r--r--src/H5FDint.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/H5FDint.c b/src/H5FDint.c
index 9f02a25..4f3c234 100644
--- a/src/H5FDint.c
+++ b/src/H5FDint.c
@@ -120,7 +120,7 @@ H5FD_int_init_interface(void)
herr_t
H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, haddr_t *sig_addr)
{
- haddr_t addr, eoa;
+ haddr_t addr, eoa, eof;
uint8_t buf[H5F_SIGNATURE_LEN];
unsigned n, maxpow;
herr_t ret_value = SUCCEED; /* Return value */
@@ -128,7 +128,10 @@ H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, haddr_t *sig_add
FUNC_ENTER_NOAPI_NOINIT
/* Find the least N such that 2^N is larger than the file size */
- if(HADDR_UNDEF == (addr = H5FD_get_eof(file)) || HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER)))
+ eof = H5FD_get_eof(file, H5FD_MEM_SUPER);
+ eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER);
+ addr = MAX(eof, eoa);
+ if(HADDR_UNDEF == addr)
HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to obtain EOF/EOA value")
for(maxpow = 0; addr; maxpow++)
addr >>= 1;
@@ -348,7 +351,7 @@ done:
*-------------------------------------------------------------------------
*/
haddr_t
-H5FD_get_eof(const H5FD_t *file)
+H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type)
{
haddr_t ret_value;
@@ -358,7 +361,7 @@ H5FD_get_eof(const H5FD_t *file)
/* Dispatch to driver */
if(file->cls->get_eof) {
- if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file)))
+ if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file, type)))
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed")
} /* end if */
else