summaryrefslogtreecommitdiffstats
path: root/src/H5EApkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-11-11 23:30:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-11-11 23:30:37 (GMT)
commit164a8426ea4d10ba2bca71d0a91dacec72cd79e9 (patch)
tree707ee57516158c4d821bb1f78e365c95069371a3 /src/H5EApkg.h
parent05e559c9ec89fc50e7b6b03b5109c22adeb2bfc9 (diff)
downloadhdf5-164a8426ea4d10ba2bca71d0a91dacec72cd79e9.zip
hdf5-164a8426ea4d10ba2bca71d0a91dacec72cd79e9.tar.gz
hdf5-164a8426ea4d10ba2bca71d0a91dacec72cd79e9.tar.bz2
[svn-r16061] Description:
Store extra information about each block in the metadata for the block, in the hope that a corrupted file will be easier to recover. (Similar to the information stored for fractal heaps) 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/H5EApkg.h')
-rw-r--r--src/H5EApkg.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/H5EApkg.h b/src/H5EApkg.h
index 2c0930c..9fded70 100644
--- a/src/H5EApkg.h
+++ b/src/H5EApkg.h
@@ -386,6 +386,7 @@ func_init_failed: \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
/* Extensible Array Index Block specific fields */ \
+ + (i)->hdr->sizeof_addr /* File address of array owning the block */ \
+ ((size_t)(i)->hdr->cparam.idx_blk_elmts * (size_t)(i)->hdr->cparam.raw_elmt_size) /* Elements in index block */ \
+ ((i)->ndblk_addrs * (i)->hdr->sizeof_addr) /* Data block addresses in index block */ \
+ ((i)->nsblk_addrs * (i)->hdr->sizeof_addr) /* Super block addresses in index block */ \
@@ -397,6 +398,8 @@ func_init_failed: \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
/* Extensible Array Super Block specific fields */ \
+ + (s)->hdr->sizeof_addr /* File address of array owning the block */ \
+ + (s)->hdr->arr_off_size /* Offset of the block in the array */ \
+ ((s)->ndblks * (s)->hdr->sizeof_addr) /* Data block addresses in super block */ \
)
@@ -406,9 +409,14 @@ func_init_failed: \
H5EA_METADATA_PREFIX_SIZE(TRUE) \
\
/* Extensible Array Data Block specific fields */ \
+ + (d)->hdr->sizeof_addr /* File address of array owning the block */ \
+ + (d)->hdr->arr_off_size /* Offset of the block in the array */ \
+ ((d)->nelmts * (size_t)(d)->hdr->cparam.raw_elmt_size) /* Elements in index block */ \
)
+/* Compute the # of bytes required to store an offset into a given buffer size */
+#define H5EA_SIZEOF_OFFSET_BITS(b) (((b) + 7) / 8)
+
/****************************/
/* Package Private Typedefs */
@@ -454,6 +462,7 @@ typedef struct H5EA_hdr_t {
hbool_t pending_delete; /* Array is pending deletion */
size_t sizeof_addr; /* Size of file addresses */
size_t sizeof_size; /* Size of file sizes */
+ unsigned char arr_off_size; /* Size of array offsets (in bytes) */
/* Super block information (not stored) */
size_t nsblks; /* Number of superblocks needed for array */
@@ -488,6 +497,7 @@ typedef struct H5EA_sblock_t {
H5AC_info_t cache_info;
/* Extensible array information (stored) */
+ hsize_t block_off; /* Offset of the block within the array's address space */
haddr_t *dblk_addrs; /* Buffer for addresses of data blocks in super block */
/* Internal array information (not stored) */
@@ -508,6 +518,7 @@ typedef struct H5EA_dblock_t {
H5AC_info_t cache_info;
/* Extensible array information (stored) */
+ hsize_t block_off; /* Offset of the block within the array's address space */
void *elmts; /* Buffer for elements stored in data block */
/* Internal array information (not stored) */
@@ -590,7 +601,7 @@ H5_DLL herr_t H5EA__sblock_dest(H5F_t *f, H5EA_sblock_t *sblock);
/* Data block routines */
H5_DLL H5EA_dblock_t *H5EA__dblock_alloc(H5EA_hdr_t *hdr, size_t nelmts);
H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id,
- size_t nelmts);
+ hsize_t dblk_off, size_t nelmts);
H5_DLL unsigned H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx);
H5_DLL H5EA_dblock_t *H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id,
haddr_t dblk_addr, size_t dblk_nelmts, H5AC_protect_t rw);