summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5O.c2
-rw-r--r--src/H5Ocache.c18
-rw-r--r--src/H5Opkg.h16
-rw-r--r--src/H5Opublic.h3
-rwxr-xr-xsrc/H5Pocpl.c2
5 files changed, 30 insertions, 11 deletions
diff --git a/src/H5O.c b/src/H5O.c
index 52610cf..48ee26e 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -686,6 +686,8 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id,
oh->corder_bt2_addr = HADDR_UNDEF;
/* Check for non-default attribute storage phase change values */
+ if(oh->max_compact != H5O_CRT_ATTR_MAX_COMPACT_DEF || oh->min_dense != H5O_CRT_ATTR_MIN_DENSE_DEF)
+ oh->flags |= H5O_HDR_ATTR_STORE_PHASE_CHANGE;
} /* end if */
else {
/* Flags */
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 7d096d5..c4430e6 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -49,7 +49,7 @@
#define H5O_SPEC_READ_SIZE 512
/* All the object header status flags that this version of the library knows about */
-#define H5O_HDR_ALL_FLAGS (H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_STORE_TIMES)
+#define H5O_HDR_ALL_FLAGS (H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_ATTR_STORE_PHASE_CHANGE | H5O_HDR_STORE_TIMES)
/******************/
@@ -314,8 +314,14 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1,
oh->atime = oh->mtime = oh->ctime = oh->btime = 0;
/* Attribute fields */
- UINT16DECODE(p, oh->max_compact);
- UINT16DECODE(p, oh->min_dense);
+ if(oh->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) {
+ UINT16DECODE(p, oh->max_compact);
+ UINT16DECODE(p, oh->min_dense);
+ } /* end if */
+ else {
+ oh->max_compact = H5O_CRT_ATTR_MAX_COMPACT_DEF;
+ oh->min_dense = H5O_CRT_ATTR_MIN_DENSE_DEF;
+ } /* end else */
H5F_DECODE_LENGTH(f, p, oh->nattrs);
H5F_addr_decode(f, &p, &(oh->attr_fheap_addr));
H5F_addr_decode(f, &p, &(oh->name_bt2_addr));
@@ -661,8 +667,10 @@ H5O_assert(oh);
} /* end if */
/* Attribute fields */
- UINT16ENCODE(p, oh->max_compact);
- UINT16ENCODE(p, oh->min_dense);
+ if(oh->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) {
+ UINT16ENCODE(p, oh->max_compact);
+ UINT16ENCODE(p, oh->min_dense);
+ } /* end if */
H5F_ENCODE_LENGTH(f, p, oh->nattrs);
H5F_addr_encode(f, &p, oh->attr_fheap_addr);
H5F_addr_encode(f, &p, oh->name_bt2_addr);
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index d8a6fd2..e3626fe 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -78,7 +78,15 @@
/* Size of checksum (on disk) */
#define H5O_SIZEOF_CHKSUM 4
-/* Default value for object header status flags */
+/* ========= Object Creation properties ============ */
+/* Default values for some of the object creation properties */
+/* NOTE: The H5O_CRT_ATTR_MAX_COMPACT_DEF & H5O_CRT_ATTR_MIN_DENSE_DEF values
+ * are "built into" the file format, make certain existing files with
+ * default attribute phase change storage are handled correctly if they
+ * are changed.
+ */
+#define H5O_CRT_ATTR_MAX_COMPACT_DEF 8
+#define H5O_CRT_ATTR_MIN_DENSE_DEF 6
#define H5O_CRT_OHDR_FLAGS_DEF H5O_HDR_STORE_TIMES
/*
@@ -104,8 +112,10 @@
4 + /*change time */ \
4 /*birth time */ \
) : 0) + \
- 2 + /*max compact attributes */ \
- 2 + /*min dense attributes */ \
+ (((O)->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) ? ( \
+ 2 + /*max compact attributes */ \
+ 2 /*min dense attributes */ \
+ ) : 0) + \
(O)->sizeof_size + /*# of attributes */ \
(O)->sizeof_addr + /*addr of attribute heap */ \
(O)->sizeof_addr + /*addr of attribute name index */ \
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index 0e64a93..73c4581 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -63,7 +63,8 @@
/* Object header status flag definitions */
#define H5O_HDR_ATTR_CRT_ORDER_TRACKED 0x01 /* Attribute creation order is tracked */
#define H5O_HDR_ATTR_CRT_ORDER_INDEXED 0x02 /* Attribute creation order has index */
-#define H5O_HDR_STORE_TIMES 0x04 /* Store access, modification, change & birth times for object */
+#define H5O_HDR_ATTR_STORE_PHASE_CHANGE 0x04 /* Non-default attribute storage phase change values stored */
+#define H5O_HDR_STORE_TIMES 0x08 /* Store access, modification, change & birth times for object */
/* Maximum shared message values. Number of indexes is 8 to allow room to add
* new types of messages.
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index 974a6a0..726e41d 100755
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -48,10 +48,8 @@
/* ========= Object Creation properties ============ */
/* Definitions for the max. # of attributes to store compactly */
#define H5O_CRT_ATTR_MAX_COMPACT_SIZE sizeof(unsigned)
-#define H5O_CRT_ATTR_MAX_COMPACT_DEF 8
/* Definitions for the min. # of attributes to store densely */
#define H5O_CRT_ATTR_MIN_DENSE_SIZE sizeof(unsigned)
-#define H5O_CRT_ATTR_MIN_DENSE_DEF 6
/* Definitions for object header flags */
#define H5O_CRT_OHDR_FLAGS_SIZE sizeof(uint8_t)