summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-03-12 14:02:15 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2018-03-12 14:02:15 (GMT)
commitf08b8fa10e7bac5ae26e3b06f938d38ebb3f28e1 (patch)
treed62da3d18d831ff7c717d716c627eebd3dbc2f1b /src/H5Fint.c
parent8ba788ca891f56792bbbbc5a40f9bc2e86a663b5 (diff)
downloadhdf5-f08b8fa10e7bac5ae26e3b06f938d38ebb3f28e1.zip
hdf5-f08b8fa10e7bac5ae26e3b06f938d38ebb3f28e1.tar.gz
hdf5-f08b8fa10e7bac5ae26e3b06f938d38ebb3f28e1.tar.bz2
Enhancement to the tool h5clear (HDFFV-10360)
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index c41453a..24eb761 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -124,7 +124,6 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref)
H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */
hbool_t driver_prop_copied = FALSE; /* Whether the driver property has been set up */
unsigned efc_size = 0;
- hbool_t latest_format = FALSE; /* Always use the latest format? */
hid_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -820,7 +819,6 @@ H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t
else {
H5P_genplist_t *plist; /* Property list */
unsigned efc_size; /* External file cache size */
- hbool_t latest_format; /* Always use the latest format? */
size_t u; /* Local index variable */
HDassert(lf != NULL);
@@ -1602,7 +1600,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id,
} /* end if */
else if (1 == shared->nrefs) {
/* Read the superblock if it hasn't been read before. */
- if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, TRUE) < 0)
+ if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, fapl_id, TRUE) < 0)
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
/* Create the page buffer before initializing the superblock */
@@ -2912,6 +2910,43 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__set_paged_aggr() */
+/*-------------------------------------------------------------------------
+ * Function: H5F__get_max_eof_eoa
+ *
+ * Purpose: Determine the maximum of (EOA, EOF) for the file
+ *
+ * Return: Non-negative on success/Negative on failure
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa)
+{
+ haddr_t eof; /* Relative address for EOF */
+ haddr_t eoa; /* Relative address for EOA */
+ haddr_t tmp_max;
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_PACKAGE
+
+ /* Sanity checks */
+ HDassert(f);
+ HDassert(f->shared);
+
+ /* Get the relative EOA and EOF */
+ eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT);
+ eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT);
+
+ /* Determine the maximum */
+ tmp_max = MAX(eof, eoa);
+ if(HADDR_UNDEF == tmp_max)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof/eoa requests failed")
+
+ *max_eof_eoa = tmp_max;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F__get_max_eof_eoa() */
+
#ifdef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------