diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-15 07:03:44 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-15 07:03:44 (GMT) |
commit | 6c5e37a5938f3dc614f908d5d955b3103db4f367 (patch) | |
tree | 26cf3732aac362d9014ae0d9e81bd62767d6fe83 /src/H5FDsec2.c | |
parent | 58067df6c710c92c596ceac6b570f085e69c25d4 (diff) | |
download | hdf5-6c5e37a5938f3dc614f908d5d955b3103db4f367.zip hdf5-6c5e37a5938f3dc614f908d5d955b3103db4f367.tar.gz hdf5-6c5e37a5938f3dc614f908d5d955b3103db4f367.tar.bz2 |
[svn-r17366] Description:
Bring r17346:17365 from trunk to revise_chunks branch
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 (jam) 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 debug 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.c | 42 |
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() */ |