summaryrefslogtreecommitdiffstats
path: root/src/H5FDsec2.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-15 06:26:08 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-15 06:26:08 (GMT)
commit173083e1a5c9696be01bd983dd8c9bb87eb5a433 (patch)
treec8c4aa2dd961d18b48d0c734da3e16ea107e6c6f /src/H5FDsec2.c
parentec7ca0dea2fba8071ce57e4f61d685c3e4d0d111 (diff)
downloadhdf5-173083e1a5c9696be01bd983dd8c9bb87eb5a433.zip
hdf5-173083e1a5c9696be01bd983dd8c9bb87eb5a433.tar.gz
hdf5-173083e1a5c9696be01bd983dd8c9bb87eb5a433.tar.bz2
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5FDsec2.c')
-rw-r--r--src/H5FDsec2.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 35ade20..0b4632d 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -90,6 +90,10 @@ typedef struct H5FD_sec2_t {
DWORD fileindexlo;
DWORD fileindexhi;
#endif
+
+ /* Information from properties set by 'h5repart' tool */
+ hbool_t fam_to_sec2; /* Whether to eliminate the family driver info
+ * and convert this file to a single file */
} H5FD_sec2_t;
@@ -325,8 +329,7 @@ done:
*/
/* ARGSUSED */
static H5FD_t *
-H5FD_sec2_open(const char *name, unsigned flags, hid_t UNUSED fapl_id,
- haddr_t maxaddr)
+H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
{
int o_flags;
int fd=(-1);
@@ -388,8 +391,26 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t UNUSED fapl_id,
#endif
+ /* Check for non-default FAPL */
+ if(H5P_FILE_ACCESS_DEFAULT != fapl_id) {
+ H5P_genplist_t *plist; /* Property list pointer */
+
+ /* Get the FAPL */
+ if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list")
+
+ /* This step is for h5repart tool only. If user wants to change file driver from
+ * family to sec2 while using h5repart, this private property should be set so that
+ * in the later step, the library can ignore the family driver information saved
+ * in the superblock.
+ */
+ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0)
+ if(H5P_get(plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &file->fam_to_sec2) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property of changing family to sec2")
+ } /* end if */
+
/* Set return value */
- ret_value=(H5FD_t*)file;
+ ret_value = (H5FD_t*)file;
done:
if(ret_value==NULL) {
@@ -398,7 +419,7 @@ done:
} /* end if */
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_sec2_open() */
/*-------------------------------------------------------------------------
@@ -516,11 +537,11 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5FD_sec2_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
+H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
{
- herr_t ret_value = SUCCEED; /* Return value */
+ const H5FD_sec2_t *file = (const H5FD_sec2_t*)_file; /* sec2 VFD info */
- FUNC_ENTER_NOAPI(H5FD_sec2_query, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_query)
/* Set the VFL feature flags that this driver supports */
if(flags) {
@@ -529,10 +550,13 @@ H5FD_sec2_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
*flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */
*flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
*flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+
+ /* Check for flags that are set by h5repart */
+ if(file->fam_to_sec2)
+ *flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which eliminates it) */
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FD_sec2_query() */