diff options
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 */ |