summaryrefslogtreecommitdiffstats
path: root/src/H5Oprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Oprivate.h')
-rw-r--r--src/H5Oprivate.h136
1 files changed, 106 insertions, 30 deletions
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index fa779bf..5636243 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -79,6 +79,7 @@ typedef struct H5O_t H5O_t;
/* Flags for updating messages */
#define H5O_UPDATE_TIME 0x01u
+#define H5O_UPDATE_FORCE 0x02u /* Force updating the message */
/* Hash value constants */
#define H5O_HASH_SIZE 32
@@ -87,6 +88,8 @@ typedef struct H5O_t H5O_t;
#define H5O_CRT_ATTR_MAX_COMPACT_NAME "max compact attr" /* Max. # of attributes to store compactly */
#define H5O_CRT_ATTR_MIN_DENSE_NAME "min dense attr" /* Min. # of attributes to store densely */
#define H5O_CRT_OHDR_FLAGS_NAME "object header flags" /* Object header flags */
+#define H5O_CRT_PIPELINE_NAME "pline" /* Filter pipeline */
+#define H5O_CRT_PIPELINE_DEF {{0, NULL, H5O_NULL_ID, {{0, HADDR_UNDEF}}}, H5O_PLINE_VERSION_1, 0, 0, NULL}
#ifdef H5O_ENABLE_BOGUS
#define H5O_BOGUS_MSG_FLAGS_NAME "bogus msg flags" /* Flags for 'bogus' message */
#define H5O_BOGUS_MSG_FLAGS_SIZE sizeof(uint8_t)
@@ -164,7 +167,8 @@ typedef struct H5O_copy_t {
#define H5O_DRVINFO_ID 0x0014 /* Driver info message. */
#define H5O_AINFO_ID 0x0015 /* Attribute info message. */
#define H5O_REFCOUNT_ID 0x0016 /* Reference count message. */
-#define H5O_UNKNOWN_ID 0x0017 /* Placeholder message ID for unknown message. */
+#define H5O_FSINFO_ID 0x0017 /* Free-space manager info message. */
+#define H5O_UNKNOWN_ID 0x0018 /* Placeholder message ID for unknown message. */
/* (this should never exist in a file) */
@@ -320,45 +324,88 @@ typedef struct H5O_efl_t {
H5O_efl_entry_t *slot; /*array of external file entries */
} H5O_efl_t;
+
/*
* Data Layout Message.
- * (Data structure in memory)
+ * (Data structure in file)
*/
#define H5O_LAYOUT_NDIMS (H5S_MAX_RANK+1)
+/* Initial version of the layout information. Used when space is allocated */
+#define H5O_LAYOUT_VERSION_1 1
+
+/* This version added support for delaying allocation */
+#define H5O_LAYOUT_VERSION_2 2
+
+/* This version is revised to store just the information needed for each
+ * storage type, and to straighten out problems with contiguous layout's
+ * sizes (was encoding them as 4-byte values when they were really n-byte
+ * values (where n usually is 8)).
+ */
+#define H5O_LAYOUT_VERSION_3 3
+
+/* This version adds different types of indices to chunked datasets */
+#define H5O_LAYOUT_VERSION_4 4
+
+/* The latest version of the format. Look through the 'encode'
+ * and 'size' callbacks for places to change when updating this. */
+#define H5O_LAYOUT_VERSION_LATEST H5O_LAYOUT_VERSION_4
+
+
/* Forward declaration of structs used below */
struct H5D_layout_ops_t; /* Defined in H5Dpkg.h */
struct H5D_chunk_ops_t; /* Defined in H5Dpkg.h */
-typedef struct H5O_layout_contig_t {
+typedef struct H5O_storage_contig_t {
haddr_t addr; /* File address of data */
hsize_t size; /* Size of data in bytes */
-} H5O_layout_contig_t;
+} H5O_storage_contig_t;
+
+typedef struct H5O_storage_chunk_btree_t {
+ H5RC_t *shared; /* Ref-counted shared info for B-tree nodes */
+} H5O_storage_chunk_btree_t;
+
+typedef struct H5O_storage_chunk_t {
+ H5D_chunk_index_t idx_type; /* Type of chunk index */
+ haddr_t idx_addr; /* File address of chunk index */
+ const struct H5D_chunk_ops_t *ops; /* Pointer to chunked storage operations */
+ union {
+ H5O_storage_chunk_btree_t btree; /* Information for v1 B-tree index */
+ } u;
+} H5O_storage_chunk_t;
+
+typedef struct H5O_storage_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_storage_compact_t;
+
+typedef struct H5O_storage_t {
+ H5D_layout_t type; /* Type of layout */
+ union {
+ H5O_storage_contig_t contig; /* Information for contiguous storage */
+ H5O_storage_chunk_t chunk; /* Information for chunked storage */
+ H5O_storage_compact_t compact; /* Information for compact storage */
+ } u;
+} H5O_storage_t;
typedef struct H5O_layout_chunk_t {
- haddr_t addr; /* File address of B-tree */
unsigned ndims; /* Num dimensions in chunk */
uint32_t dim[H5O_LAYOUT_NDIMS]; /* Size of chunk in elements */
uint32_t size; /* Size of chunk in bytes */
- H5RC_t *btree_shared; /* Ref-counted info for B-tree nodes */
- const struct H5D_chunk_ops_t *ops; /* Pointer to chunked layout operations */
+ hsize_t nchunks; /* Number of chunks in dataset */
+ hsize_t chunks[H5O_LAYOUT_NDIMS]; /* # of chunks in dataset dimensions */
+ hsize_t down_chunks[H5O_LAYOUT_NDIMS]; /* "down" size of number of chunks in each dimension */
} 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 {
H5D_layout_t type; /* Type of layout */
unsigned version; /* Version of message */
const struct H5D_layout_ops_t *ops; /* Pointer to data layout I/O operations */
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_storage_t storage; /* Information for storing dataset elements */
} H5O_layout_t;
/* Enable reading/writing "bogus" messages */
@@ -403,6 +450,20 @@ typedef struct H5O_ginfo_t {
* Filter pipeline message.
* (Data structure in memory)
*/
+
+/* The initial version of the format */
+#define H5O_PLINE_VERSION_1 1
+
+/* This version encodes the message fields more efficiently */
+/* (Drops the reserved bytes, doesn't align the name and doesn't encode the
+ * filter name at all if it's a filter provided by the library)
+ */
+#define H5O_PLINE_VERSION_2 2
+
+/* The latest version of the format. Look through the 'encode' and 'size'
+ * callbacks for places to change when updating this. */
+#define H5O_PLINE_VERSION_LATEST H5O_PLINE_VERSION_2
+
typedef struct H5O_pline_t {
H5O_shared_t sh_loc; /* Shared message info (must be first) */
@@ -507,6 +568,17 @@ typedef uint32_t H5O_refcount_t; /* Contains # of links to object, if >1
*/
typedef unsigned H5O_unknown_t; /* Original message type ID */
+/*
+ * Free space manager info Message.
+ * Contains file space management info and
+ * addresses of free space managers for file memory
+ * (Data structure in memory)
+ */
+typedef struct H5O_fsinfo_t {
+ H5F_file_space_type_t strategy; /* File space strategy */
+ hsize_t threshold; /* Free space section threshold */
+ haddr_t fs_addr[H5FD_MEM_NTYPES-1]; /* Addresses of free space managers */
+} H5O_fsinfo_t;
/* Typedef for "application" iteration operations */
typedef herr_t (*H5O_operator_t)(const void *mesg/*in*/, unsigned idx,
@@ -517,11 +589,13 @@ typedef herr_t (*H5O_lib_operator_t)(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/,
unsigned sequence, hbool_t *oh_modified/*out*/, void *operator_data/*in,out*/);
/* Some syntactic sugar to make the compiler happy with two different kinds of iterator callbacks */
+typedef enum H5O_mesg_operator_type_t {
+ H5O_MESG_OP_APP, /* Application callback */
+ H5O_MESG_OP_LIB /* Library internal callback */
+} H5O_mesg_operator_type_t;
+
typedef struct {
- enum {
- H5O_MESG_OP_APP, /* Application callback */
- H5O_MESG_OP_LIB /* Library internal callback */
- } op_type;
+ H5O_mesg_operator_type_t op_type;
union {
H5O_operator_t app_op; /* Application callback for each message */
H5O_lib_operator_t lib_op; /* Library internal callback for each message */
@@ -546,8 +620,9 @@ H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint,
H5_DLL herr_t H5O_open(H5O_loc_t *loc);
H5_DLL herr_t H5O_close(H5O_loc_t *loc);
H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id);
-H5_DLL H5O_t *H5O_protect(H5O_loc_t *loc, hid_t dxpl_id);
-H5_DLL herr_t H5O_unprotect(H5O_loc_t *loc, H5O_t *oh);
+H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags);
+H5_DLL H5O_t *H5O_pin(H5O_loc_t *loc, hid_t dxpl_id);
+H5_DLL herr_t H5O_unpin(H5O_loc_t *loc, H5O_t *oh);
H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id);
H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
hbool_t force);
@@ -555,11 +630,12 @@ H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags);
#endif /* H5O_ENABLE_BOGUS */
H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr);
+H5_DLL herr_t H5O_get_hdr_info(const H5O_loc_t *oloc, hid_t dxpl_id, H5O_hdr_info_t *hdr);
H5_DLL herr_t H5O_get_info(const H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info,
H5O_info_t *oinfo);
H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id);
H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, struct H5P_genplist_t *oc_plist);
-H5_DLL hid_t H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id);
+H5_DLL hid_t H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hbool_t app_ref);
H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks);
H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id);
H5_DLL haddr_t H5O_get_oh_addr(const H5O_t *oh);
@@ -576,11 +652,14 @@ H5_DLL herr_t H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg);
H5_DLL void *H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg,
hid_t dxpl_id);
+H5_DLL void *H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id,
+ void *mesg);
H5_DLL herr_t H5O_msg_reset(unsigned type_id, void *native);
H5_DLL void *H5O_msg_free(unsigned type_id, void *mesg);
H5_DLL void *H5O_msg_copy(unsigned type_id, const void *mesg, void *dst);
H5_DLL int H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id);
H5_DLL htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id);
+H5_DLL htri_t H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id);
H5_DLL herr_t H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence,
hbool_t adj_link, hid_t dxpl_id);
H5_DLL herr_t H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence,
@@ -603,8 +682,8 @@ H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg,
H5O_msg_crt_idx_t *crt_idx);
H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared,
unsigned char *buf, const void *obj);
-H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, unsigned type_id,
- const unsigned char *buf);
+H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
+ unsigned type_id, const unsigned char *buf);
H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
unsigned type_id, void *mesg);
@@ -626,9 +705,6 @@ H5_DLL herr_t H5O_loc_copy(H5O_loc_t *dst, const H5O_loc_t *src, H5_copy_depth_t
H5_DLL herr_t H5O_loc_hold_file(H5O_loc_t *loc);
H5_DLL herr_t H5O_loc_free(H5O_loc_t *loc);
-/* Layout operators */
-H5_DLL size_t H5O_layout_meta_size(const H5F_t *f, const void *_mesg);
-
/* EFL operators */
H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl);
@@ -641,11 +717,11 @@ H5_DLL herr_t H5O_fill_set_latest_version(H5O_fill_t *fill);
H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
void *_mesg);
+/* Filter pipeline operators */
+H5_DLL herr_t H5O_pline_set_latest_version(H5O_pline_t *pline);
+
/* Shared message operators */
H5_DLL herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src);
-/* Attribute operators */
-H5_DLL hsize_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh);
-
#endif /* _H5Oprivate_H */