summaryrefslogtreecommitdiffstats
path: root/src/H5Oprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-27 20:26:32 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-27 20:26:32 (GMT)
commit6e6760216bd2dc64bba0976cdf1a1fed5a8fa114 (patch)
tree13235c92a1c3d9be4a8dc988788cb2e383e264eb /src/H5Oprivate.h
parent66be6f05d417671d1ef202931d769743ad8a83d9 (diff)
downloadhdf5-6e6760216bd2dc64bba0976cdf1a1fed5a8fa114.zip
hdf5-6e6760216bd2dc64bba0976cdf1a1fed5a8fa114.tar.gz
hdf5-6e6760216bd2dc64bba0976cdf1a1fed5a8fa114.tar.bz2
[svn-r8592] Purpose:
Code optimization & bug fix Description: When dimension information is being stored in the storage layout message on disk, it is stored as 32-bit quantities, possibly truncating the dimension information, if a dimension is greater than 32-bits in size. Solution: Fix the storage layout message problem by revising file format to not store dimension information, since it is already available in the dataspace. Also revise the storage layout data structures to be more compartmentalized for the information for contiguous, chunked and compact storage. Platforms tested: FreeBSD 4.9 (sleipnir) w/parallel Solaris 2.7 (arabica) h5committest
Diffstat (limited to 'src/H5Oprivate.h')
-rw-r--r--src/H5Oprivate.h46
1 files changed, 35 insertions, 11 deletions
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 6dd8a79..574c516 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -48,17 +48,20 @@
/* Flags which are part of a message */
#define H5O_FLAG_CONSTANT 0x01u
#define H5O_FLAG_SHARED 0x02u
-#define H5O_FLAG_BITS 0x03u
+#define H5O_FLAG_BITS (H5O_FLAG_CONSTANT|H5O_FLAG_SHARED)
/* Header message IDs */
#define H5O_NULL_ID 0x0000 /* Null Message. */
#define H5O_SDSPACE_ID 0x0001 /* Simple Dataspace Message. */
+/* Complex dataspace is/was planned for message 0x0002 */
#define H5O_DTYPE_ID 0x0003 /* Datatype Message. */
#define H5O_FILL_ID 0x0004 /* Fill Value Message. (Old) */
#define H5O_FILL_NEW_ID 0x0005 /* Fill Value Message. (New) */
+/* Compact data storage is/was planned for message 0x0006 */
#define H5O_EFL_ID 0x0007 /* External File List Message */
#define H5O_LAYOUT_ID 0x0008 /* Data Storage Layout Message. */
#define H5O_BOGUS_ID 0x0009 /* "Bogus" Message. */
+/* message 0x000a appears unused... */
#define H5O_PLINE_ID 0x000b /* Filter pipeline message. */
#define H5O_ATTR_ID 0x000c /* Attribute Message. */
#define H5O_NAME_ID 0x000d /* Object name message. */
@@ -68,7 +71,6 @@
#define H5O_STAB_ID 0x0011 /* Symbol table message. */
#define H5O_MTIME_NEW_ID 0x0012 /* Modification time message. (New) */
-
/*
* Fill Value Message. (Old)
* (Data structure in memory)
@@ -102,7 +104,7 @@ typedef struct H5O_fill_new_t {
#define H5O_EFL_UNLIMITED H5F_UNLIMITED /*max possible file size */
typedef struct H5O_efl_entry_t {
- size_t name_offset; /*offset of name within heap */
+ size_t name_offset; /*offset of name within heap */
char *name; /*malloc'd name */
off_t offset; /*offset of data within file */
hsize_t size; /*size allocated within file */
@@ -121,15 +123,37 @@ typedef struct H5O_efl_t {
*/
#define H5O_LAYOUT_NDIMS (H5S_MAX_RANK+1)
+typedef struct H5O_layout_contig_t {
+ haddr_t addr; /* File address of data */
+ hsize_t size; /* Size of data in bytes */
+} H5O_layout_contig_t;
+
+typedef struct H5O_layout_chunk_t {
+ haddr_t addr; /* File address of B-tree */
+ unsigned ndims; /* Num dimensions in chunk */
+ size_t dim[H5O_LAYOUT_NDIMS]; /* Size of chunk in elements */
+ size_t size; /* Size of chunk in bytes */
+} H5O_layout_chunk_t;
+
+typedef struct H5O_layout_compact_t {
+ hbool_t dirty; /* Dirty flag for compact dataset */
+ size_t size; /* Size of buffer in bytes */
+ void *buf; /* Buffer for compact dataset */
+} H5O_layout_compact_t;
+
typedef struct H5O_layout_t {
- int type; /*type of layout, H5D_layout_t */
- haddr_t addr; /*file address of data or B-tree */
- unsigned ndims; /*num dimensions in stored data */
- hsize_t dim[H5O_LAYOUT_NDIMS]; /*size of data or chunk in bytes */
- hsize_t chunk_size; /*size of chunk in bytes */
- hbool_t dirty; /*dirty flag for compact dataset */
- size_t size; /*size of compact dataset in bytes */
- void *buf; /*buffer for compact dataset */
+ H5D_layout_t type; /* Type of layout */
+ unsigned version; /* Version of message */
+ /* Structure for "unused" dimension information */
+ struct {
+ unsigned ndims; /*num dimensions in stored data */
+ hsize_t dim[H5O_LAYOUT_NDIMS]; /*size of data or chunk in bytes */
+ } unused;
+ union {
+ H5O_layout_contig_t contig; /* Information for contiguous layout */
+ H5O_layout_chunk_t chunk; /* Information for chunked layout */
+ H5O_layout_compact_t compact; /* Information for compact layout */
+ } u;
} H5O_layout_t;
/* Enable reading/writing "bogus" messages */