1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2 * Copyright by The HDF Group. * 3 * Copyright by the Board of Trustees of the University of Illinois. * 4 * All rights reserved. * 5 * * 6 * This file is part of HDF5. The full HDF5 copyright notice, including * 7 * terms governing use, modification, and redistribution, is contained in * 8 * the COPYING file, which can be found at the root of the source code * 9 * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * 10 * If you do not have access to either file, you may request a copy from * 11 * help@hdfgroup.org. * 12 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 13 14 /* 15 * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> 16 * Thursday, September 28, 2000 17 * 18 * Purpose: This file contains declarations which are visible only within 19 * the H5F package. Source files outside the H5F package should 20 * include H5Fprivate.h instead. 21 */ 22 #if !(defined H5F_FRIEND || defined H5F_MODULE) 23 #error "Do not include this file outside the H5F package!" 24 #endif 25 26 #ifndef _H5Fpkg_H 27 #define _H5Fpkg_H 28 29 /* Get package's private header */ 30 #include "H5Fprivate.h" 31 32 /* Other private headers needed by this file */ 33 #include "H5private.h" /* Generic Functions */ 34 #include "H5ACprivate.h" /* Metadata cache */ 35 #include "H5Bprivate.h" /* B-trees */ 36 #include "H5FLprivate.h" /* Free Lists */ 37 #include "H5FOprivate.h" /* File objects */ 38 #include "H5FSprivate.h" /* File free space */ 39 #include "H5Gprivate.h" /* Groups */ 40 #include "H5Oprivate.h" /* Object header messages */ 41 #include "H5PBprivate.h" /* Page buffer */ 42 #include "H5UCprivate.h" /* Reference counted object functions */ 43 44 45 /* 46 * Feature: Define this constant on the compiler command-line if you want to 47 * see some debugging messages on the debug stream. 48 */ 49 #ifdef NDEBUG 50 # undef H5F_DEBUG 51 #endif 52 53 /* Superblock status flags */ 54 #define H5F_SUPER_WRITE_ACCESS 0x01 55 #define H5F_SUPER_FILE_OK 0x02 56 #define H5F_SUPER_SWMR_WRITE_ACCESS 0x04 57 #define H5F_SUPER_ALL_FLAGS (H5F_SUPER_WRITE_ACCESS | H5F_SUPER_FILE_OK | H5F_SUPER_SWMR_WRITE_ACCESS) 58 59 /* Mask for removing private file access flags */ 60 #define H5F_ACC_PUBLIC_FLAGS 0x007fu 61 62 /* Free space section+aggregator merge flags */ 63 #define H5F_FS_MERGE_METADATA 0x01 /* Section can merge with metadata aggregator */ 64 #define H5F_FS_MERGE_RAWDATA 0x02 /* Section can merge with small 'raw' data aggregator */ 65 66 /* Macro to abstract checking whether file is using a free space manager */ 67 #define H5F_HAVE_FREE_SPACE_MANAGER(F) \ 68 ((F)->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR || \ 69 (F)->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) 70 71 /* Macros for encoding/decoding superblock */ 72 #define H5F_MAX_DRVINFOBLOCK_SIZE 1024 /* Maximum size of superblock driver info buffer */ 73 #define H5F_DRVINFOBLOCK_HDR_SIZE 16 /* Size of superblock driver info header */ 74 75 /* Superblock sizes for various versions */ 76 #define H5F_SIZEOF_CHKSUM 4 /* Checksum size in the file */ 77 78 /* Fixed-size portion at the beginning of all superblocks */ 79 #define H5F_SUPERBLOCK_FIXED_SIZE ( H5F_SIGNATURE_LEN \ 80 + 1) /* superblock version */ 81 82 /* The H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE is the minimal amount of super block 83 * variable length data guarnateed to load the sizeof offsets and the sizeof 84 * lengths fields in all versions of the superblock. 85 * 86 * This is necessary in the V3 cache, as on the initial load, we need to 87 * get enough of the superblock to determine its version and size so that 88 * the metadata cache can load the correct amount of data from file to 89 * allow the second deserialization attempt to succeed. 90 * 91 * The value selected will have to be revisited for each new version 92 * of the super block. Note that the current value is one byte larger 93 * than it needs to be. 94 */ 95 #define H5F_SUPERBLOCK_MINIMAL_VARLEN_SIZE 7 96 97 /* Macros for computing variable-size superblock size */ 98 #define H5F_SUPERBLOCK_VARLEN_SIZE_COMMON \ 99 (2 /* freespace, and root group versions */ \ 100 + 1 /* reserved */ \ 101 + 3 /* shared header vers, size of address, size of lengths */ \ 102 + 1 /* reserved */ \ 103 + 4 /* group leaf k, group internal k */ \ 104 + 4) /* consistency flags */ 105 #define H5F_SUPERBLOCK_VARLEN_SIZE_V0(sizeof_addr, sizeof_size) \ 106 ( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \ 107 + (sizeof_addr) /* base address */ \ 108 + (sizeof_addr) /* <unused> */ \ 109 + (sizeof_addr) /* EOF address */ \ 110 + (sizeof_addr) /* driver block address */ \ 111 + H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */ 112 #define H5F_SUPERBLOCK_VARLEN_SIZE_V1(sizeof_addr, sizeof_size) \ 113 ( H5F_SUPERBLOCK_VARLEN_SIZE_COMMON /* Common variable-length info */ \ 114 + 2 /* indexed B-tree internal k */ \ 115 + 2 /* reserved */ \ 116 + (sizeof_addr) /* base address */ \ 117 + (sizeof_addr) /* <unused> */ \ 118 + (sizeof_addr) /* EOF address */ \ 119 + (sizeof_addr) /* driver block address */ \ 120 + H5G_SIZEOF_ENTRY(sizeof_addr, sizeof_size)) /* root group ptr */ 121 #define H5F_SUPERBLOCK_VARLEN_SIZE_V2(sizeof_addr) \ 122 ( 2 /* size of address, size of lengths */ \ 123 + 1 /* consistency flags */ \ 124 + (sizeof_addr) /* base address */ \ 125 + (sizeof_addr) /* superblock extension address */ \ 126 + (sizeof_addr) /* EOF address */ \ 127 + (sizeof_addr) /* root group object header address */ \ 128 + H5F_SIZEOF_CHKSUM) /* superblock checksum (keep this last) */ 129 #define H5F_SUPERBLOCK_VARLEN_SIZE(v, sizeof_addr, sizeof_size) ( \ 130 (v == 0 ? H5F_SUPERBLOCK_VARLEN_SIZE_V0(sizeof_addr, sizeof_size) : 0) \ 131 + (v == 1 ? H5F_SUPERBLOCK_VARLEN_SIZE_V1(sizeof_addr, sizeof_size) : 0) \ 132 + (v >= 2 ? H5F_SUPERBLOCK_VARLEN_SIZE_V2(sizeof_addr) : 0)) 133 134 /* Total size of superblock, depends on superblock version */ 135 #define H5F_SUPERBLOCK_SIZE(s) ( H5F_SUPERBLOCK_FIXED_SIZE \ 136 + H5F_SUPERBLOCK_VARLEN_SIZE((s)->super_vers, (s)->sizeof_addr, (s)->sizeof_size)) 137 138 /* For superblock version 0 & 1: 139 Offset to the file consistency flags (status_flags) in the superblock (excluding H5F_SUPERBLOCK_FIXED_SIZE) */ 140 #define H5F_SUPER_STATUS_OFF_V01 \ 141 (2 /* freespace, and root group versions */ \ 142 + 1 /* reserved */ \ 143 + 3 /* shared header vers, size of address, size of lengths */ \ 144 + 1 /* reserved */ \ 145 + 4) /* group leaf k, group internal k */ 146 147 #define H5F_SUPER_STATUS_OFF(v) (v >= 2 ? 2 : H5F_SUPER_STATUS_OFF_V01) 148 149 /* Offset to the file consistency flags (status_flags) in the superblock */ 150 #define H5F_SUPER_STATUS_FLAGS_OFF(v) (H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPER_STATUS_OFF(v)) 151 152 /* Size of file consistency flags (status_flags) in the superblock */ 153 #define H5F_SUPER_STATUS_FLAGS_SIZE(v) (v >= 2 ? 1 : 4) 154 155 /* Forward declaration external file cache struct used below (defined in 156 * H5Fefc.c) */ 157 typedef struct H5F_efc_t H5F_efc_t; 158 159 /* Structure for passing 'user data' to superblock cache callbacks */ 160 typedef struct H5F_superblock_cache_ud_t { 161 /* IN: */ 162 H5F_t *f; /* Pointer to file */ 163 hbool_t ignore_drvrinfo; /* Indicate if the driver info should be ignored */ 164 /* OUT: */ 165 unsigned sym_leaf_k; /* Symbol table leaf node's 'K' value */ 166 unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */ 167 haddr_t stored_eof; /* End-of-file in file */ 168 hbool_t drvrinfo_removed; /* Indicate if the driver info was removed */ 169 unsigned super_vers; /* Superblock version obtained in get_load_size callback. 170 * It will be used later in verify_chksum callback 171 */ 172 } H5F_superblock_cache_ud_t; 173 174 /* Structure for passing 'user data' to driver info block cache callbacks */ 175 typedef struct H5F_drvrinfo_cache_ud_t { 176 H5F_t *f; /* Pointer to file */ 177 haddr_t driver_addr; /* address of driver info block */ 178 } H5F_drvrinfo_cache_ud_t; 179 180 /* Structure for metadata & "small [raw] data" block aggregation fields */ 181 struct H5F_blk_aggr_t { 182 unsigned long feature_flag; /* Feature flag type */ 183 hsize_t alloc_size; /* Size for allocating new blocks */ 184 hsize_t tot_size; /* Total amount of bytes aggregated into block */ 185 hsize_t size; /* Current size of block left */ 186 haddr_t addr; /* Location of block left */ 187 }; 188 189 /* Structure for metadata accumulator fields */ 190 typedef struct H5F_meta_accum_t { 191 unsigned char *buf; /* Buffer to hold the accumulated metadata */ 192 haddr_t loc; /* File location (offset) of the accumulated metadata */ 193 size_t size; /* Size of the accumulated metadata buffer used (in bytes) */ 194 size_t alloc_size; /* Size of the accumulated metadata buffer allocated (in bytes) */ 195 size_t dirty_off; /* Offset of the dirty region in the accumulator buffer */ 196 size_t dirty_len; /* Length of the dirty region in the accumulator buffer */ 197 hbool_t dirty; /* Flag to indicate that the accumulated metadata is dirty */ 198 } H5F_meta_accum_t; 199 200 /* A record of the mount table */ 201 typedef struct H5F_mount_t { 202 struct H5G_t *group; /* Mount point group held open */ 203 struct H5F_t *file; /* File mounted at that point */ 204 } H5F_mount_t; 205 206 /* 207 * The mount table describes what files are attached to (mounted on) the file 208 * to which this table belongs. 209 */ 210 typedef struct H5F_mtab_t { 211 unsigned nmounts;/* Number of children which are mounted */ 212 unsigned nalloc; /* Number of mount slots allocated */ 213 H5F_mount_t *child; /* An array of mount records */ 214 } H5F_mtab_t; 215 216 /* Structure specifically to store superblock. This was originally 217 * maintained entirely within H5F_file_t, but is now extracted 218 * here because the superblock is now handled by the cache */ 219 typedef struct H5F_super_t { 220 H5AC_info_t cache_info; /* Cache entry information structure */ 221 unsigned super_vers; /* Superblock version */ 222 uint8_t sizeof_addr; /* Size of addresses in file */ 223 uint8_t sizeof_size; /* Size of offsets in file */ 224 uint8_t status_flags; /* File status flags */ 225 unsigned sym_leaf_k; /* Size of leaves in symbol tables */ 226 unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree key values for each type */ 227 haddr_t base_addr; /* Absolute base address for rel.addrs. */ 228 /* (superblock for file is at this offset) */ 229 haddr_t ext_addr; /* Relative address of superblock extension */ 230 haddr_t driver_addr; /* File driver information block address */ 231 haddr_t root_addr; /* Root group address */ 232 H5G_entry_t *root_ent; /* Root group symbol table entry */ 233 } H5F_super_t; 234 235 /* 236 * Define the structure to store the file information for HDF5 files. One of 237 * these structures is allocated per file, not per H5Fopen(). That is, set of 238 * H5F_t structs can all point to the same H5F_file_t struct. The `nrefs' 239 * count in this struct indicates the number of H5F_t structs which are 240 * pointing to this struct. 241 */ 242 struct H5F_file_t { 243 H5FD_t *lf; /* Lower level file handle for I/O */ 244 H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */ 245 H5O_drvinfo_t *drvinfo; /* Pointer to the (pinned) driver info 246 * cache entry. This field is only defined 247 * for older versions of the super block, 248 * and then only when a driver information 249 * block is present. At all other times 250 * it should be NULL. 251 */ 252 hbool_t drvinfo_sb_msg_exists; /* Convenience field used to track 253 * whether the driver info superblock 254 * extension message has been created 255 * yet. This field should be TRUE iff the 256 * superblock extension exists and contains 257 * a driver info message. Under all other 258 * circumstances, it must be set to FALSE. 259 */ 260 unsigned nrefs; /* Ref count for times file is opened */ 261 unsigned flags; /* Access Permissions for file */ 262 H5F_mtab_t mtab; /* File mount table */ 263 H5F_efc_t *efc; /* External file cache */ 264 265 /* Cached values from FCPL/superblock */ 266 uint8_t sizeof_addr; /* Size of addresses in file */ 267 uint8_t sizeof_size; /* Size of offsets in file */ 268 haddr_t sohm_addr; /* Relative address of shared object header message table */ 269 unsigned sohm_vers; /* Version of shared message table on disk */ 270 unsigned sohm_nindexes; /* Number of shared messages indexes in the table */ 271 unsigned long feature_flags; /* VFL Driver feature Flags */ 272 haddr_t maxaddr; /* Maximum address for file */ 273 274 H5PB_t *page_buf; /* The page buffer cache */ 275 H5AC_t *cache; /* The object cache */ 276 H5AC_cache_config_t 277 mdc_initCacheCfg; /* initial configuration for the */ 278 /* metadata cache. This structure is */ 279 /* fixed at creation time and should */ 280 /* not change thereafter. */ 281 H5AC_cache_image_config_t 282 mdc_initCacheImageCfg; /* initial configuration for the */ 283 /* generate metadata cache image on */ 284 /* close option. This structure is */ 285 /* fixed at creation time and should */ 286 /* not change thereafter. */ 287 hbool_t use_mdc_logging; /* Set when metadata logging is desired */ 288 hbool_t start_mdc_log_on_access; /* set when mdc logging should */ 289 /* begin on file access/create */ 290 char *mdc_log_location; /* location of mdc log */ 291 hid_t fcpl_id; /* File creation property list ID */ 292 H5F_close_degree_t fc_degree; /* File close behavior degree */ 293 hbool_t evict_on_close; /* If the file's objects should be evicted from the metadata cache on close */ 294 size_t rdcc_nslots; /* Size of raw data chunk cache (slots) */ 295 size_t rdcc_nbytes; /* Size of raw data chunk cache (bytes) */ 296 double rdcc_w0; /* Preempt read chunks first? [0.0..1.0]*/ 297 size_t sieve_buf_size; /* Size of the data sieve buffer allocated (in bytes) */ 298 hsize_t threshold; /* Threshold for alignment */ 299 hsize_t alignment; /* Alignment */ 300 unsigned gc_ref; /* Garbage-collect references? */ 301 H5F_libver_t low_bound; /* The 'low' bound of library format versions */ 302 H5F_libver_t high_bound; /* The 'high' bound of library format versions */ 303 hbool_t store_msg_crt_idx; /* Store creation index for object header messages? */ 304 unsigned ncwfs; /* Num entries on cwfs list */ 305 struct H5HG_heap_t **cwfs; /* Global heap cache */ 306 struct H5G_t *root_grp; /* Open root group */ 307 H5FO_t *open_objs; /* Open objects in file */ 308 H5UC_t *grp_btree_shared; /* Ref-counted group B-tree node info */ 309 310 /* File space allocation information */ 311 H5F_fspace_strategy_t fs_strategy; /* File space handling strategy */ 312 hsize_t fs_threshold; /* Free space section threshold */ 313 hbool_t fs_persist; /* Free-space persist or not */ 314 unsigned fs_version; /* Free-space version: */ 315 /* It is used to update fsinfo message in the superblock 316 extension when closing down the free-space managers */ 317 hbool_t use_tmp_space; /* Whether temp. file space allocation is allowed */ 318 haddr_t tmp_addr; /* Next address to use for temp. space in the file */ 319 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 */ 320 321 H5F_fs_state_t fs_state[H5F_MEM_PAGE_NTYPES]; /* State of free space manager for each type */ 322 haddr_t fs_addr[H5F_MEM_PAGE_NTYPES]; /* Address of free space manager info for each type */ 323 H5FS_t *fs_man[H5F_MEM_PAGE_NTYPES]; /* Free space manager for each file space type */ 324 hbool_t first_alloc_dealloc; /* TRUE iff free space managers */ 325 /* are persistent and have not */ 326 /* been used accessed for either */ 327 /* allocation or deallocation */ 328 /* since file open. */ 329 haddr_t eoa_pre_fsm_fsalloc; /* eoa pre file space allocation */ 330 /* for self referential FSMs */ 331 haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ 332 /* for self referential FSMs */ 333 haddr_t eoa_post_mdci_fsalloc; /* eoa past file space allocation */ 334 /* for metadata cache image, or */ 335 /* HADDR_UNDEF if no cache image. */ 336 337 /* Free-space aggregation info */ 338 unsigned fs_aggr_merge[H5FD_MEM_NTYPES]; /* Flags for whether free space can merge with aggregator(s) */ 339 H5FD_mem_t fs_type_map[H5FD_MEM_NTYPES]; /* Mapping of "real" file space type into tracked type */ 340 H5F_blk_aggr_t meta_aggr; /* Metadata aggregation info (if aggregating metadata allocations) */ 341 H5F_blk_aggr_t sdata_aggr; /* "Small data" aggregation info (if aggregating "small data" allocations) */ 342 343 /* Paged aggregation info */ 344 hsize_t fs_page_size; /* File space page size */ 345 size_t pgend_meta_thres; /* Do not track page end meta section <= this threshold */ 346 347 /* Metadata accumulator information */ 348 H5F_meta_accum_t accum; /* Metadata accumulator info */ 349 350 /* Metadata retry info */ 351 unsigned read_attempts; /* The # of reads to try when reading metadata with checksum */ 352 unsigned retries_nbins; /* # of bins for each retries[] */ 353 uint32_t *retries[H5AC_NTYPES]; /* Track # of read retries for metdata items with checksum */ 354 355 /* Object flush info */ 356 H5F_object_flush_t object_flush; /* Information for object flush callback */ 357 hbool_t crt_dset_min_ohdr_flag; /* flag to create minimized dataset object headers */ 358 }; 359 360 /* 361 * This is the top-level file descriptor. One of these structures is 362 * allocated every time H5Fopen() is called although they may contain pointers 363 * to shared H5F_file_t structs. 364 */ 365 struct H5F_t { 366 char *open_name; /* Name used to open file */ 367 char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */ 368 char *extpath; /* Path for searching target external link file */ 369 H5F_file_t *shared; /* The shared file info */ 370 unsigned nopen_objs; /* Number of open object headers */ 371 H5FO_t *obj_count; /* # of time each object is opened through top file structure */ 372 hid_t file_id; /* ID of this file */ 373 hbool_t closing; /* File is in the process of being closed */ 374 struct H5F_t *parent; /* Parent file that this file is mounted to */ 375 unsigned nmounts; /* Number of children mounted to this file */ 376 #ifdef H5_HAVE_PARALLEL 377 H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */ 378 hbool_t coll_md_write; /* Do all metadata writes collectively */ 379 #endif /* H5_HAVE_PARALLEL */ 380 }; 381 382 383 /*****************************/ 384 /* Package Private Variables */ 385 /*****************************/ 386 387 /* Declare a free list to manage the H5F_t struct */ 388 H5FL_EXTERN(H5F_t); 389 390 /* Declare a free list to manage the H5F_file_t struct */ 391 H5FL_EXTERN(H5F_file_t); 392 393 394 /******************************/ 395 /* Package Private Prototypes */ 396 /******************************/ 397 398 /* General routines */ 399 H5_DLL H5F_t *H5F__new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); 400 H5_DLL herr_t H5F__dest(H5F_t *f, hbool_t flush); 401 H5_DLL herr_t H5F__flush(H5F_t *f); 402 H5_DLL htri_t H5F__is_hdf5(const char *name); 403 H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); 404 H5_DLL ssize_t H5F__get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len); 405 H5_DLL herr_t H5F__get_info(H5F_t *f, H5F_info2_t *finfo); 406 H5_DLL herr_t H5F__get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *info); 407 H5_DLL herr_t H5F__format_convert(H5F_t *f); 408 H5_DLL herr_t H5F__start_swmr_write(H5F_t *f); 409 H5_DLL herr_t H5F__close(hid_t file_id); 410 H5_DLL herr_t H5F__close_cb(H5F_t *f); 411 H5_DLL herr_t H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high); 412 413 /* File mount related routines */ 414 H5_DLL herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id); 415 H5_DLL herr_t H5F__unmount(H5G_loc_t *loc, const char *name); 416 H5_DLL herr_t H5F__close_mounts(H5F_t *f); 417 H5_DLL herr_t H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); 418 419 /* Superblock related routines */ 420 H5_DLL herr_t H5F__super_init(H5F_t *f); 421 H5_DLL herr_t H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read); 422 H5_DLL herr_t H5F__super_size(H5F_t *f, hsize_t *super_size, hsize_t *super_ext_size); 423 H5_DLL herr_t H5F__super_free(H5F_super_t *sblock); 424 425 /* Superblock extension related routines */ 426 H5_DLL herr_t H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr); 427 H5_DLL herr_t H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, hbool_t may_create, unsigned mesg_flags); 428 H5_DLL herr_t H5F__super_ext_remove_msg(H5F_t *f, unsigned id); 429 H5_DLL herr_t H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created); 430 431 /* Metadata accumulator routines */ 432 H5_DLL herr_t H5F__accum_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf); 433 H5_DLL herr_t H5F__accum_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf); 434 H5_DLL herr_t H5F__accum_free(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size); 435 H5_DLL herr_t H5F__accum_flush(H5F_t *f); 436 H5_DLL herr_t H5F__accum_reset(H5F_t *f, hbool_t flush); 437 438 /* Shared file list related routines */ 439 H5_DLL herr_t H5F_sfile_add(H5F_file_t *shared); 440 H5_DLL H5F_file_t * H5F_sfile_search(H5FD_t *lf); 441 H5_DLL herr_t H5F_sfile_remove(H5F_file_t *shared); 442 443 /* External file cache routines */ 444 H5_DLL H5F_efc_t *H5F__efc_create(unsigned max_nfiles); 445 H5_DLL H5F_t *H5F__efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); 446 H5_DLL unsigned H5F__efc_max_nfiles(H5F_efc_t *efc); 447 H5_DLL herr_t H5F__efc_release(H5F_efc_t *efc); 448 H5_DLL herr_t H5F__efc_destroy(H5F_efc_t *efc); 449 H5_DLL herr_t H5F__efc_try_close(H5F_t *f); 450 451 /* Space allocation routines */ 452 H5_DLL haddr_t H5F__alloc(H5F_t *f, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); 453 H5_DLL herr_t H5F__free(H5F_t *f, H5F_mem_t type, haddr_t addr, hsize_t size); 454 H5_DLL htri_t H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested); 455 456 /* Functions that get/retrieve values from VFD layer */ 457 H5_DLL herr_t H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr); 458 H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr); 459 H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, hbool_t paged); 460 H5_DLL herr_t H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa); 461 462 /* Functions that flush or evict */ 463 H5_DLL herr_t H5F__evict_cache_entries(H5F_t *f); 464 465 /* Testing functions */ 466 #ifdef H5F_TESTING 467 H5_DLL herr_t H5F_get_sohm_mesg_count_test(hid_t fid, unsigned type_id, size_t *mesg_count); 468 H5_DLL herr_t H5F_check_cached_stab_test(hid_t file_id); 469 H5_DLL herr_t H5F_get_maxaddr_test(hid_t file_id, haddr_t *maxaddr); 470 H5_DLL herr_t H5F_get_sbe_addr_test(hid_t file_id, haddr_t *sbe_addr); 471 #endif /* H5F_TESTING */ 472 473 #endif /* _H5Fpkg_H */ 474 475