diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-01-09 14:51:34 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-01-09 14:51:34 (GMT) |
commit | acabad61facccea62d5d12c76ccb09d107e9062c (patch) | |
tree | a45b4d2c914786e341c403bd506890cde8e15861 /src/H5VLnative.c | |
parent | 992e79b58cf83a75f7567d73d7e7d534750c3d68 (diff) | |
parent | 50c5f1ab2c706e00ec546c4f5a415b4203a5db7e (diff) | |
download | hdf5-acabad61facccea62d5d12c76ccb09d107e9062c.zip hdf5-acabad61facccea62d5d12c76ccb09d107e9062c.tar.gz hdf5-acabad61facccea62d5d12c76ccb09d107e9062c.tar.bz2 |
[svn-r25968] merge from trunk.
Diffstat (limited to 'src/H5VLnative.c')
-rw-r--r-- | src/H5VLnative.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/H5VLnative.c b/src/H5VLnative.c index 61abedb..0d164a8 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -2017,17 +2017,24 @@ H5VL_native_file_optional(void *obj, hid_t dxpl_id, void UNUSED **req, va_list a case H5VL_FILE_GET_SIZE: { haddr_t eof; /* End of file address */ + haddr_t eoa; /* End of allocation address */ + haddr_t max_eof_eoa; /* Maximum of the EOA & EOF */ haddr_t base_addr; /* Base address for the file */ hsize_t *ret = va_arg (arguments, hsize_t *); f = (H5F_t *)obj; + /* Go get the actual file size */ - if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf))) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") + eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT); + eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT); + max_eof_eoa = MAX(eof, eoa); + if(HADDR_UNDEF == max_eof_eoa) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof/eoa requests failed") base_addr = H5FD_get_base_addr(f->shared->lf); if(ret) - *ret = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */ + *ret = (hsize_t)(max_eof_eoa + base_addr); /* Convert relative base address for file to absolute address */ + break; } /* H5Fget_file_image */ |