diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-06 14:40:36 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-06 14:40:36 (GMT) |
commit | 2f0dd6b2495428fc923a5c16fe02c33af509b396 (patch) | |
tree | ad5716331bd67eddd51204914e451adffae19e9d /src/H5Dcompact.c | |
parent | 53f99e09662bdfe282b940a7111e4336ec14fed2 (diff) | |
download | hdf5-2f0dd6b2495428fc923a5c16fe02c33af509b396.zip hdf5-2f0dd6b2495428fc923a5c16fe02c33af509b396.tar.gz hdf5-2f0dd6b2495428fc923a5c16fe02c33af509b396.tar.bz2 |
[svn-r17306] Description:
Stabilize file format changes for layout object header message and add
new "storage" object header message. This version of the layout message
(& future ones) will contain the constant information for a dataset's layout
and the new storage message will contain information that can change over the
course of a dataset's lifetime.
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
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5Dcompact.c')
-rw-r--r-- | src/H5Dcompact.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 831ab13..a33a62e 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -192,7 +192,10 @@ H5D_compact_construct(H5F_t *f, H5D_t *dset) /* Verify data size is smaller than maximum header message size * (64KB) minus other layout message fields. */ - max_comp_data_size = H5O_MESG_MAX_SIZE - H5D_layout_meta_size(f, &(dset->shared->layout), FALSE); + if(dset->shared->layout.version < H5O_LAYOUT_VERSION_4) + max_comp_data_size = H5O_MESG_MAX_SIZE - H5D_layout_meta_size(f, &(dset->shared->layout), FALSE); + else + max_comp_data_size = H5O_MESG_MAX_SIZE - H5O_storage_meta_size(f, &(dset->shared->layout.storage), FALSE); if(dset->shared->layout.storage.u.compact.size > max_comp_data_size) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "compact dataset size is bigger than header message maximum size") @@ -358,8 +361,15 @@ H5D_compact_flush(H5D_t *dset, hid_t dxpl_id, unsigned UNUSED flags) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { - if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + /* Check whether compact data is storage in layout or storage message */ + if(dset->shared->layout.version < H5O_LAYOUT_VERSION_4) { + if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + } /* end if */ + else { + if(H5O_msg_write(&(dset->oloc), H5O_STORAGE_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout.storage), dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") + } /* end else */ dset->shared->layout.storage.u.compact.dirty = FALSE; } /* end if */ |