diff options
author | James Laird <jlaird@hdfgroup.org> | 2007-01-18 15:27:14 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2007-01-18 15:27:14 (GMT) |
commit | 26fc682d8d54190199c6e04c415eed7d888d6994 (patch) | |
tree | 7c4ac9be6dff6019261e6015b5772416a4a4ba03 /src/H5Fpkg.h | |
parent | 9155785889af8ae809fb5e9cdbb330710a174d72 (diff) | |
download | hdf5-26fc682d8d54190199c6e04c415eed7d888d6994.zip hdf5-26fc682d8d54190199c6e04c415eed7d888d6994.tar.gz hdf5-26fc682d8d54190199c6e04c415eed7d888d6994.tar.bz2 |
[svn-r13153] Added checksum to superblock and driver info block (in latest version of
superblock).
Tried to standardize sizes and added #defines to H5Fpkg.h so that hopefully
the code is a little easier to read.
Of course this is a file format change.
Tested on Windows, juniper, smirom, kagiso.
Diffstat (limited to 'src/H5Fpkg.h')
-rw-r--r-- | src/H5Fpkg.h | 57 |
1 files changed, 52 insertions, 5 deletions
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 957ec0a..1d6cc3f 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -58,9 +58,58 @@ # undef H5F_DEBUG #endif -/* Maximum size of super-block buffer */ -#define H5F_SUPERBLOCK_SIZE 130 -#define H5F_DRVINFOBLOCK_SIZE 1024 +/* Superblock sizes for various versions */ +/* Checksum size in the file */ +#define H5F_SIZEOF_CHKSUM 4 + +/* Fixed-size portion at the beginning of all superblocks */ +#define H5F_SUPERBLOCK_FIXED_SIZE ( H5F_SIGNATURE_LEN \ + + 3 /* superblock, freespace, and root group versions */ \ + + 1 /* reserved */ \ + + 3 /* shared header vers, size of address, size of lengths */ \ + + 1 /* reserved */ \ + + 4 /* group leaf k, group internal k */ \ + + 4) /* consistency flags */ + +#define H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) \ + ( H5F_SIZEOF_ADDR(f) /* base address */ \ + + H5F_SIZEOF_ADDR(f) /* free space address */ \ + + H5F_SIZEOF_ADDR(f) /* EOF address */ \ + + H5F_SIZEOF_ADDR(f) /* driver block address */ \ + + H5G_SIZEOF_ENTRY(f)) /* root group ptr */ + +#define H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) \ + ( 2 /* indexed B-tree internal k */ \ + + 2 /* reserved */ \ + + H5F_SIZEOF_ADDR(f) /* base address */ \ + + H5F_SIZEOF_ADDR(f) /* free space address */ \ + + H5F_SIZEOF_ADDR(f) /* EOF address */ \ + + H5F_SIZEOF_ADDR(f) /* driver block address */ \ + + H5G_SIZEOF_ENTRY(f)) /* root group ptr */ + +#define H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) \ + ( 2 /* indexed B-tree internal k */ \ + + H5F_SIZEOF_ADDR(f) /* base address */ \ + + H5F_SIZEOF_ADDR(f) /* free space address */ \ + + H5F_SIZEOF_ADDR(f) /* shared message table address */ \ + + 2 /* shared message version and number of indexes */ \ + + H5F_SIZEOF_ADDR(f) /* EOF address */ \ + + H5F_SIZEOF_ADDR(f) /* driver block address */ \ + + H5G_SIZEOF_ENTRY(f) /* root group ptr */ \ + + H5F_SIZEOF_CHKSUM) + +#define H5F_SUPERBLOCK_SIZE(v, f) ( H5F_SUPERBLOCK_FIXED_SIZE \ + + (v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(f) : 0) \ + + (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(f) : 0) \ + + (v == 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(f) : 0)) + + +#define H5F_DRVINFOBLOCK_HDR_SIZE 16 +#define H5F_DRVINFO_CHKSUM(v) (v == 0 ? 0 : H5F_SIZEOF_CHKSUM) + +/* Maximum size of super-block buffers */ +#define H5F_MAX_SUPERBLOCK_SIZE 134 +#define H5F_MAX_DRVINFOBLOCK_SIZE 1024 /* Define the HDF5 file signature */ #define H5F_SIGNATURE "\211HDF\r\n\032\n" @@ -98,8 +147,6 @@ typedef struct H5F_file_t { haddr_t driver_addr; /* File driver information block address*/ hbool_t fam_to_sec2; /* Is h5repart changing driver from family to sec2 */ - unsigned super_chksum; /* Superblock checksum */ - unsigned drvr_chksum; /* Driver info block checksum */ H5AC_t *cache; /* The object cache */ H5AC_cache_config_t mdc_initCacheCfg; /* initial configuration for the */ |