summaryrefslogtreecommitdiffstats
path: root/src/H5F.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/H5F.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/H5F.c')
-rw-r--r--src/H5F.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 58ccc37..357897e 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -964,6 +964,8 @@ H5Fget_filesize(hid_t file_id, hsize_t *size)
{
H5F_t *file; /* File object for file ID */
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 */
herr_t ret_value = SUCCEED; /* Return value */
@@ -975,12 +977,15 @@ H5Fget_filesize(hid_t file_id, hsize_t *size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
/* Go get the actual file size */
- if(HADDR_UNDEF == (eof = H5FD_get_eof(file->shared->lf)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size")
+ eof = H5FD_get_eof(file->shared->lf, H5FD_MEM_DEFAULT);
+ eoa = H5FD_get_eoa(file->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(file->shared->lf);
if(size)
- *size = (hsize_t)(eof + base_addr); /* Convert relative base address for file to absolute address */
+ *size = (hsize_t)(max_eof_eoa + base_addr); /* Convert relative base address for file to absolute address */
done:
FUNC_LEAVE_API(ret_value)