diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2015-11-13 04:26:56 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2015-11-13 04:26:56 (GMT) |
commit | 1b58261bc5ea9a2de1f17014f0a3292ad128bd0e (patch) | |
tree | c812b96ae6c5e5e53da0c43d1278999401be9bd4 /src/H5Fsuper.c | |
parent | 41a03ad8ed11cda8eb26d1cdf10b56f7e8d4cfb6 (diff) | |
download | hdf5-1b58261bc5ea9a2de1f17014f0a3292ad128bd0e.zip hdf5-1b58261bc5ea9a2de1f17014f0a3292ad128bd0e.tar.gz hdf5-1b58261bc5ea9a2de1f17014f0a3292ad128bd0e.tar.bz2 |
[svn-r28330] Implementation for version 3 superblock and latest version support.
Tested on quail, kite, osx1010test, platypus, ostrich, moohan, emu, jam.
Diffstat (limited to 'src/H5Fsuper.c')
-rw-r--r-- | src/H5Fsuper.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index d911dff..916ad13 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -317,6 +317,14 @@ H5F__super_read(H5F_t *f, hid_t dxpl_id, hbool_t initial_read) if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) + if(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_3) + HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "invalid superblock version for SWMR_WRITE") + + /* Enable all latest version support when file has v3 superblock */ + if(sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_3) + f->shared->latest_flags |= H5F_LATEST_ALL_FLAGS; + /* Pin the superblock in the cache */ if(H5AC_pin_protected_entry(sblock) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTPIN, FAIL, "unable to pin superblock") @@ -758,8 +766,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, &sblock->btree_k[0]) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes") - /* Bump superblock version if we are to use the latest version of the format */ - if(f->shared->latest_format) + /* Bump superblock version if latest superblock version support is enabled */ + if(H5F_USE_LATEST_FLAGS(f, H5F_LATEST_SUPERBLOCK)) super_vers = HDF5_SUPERBLOCK_VERSION_LATEST; /* Bump superblock version to create superblock extension for SOHM info */ else if(f->shared->sohm_nindexes > 0) |