summaryrefslogtreecommitdiffstats
path: root/src/H5Fpkg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Fpkg.h')
-rw-r--r--src/H5Fpkg.h129
1 files changed, 68 insertions, 61 deletions
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index ff92c98..bedf2f9 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -29,13 +29,11 @@
/* Get package's private header */
#include "H5Fprivate.h"
-/* Other public headers needed by this file */
-#include "H5Bpublic.h" /* B-tree header (for H5B_NUM_BTREE_ID) */
-
/* Other private headers needed by this file */
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5FDprivate.h" /* VFD -- for VFD SWMR */
+#include "H5Bprivate.h" /* B-trees */
#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
#include "H5FSprivate.h" /* File free space */
@@ -140,14 +138,14 @@
/* For superblock version 0 & 1:
Offset to the file consistency flags (status_flags) in the superblock (excluding H5F_SUPERBLOCK_FIXED_SIZE) */
-#define H5F_SUPER_STATUS_OFF_V01 \
- (2 /* 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 */
+#define H5F_SUPER_STATUS_OFF_V01 \
+ (unsigned)(2 /* 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 */
-#define H5F_SUPER_STATUS_OFF(v) (v >= 2 ? 2 : H5F_SUPER_STATUS_OFF_V01)
+#define H5F_SUPER_STATUS_OFF(v) (v >= 2 ? (unsigned)2 : H5F_SUPER_STATUS_OFF_V01)
/* Offset to the file consistency flags (status_flags) in the superblock */
#define H5F_SUPER_STATUS_FLAGS_OFF(v) (H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPER_STATUS_OFF(v))
@@ -239,7 +237,7 @@ typedef struct H5F_vfd_swmr_dl_entry_t {
} H5F_vfd_swmr_dl_entry_t;
/* Structure specifically to store superblock. This was originally
- * maintained entirely within H5F_file_t, but is now extracted
+ * maintained entirely within H5F_shared_t, but is now extracted
* here because the superblock is now handled by the cache */
typedef struct H5F_super_t {
H5AC_info_t cache_info; /* Cache entry information structure */
@@ -257,14 +255,26 @@ typedef struct H5F_super_t {
H5G_entry_t *root_ent; /* Root group symbol table entry */
} H5F_super_t;
+#include "bsdqueue.h"
+
+typedef struct deferred_free {
+ SIMPLEQ_ENTRY(deferred_free) link;
+ H5FD_mem_t alloc_type;
+ haddr_t addr;
+ hsize_t size;
+ uint64_t free_after_tick;
+} deferred_free_t;
+
+typedef SIMPLEQ_HEAD(deferred_free_head, deferred_free) deferred_free_head_t;
+
/*
* Define the structure to store the file information for HDF5 files. One of
* these structures is allocated per file, not per H5Fopen(). That is, set of
- * H5F_t structs can all point to the same H5F_file_t struct. The `nrefs'
+ * H5F_t structs can all point to the same H5F_shared_t struct. The `nrefs'
* count in this struct indicates the number of H5F_t structs which are
* pointing to this struct.
*/
-struct H5F_file_t {
+struct H5F_shared_t {
H5FD_t *lf; /* Lower level file handle for I/O */
H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */
H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info
@@ -316,7 +326,7 @@ struct H5F_file_t {
/* begin on file access/create */
char *mdc_log_location; /* location of mdc log */
hid_t fcpl_id; /* File creation property list ID */
- H5F_close_degree_t fc_degree; /* File close behavior degree */
+ H5F_close_degree_t fc_degree; /* File close behavior degree */
hbool_t evict_on_close; /* If the file's objects should be evicted from the metadata cache on close */
size_t rdcc_nslots; /* Size of raw data chunk cache (slots) */
size_t rdcc_nbytes; /* Size of raw data chunk cache (bytes) */
@@ -333,11 +343,20 @@ struct H5F_file_t {
struct H5G_t *root_grp; /* Open root group */
H5FO_t *open_objs; /* Open objects in file */
H5UC_t *grp_btree_shared; /* Ref-counted group B-tree node info */
+ hbool_t closing; /* File is in the process of being closed */
+
+ /* Cached VOL connector ID & info */
+ hid_t vol_id; /* ID of VOL connector for the container */
+ const H5VL_class_t *vol_cls; /* Pointer to VOL connector class for the container */
+ void *vol_info; /* Copy of VOL connector info for container */
/* File space allocation information */
H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */
hsize_t fs_threshold; /* Free space section threshold */
hbool_t fs_persist; /* Free-space persist or not */
+ unsigned fs_version; /* Free-space version: */
+ /* It is used to update fsinfo message in the superblock
+ extension when closing down the free-space managers */
hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */
haddr_t tmp_addr; /* Next address to use for temp. space in the file */
hbool_t point_of_no_return; /* Flag to indicate that we can't go back and delete a freespace header when it's used up */
@@ -345,14 +364,9 @@ struct H5F_file_t {
H5F_fs_state_t fs_state[H5F_MEM_PAGE_NTYPES]; /* State of free space manager for each type */
haddr_t fs_addr[H5F_MEM_PAGE_NTYPES]; /* Address of free space manager info for each type */
H5FS_t *fs_man[H5F_MEM_PAGE_NTYPES]; /* Free space manager for each file space type */
- hbool_t first_alloc_dealloc; /* TRUE iff free space managers */
- /* are persistent and have not */
- /* been used accessed for either */
- /* allocation or deallocation */
- /* since file open. */
- haddr_t eoa_pre_fsm_fsalloc; /* eoa pre file space allocation */
- /* for self referential FSMs */
- haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */
+ hbool_t null_fsm_addr; /* Used by h5clear tool to tell the library */
+ /* to drop free-space to the floor */
+ haddr_t eoa_fsm_fsalloc; /* eoa after file space allocation */
/* for self referential FSMs */
haddr_t eoa_post_mdci_fsalloc; /* eoa past file space allocation */
/* for metadata cache image, or */
@@ -378,6 +392,7 @@ struct H5F_file_t {
/* Object flush info */
H5F_object_flush_t object_flush; /* Information for object flush callback */
+ hbool_t crt_dset_min_ohdr_flag; /* flag to minimize created dataset object header */
/* VFD SWMR */
@@ -394,7 +409,7 @@ struct H5F_file_t {
*/
uint64_t tick_num; /* Number of the current tick */
struct timespec end_of_tick; /* End time of the current tick */
-
+ deferred_free_head_t deferred_frees; /* For use by VFD SWMR writers. */
/* VFD SWMR metadata file index */
H5FD_vfd_swmr_idx_entry_t * mdf_idx; /* pointer to an array of instance
* of H5FD_vfd_swmr_idx_entry_t of
@@ -457,45 +472,33 @@ struct H5F_file_t {
*/
H5F_vfd_swmr_dl_entry_t *dl_tail_ptr; /* Points to the end of the list */
+ char *extpath; /* Path for searching target external link file */
+
+#ifdef H5_HAVE_PARALLEL
+ H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */
+ hbool_t coll_md_write; /* Do all metadata writes collectively */
+#endif /* H5_HAVE_PARALLEL */
+
};
/*
* This is the top-level file descriptor. One of these structures is
* allocated every time H5Fopen() is called although they may contain pointers
- * to shared H5F_file_t structs.
+ * to shared H5F_shared_t structs.
*/
struct H5F_t {
- char *open_name; /* Name used to open file */
- char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */
- char *extpath; /* Path for searching target external link file */
- H5F_file_t *shared; /* The shared file info */
- unsigned nopen_objs; /* Number of open object headers */
+ char *open_name; /* Name used to open file */
+ char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */
+ H5F_shared_t *shared; /* The shared file info */
+ unsigned nopen_objs; /* Number of open object headers */
H5FO_t *obj_count; /* # of time each object is opened through top file structure */
- hid_t file_id; /* ID of this file */
+ hbool_t id_exists; /* Whether an ID for this struct exists */
hbool_t closing; /* File is in the process of being closed */
struct H5F_t *parent; /* Parent file that this file is mounted to */
unsigned nmounts; /* Number of children mounted to this file */
-#ifdef H5_HAVE_PARALLEL
- H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */
- hbool_t coll_md_write; /* Do all metadata writes collectively */
-#endif /* H5_HAVE_PARALLEL */
};
-/* User data for traversal routine to get ID counts */
-typedef struct {
- ssize_t *obj_count; /* number of objects counted so far */
- unsigned types; /* types of objects to be counted */
-} H5F_trav_obj_cnt_t;
-
-/* User data for traversal routine to get ID lists */
-typedef struct {
- size_t max_objs;
- hid_t *oid_list;
- ssize_t *obj_count; /* number of objects counted so far */
- unsigned types; /* types of objects to be counted */
-} H5F_trav_obj_ids_t;
-
/*****************************/
/* Package Private Variables */
/*****************************/
@@ -503,8 +506,8 @@ typedef struct {
/* Declare a free list to manage the H5F_t struct */
H5FL_EXTERN(H5F_t);
-/* Declare a free list to manage the H5F_file_t struct */
-H5FL_EXTERN(H5F_file_t);
+/* Declare a free list to manage the H5F_shared_t struct */
+H5FL_EXTERN(H5F_shared_t);
/******************************/
@@ -513,16 +516,18 @@ H5FL_EXTERN(H5F_file_t);
/* General routines */
H5_DLL H5F_t *H5F__reopen(H5F_t *f);
-H5_DLL H5F_t *H5F__new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf);
H5_DLL herr_t H5F__dest(H5F_t *f, hbool_t flush);
H5_DLL herr_t H5F__flush(H5F_t *f);
-H5_DLL htri_t H5F__is_hdf5(const char *name);
+H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t fapl_id);
H5_DLL ssize_t H5F__get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len);
H5_DLL herr_t H5F__get_info(H5F_t *f, H5F_info2_t *finfo);
H5_DLL herr_t H5F__format_convert(H5F_t *f);
H5_DLL herr_t H5F__start_swmr_write(H5F_t *f);
-H5_DLL herr_t H5F__close(hid_t file_id);
+H5_DLL herr_t H5F__close(H5F_t *f);
H5_DLL herr_t H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high);
+H5_DLL H5F_t *H5F__get_file(void *obj, H5I_type_t type);
+H5_DLL hid_t H5F__get_file_id(H5F_t *file, hbool_t app_ref);
+H5_DLL herr_t H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info);
/* File mount related routines */
H5_DLL herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id);
@@ -543,16 +548,16 @@ H5_DLL herr_t H5F__super_ext_remove_msg(H5F_t *f, unsigned id);
H5_DLL herr_t H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created);
/* Metadata accumulator routines */
-H5_DLL herr_t H5F__accum_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf);
-H5_DLL herr_t H5F__accum_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
-H5_DLL herr_t H5F__accum_free(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size);
-H5_DLL herr_t H5F__accum_flush(H5F_t *f);
-H5_DLL herr_t H5F__accum_reset(H5F_t *f, hbool_t flush);
+H5_DLL herr_t H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void *buf);
+H5_DLL herr_t H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf);
+H5_DLL herr_t H5F__accum_free(H5F_shared_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size);
+H5_DLL herr_t H5F__accum_flush(H5F_shared_t *f_sh);
+H5_DLL herr_t H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush);
/* Shared file list related routines */
-H5_DLL herr_t H5F__sfile_add(H5F_file_t *shared);
-H5_DLL H5F_file_t *H5F__sfile_search(H5FD_t *lf);
-H5_DLL herr_t H5F__sfile_remove(H5F_file_t *shared);
+H5_DLL herr_t H5F__sfile_add(H5F_shared_t *shared);
+H5_DLL H5F_shared_t *H5F__sfile_search(H5FD_t *lf);
+H5_DLL herr_t H5F__sfile_remove(H5F_shared_t *shared);
/* External file cache routines */
H5_DLL H5F_efc_t *H5F__efc_create(unsigned max_nfiles);
@@ -593,6 +598,8 @@ H5_DLL herr_t H5F__get_sbe_addr_test(hid_t file_id, haddr_t *sbe_addr);
H5_DLL herr_t H5F__vfd_swmr_writer_create_open_flush_test(hid_t file_id, hbool_t create);
H5_DLL herr_t H5F__vfd_swmr_writer_md_test(hid_t file_id, unsigned num_entries, struct H5FD_vfd_swmr_idx_entry_t *index,
unsigned num_dl_entries);
+
+H5_DLL htri_t H5F__same_file_test(hid_t file_id1, hid_t file_id2);
#endif /* H5F_TESTING */
#endif /* _H5Fpkg_H */