summaryrefslogtreecommitdiffstats
path: root/src/H5Opkg.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-04-15 19:57:02 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-04-15 19:57:02 (GMT)
commitebd22f7643d53b234b43393d8ede23e0549caa5f (patch)
tree62b13c6ef0f705822fd925687073df7988bd8288 /src/H5Opkg.h
parent227a351e4758ffb0af9882b00831ad6cf1acff3b (diff)
downloadhdf5-ebd22f7643d53b234b43393d8ede23e0549caa5f.zip
hdf5-ebd22f7643d53b234b43393d8ede23e0549caa5f.tar.gz
hdf5-ebd22f7643d53b234b43393d8ede23e0549caa5f.tar.bz2
[svn-r18571] Description:
Bring r18542 from metadata journaling "merging" branch to trunk: Bring new object header pin/unpin & protect/unprotect routines and split-out object header chunk proxy changes from metadata_journaling branch to "merging" branch, along with some other minor tweaks to clean up compiler warnings, etc. Also: clean up chunk protect/unprotect calls when allocating or freeing space in a chunk, optimize metadata accumulator code to avoid some re-reading of information from the file, refactor H5O_pin/H5O_unpin from way they are done on the merging branch back to way they were previously done on trunk, other minor code cleanups, etc. Tested on FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/64-amd64 2.6 (amani) 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 debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5Opkg.h')
-rw-r--r--src/H5Opkg.h72
1 files changed, 66 insertions, 6 deletions
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 3d0e627..4091944 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -253,7 +253,6 @@ struct H5O_mesg_t {
};
typedef struct H5O_chunk_t {
- hbool_t dirty; /*dirty flag */
haddr_t addr; /*chunk file address */
size_t size; /*chunk size */
size_t gap; /*space at end of chunk too small for null message */
@@ -268,9 +267,6 @@ struct H5O_t {
size_t sizeof_size; /* Size of file sizes */
size_t sizeof_addr; /* Size of file addresses */
- /* Misc. information (not stored) */
- unsigned npins; /* Number of times the header is pinned */
-
/* Debugging information (not stored) */
#ifdef H5O_ENABLE_BAD_MESG_COUNT
hbool_t store_bad_mesg_count; /* Flag to indicate that a bad message count should be stored */
@@ -282,6 +278,12 @@ struct H5O_t {
size_t ndecode_dirtied; /* Number of messages dirtied by decoding */
#endif /* NDEBUG */
+ /* Chunk management information (not stored) */
+ size_t rc; /* Reference count of [continuation] chunks using this structure */
+ size_t chunk0_size; /* Size of serialized first chunk */
+ hbool_t mesgs_modified; /* Whether any messages were modified when the object header was deserialized */
+ hbool_t prefix_modified; /* Whether prefix was modified when the object header was deserialized */
+
/* Object information (stored) */
hbool_t has_refcount_msg; /* Whether the object has a ref. count message */
unsigned nlink; /*link count */
@@ -332,10 +334,55 @@ typedef struct H5O_addr_map_t {
hsize_t inc_ref_count; /* Number of deferred increments to reference count */
} H5O_addr_map_t;
-
-/* H5O inherits cache-like properties from H5AC */
+/* Stack of continuation messages to interpret */
+typedef struct H5O_cont_msgs_t {
+ size_t nmsgs; /* Number of continuation messages found so far */
+ size_t alloc_nmsgs; /* Continuation messages allocated */
+ H5O_cont_t *msgs; /* Array of continuation messages */
+} H5O_cont_msgs_t;
+
+/* Common callback information for loading object header prefix from disk */
+typedef struct H5O_common_cache_ud_t {
+ H5F_t *f; /* Pointer to file for object header/chunk */
+ hid_t dxpl_id; /* DXPL for operation */
+ unsigned file_intent; /* Read/write intent for file */
+ unsigned merged_null_msgs; /* Number of null messages merged together */
+ hbool_t mesgs_modified; /* Whether any messages were modified when the object header was deserialized */
+ H5O_cont_msgs_t *cont_msg_info; /* Pointer to continuation messages to work on */
+} H5O_common_cache_ud_t;
+
+/* Callback information for loading object header prefix from disk */
+typedef struct H5O_cache_ud_t {
+ hbool_t made_attempt; /* Whether the deserialize routine was already attempted */
+ unsigned v1_pfx_nmesgs; /* Number of messages from v1 prefix header */
+ H5O_common_cache_ud_t common; /* Common object header cache callback info */
+} H5O_cache_ud_t;
+
+/* Structure representing each chunk in the cache */
+typedef struct H5O_chunk_proxy_t {
+ H5AC_info_t cache_info; /* Information for metadata cache functions, _must_ be */
+ /* first field in structure */
+
+ H5O_t *oh; /* Object header for this chunk */
+ unsigned chunkno; /* Chunk number for this chunk */
+} H5O_chunk_proxy_t;
+
+/* Callback information for loading object header chunk from disk */
+typedef struct H5O_chk_cache_ud_t {
+ hbool_t decoding; /* Whether the object header is being decoded */
+ H5O_t *oh; /* Object header for this chunk */
+ unsigned chunkno; /* Index of chunk being brought in (for re-loads) */
+ size_t chunk_size; /* Chunk size */
+ H5O_common_cache_ud_t common; /* Common object header cache callback info */
+} H5O_chk_cache_ud_t;
+
+
+/* H5O object header inherits cache-like properties from H5AC */
H5_DLLVAR const H5AC_class_t H5AC_OHDR[1];
+/* H5O object header chunk inherits cache-like properties from H5AC */
+H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1];
+
/* Header message ID to class mapping */
H5_DLLVAR const H5O_msg_class_t *const H5O_msg_class_g[H5O_MSG_TYPES];
@@ -476,6 +523,9 @@ H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh);
H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref);
H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg);
H5_DLL const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh);
+H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted);
+H5_DLL herr_t H5O_inc_rc(H5O_t *oh);
+H5_DLL herr_t H5O_dec_rc(H5O_t *oh);
H5_DLL herr_t H5O_free(H5O_t *oh);
/* Object header message routines */
@@ -498,6 +548,15 @@ H5_DLL void *H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src,
H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type,
const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id);
+/* Object header chunk routines */
+H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx);
+H5_DLL H5O_chunk_proxy_t *H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
+ unsigned idx);
+H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
+ H5O_chunk_proxy_t *chk_proxy, unsigned chk_flags);
+H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx);
+H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx);
+
/* Collect storage info for btree and heap */
H5_DLL herr_t H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
H5_ih_info_t *bh_info);
@@ -544,6 +603,7 @@ H5_DLL htri_t H5O_is_attr_dense_test(hid_t oid);
H5_DLL herr_t H5O_num_attrs_test(hid_t oid, hsize_t *nattrs);
H5_DLL herr_t H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count);
H5_DLL herr_t H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val);
+H5_DLL herr_t H5O_expunge_chunks_test(const H5O_loc_t *oloc, hid_t dxpl_id);
#endif /* H5O_TESTING */
/* Object header debugging routines */