summaryrefslogtreecommitdiffstats
path: root/src/H5EAcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-11-18 03:42:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-11-18 03:42:13 (GMT)
commita19434caa09bce8d1d7cdc97911b35b3201c8d4e (patch)
tree4903b5a03996f8e1f6802f6725634d5929d80634 /src/H5EAcache.c
parenta28e8407cf5a526a20ad682382f0faed58aace76 (diff)
downloadhdf5-a19434caa09bce8d1d7cdc97911b35b3201c8d4e.zip
hdf5-a19434caa09bce8d1d7cdc97911b35b3201c8d4e.tar.gz
hdf5-a19434caa09bce8d1d7cdc97911b35b3201c8d4e.tar.bz2
[svn-r16094] Description:
Add initial support for data block 'page init' bitmasks to super blocks. Tested on: Mac OS X/32 10.5.5 (amazon) in debug mode Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode 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 production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5EAcache.c')
-rw-r--r--src/H5EAcache.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index b8b5786..2590edc 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -896,6 +896,7 @@ H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
+ size_t u; /* Local index variable */
/* Sanity check */
HDassert(f);
@@ -951,15 +952,19 @@ H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
/* Internal information */
- /* Decode data block addresses */
- if(sblock->ndblks > 0) {
- size_t u; /* Local index variable */
+ /* Check for 'page init' bitmasks for this super block */
+ if(sblock->dblk_npages > 0) {
+ size_t tot_page_init_size = sblock->ndblks * sblock->dblk_page_init_size; /* Compute total size of 'page init' buffer */
- /* Decode addresses of data blocks in super block */
- for(u = 0; u < sblock->ndblks; u++)
- H5F_addr_decode(f, &p, &sblock->dblk_addrs[u]);
+ /* Retrieve the 'page init' bitmasks */
+ HDmemcpy(sblock->page_init, p, tot_page_init_size);
+ p += tot_page_init_size;
} /* end if */
+ /* Decode data block addresses */
+ for(u = 0; u < sblock->ndblks; u++)
+ H5F_addr_decode(f, &p, &sblock->dblk_addrs[u]);
+
/* Sanity check */
/* (allow for checksum not decoded yet) */
HDassert((size_t)(p - buf) == (size - H5EA_SIZEOF_CHKSUM));
@@ -1028,6 +1033,7 @@ H5EA__cache_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
uint8_t *p; /* Pointer into raw data buffer */
size_t size; /* Index block size on disk */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ size_t u; /* Local index variable */
/* Wrap the local buffer for serialized info */
if(NULL == (wb = H5WB_wrap(ser_buf, sizeof(ser_buf))))
@@ -1061,15 +1067,19 @@ H5EA__cache_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
/* Internal information */
- /* Encode data block addresses */
- if(sblock->ndblks > 0) {
- size_t u; /* Local index variable */
+ /* Check for 'page init' bitmasks for this super block */
+ if(sblock->dblk_npages > 0) {
+ size_t tot_page_init_size = sblock->ndblks * sblock->dblk_page_init_size; /* Compute total size of 'page init' buffer */
- /* Encode addresses of data blocks in super block */
- for(u = 0; u < sblock->ndblks; u++)
- H5F_addr_encode(f, &p, sblock->dblk_addrs[u]);
+ /* Store the 'page init' bitmasks */
+ HDmemcpy(p, sblock->page_init, tot_page_init_size);
+ p += tot_page_init_size;
} /* end if */
+ /* Encode addresses of data blocks in super block */
+ for(u = 0; u < sblock->ndblks; u++)
+ H5F_addr_encode(f, &p, sblock->dblk_addrs[u]);
+
/* Compute metadata checksum */
metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0);