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  *
16  * Created:		H5ACprivate.h
17  *			Jul  9 1997
18  *			Robb Matzke <matzke@llnl.gov>
19  *
20  * Purpose:		Constants and typedefs available to the rest of the
21  *			library.
22  *
23  *-------------------------------------------------------------------------
24  */
25 
26 #ifndef _H5ACprivate_H
27 #define _H5ACprivate_H
28 
29 #include "H5ACpublic.h"		/*public prototypes			*/
30 
31 /* Pivate headers needed by this header */
32 #include "H5private.h"		/* Generic Functions			*/
33 #include "H5Cprivate.h"		/* Cache				*/
34 #include "H5Fprivate.h"		/* File access				*/
35 #include "H5Pprivate.h"		/* Property lists			*/
36 #include "H5SLprivate.h"        /* Skip lists 				*/
37 
38 /* Global metadata tag values */
39 #define H5AC__INVALID_TAG      (haddr_t)0
40 #define H5AC__IGNORE_TAG       (haddr_t)1
41 #define H5AC__COPIED_TAG       (haddr_t)2
42 #define H5AC__SUPERBLOCK_TAG   (haddr_t)3
43 #define H5AC__FREESPACE_TAG    (haddr_t)4
44 #define H5AC__SOHM_TAG         (haddr_t)5
45 #define H5AC__GLOBALHEAP_TAG   (haddr_t)6
46 
47 /* Types of metadata objects cached */
48 typedef enum {
49     H5AC_BT_ID = 0,             /* ( 0) B-tree nodes                                */
50     H5AC_SNODE_ID,              /* ( 1) symbol table nodes                          */
51     H5AC_LHEAP_PRFX_ID,         /* ( 2) local heap prefix                           */
52     H5AC_LHEAP_DBLK_ID,         /* ( 3) local heap data block                       */
53     H5AC_GHEAP_ID,              /* ( 4) global heap                                 */
54     H5AC_OHDR_ID,               /* ( 5) object header                               */
55     H5AC_OHDR_CHK_ID,           /* ( 6) object header chunk                         */
56     H5AC_BT2_HDR_ID,            /* ( 7) v2 B-tree header                            */
57     H5AC_BT2_INT_ID,            /* ( 8) v2 B-tree internal node                     */
58     H5AC_BT2_LEAF_ID,           /* ( 9) v2 B-tree leaf node                         */
59     H5AC_FHEAP_HDR_ID,          /* (10) fractal heap header                         */
60     H5AC_FHEAP_DBLOCK_ID,       /* (11) fractal heap direct block                   */
61     H5AC_FHEAP_IBLOCK_ID,       /* (12) fractal heap indirect block                 */
62     H5AC_FSPACE_HDR_ID,         /* (13) free space header                           */
63     H5AC_FSPACE_SINFO_ID,       /* (14) free space sections                         */
64     H5AC_SOHM_TABLE_ID,         /* (15) shared object header message master table   */
65     H5AC_SOHM_LIST_ID,          /* (16) shared message index stored as a list       */
66     H5AC_EARRAY_HDR_ID,         /* (17) extensible array header                     */
67     H5AC_EARRAY_IBLOCK_ID,      /* (18) extensible array index block                */
68     H5AC_EARRAY_SBLOCK_ID,      /* (19) extensible array super block                */
69     H5AC_EARRAY_DBLOCK_ID,      /* (20) extensible array data block                 */
70     H5AC_EARRAY_DBLK_PAGE_ID,   /* (21) extensible array data block page            */
71     H5AC_FARRAY_HDR_ID,         /* (22) fixed array header                          */
72     H5AC_FARRAY_DBLOCK_ID,      /* (23) fixed array data block                      */
73     H5AC_FARRAY_DBLK_PAGE_ID,   /* (24) fixed array data block page                 */
74     H5AC_SUPERBLOCK_ID,         /* (25) file superblock                             */
75     H5AC_DRVRINFO_ID,           /* (26) driver info block (supplements superblock)  */
76     H5AC_EPOCH_MARKER_ID,       /* (27) epoch marker - always internal to cache     */
77     H5AC_PROXY_ENTRY_ID,        /* (28) cache entry proxy                           */
78     H5AC_PREFETCHED_ENTRY_ID, 	/* (29) prefetched entry - always internal to cache */
79     H5AC_NTYPES                 /* Number of types, must be last                    */
80 } H5AC_type_t;
81 
82 /* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when
83  * H5C_COLLECT_CACHE_STATS is FALSE.
84  *
85  * When H5C_COLLECT_CACHE_STATS is TRUE, H5AC_DUMP_STATS_ON_CLOSE must
86  * be FALSE for "make check" to succeed, but may be set to TRUE at other
87  * times for debugging purposes.
88  *
89  * Hence the following, somewhat odd set of #defines.
90  *
91  * NOTE: test/cache plays games with the f->shared->cache, and thus
92  *       setting H5AC_DUMP_STATS_ON_CLOSE will generate constant,
93  *	 irrelevant data when run with that test program.  See
94  * 	 comments on setup_cache() / takedown_cache() in test/cache_common.c.
95  *       for details.
96  *
97  *	 If you need to dump stats at file close in test/cache.c,
98  *	 use the dump_stats parameter to takedown_cache(), or call
99  *	 H5C_stats() directly.
100  *					JRM -- 4/12/15
101  *
102  * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much
103  * the same way as H5AC_DUMP_STATS_ON_CLOSE.  However, the set of stats
104  * displayed is much smaller, and directed purely at the cache image feature.
105  *
106  *					JRM -- 11/1/15
107  */
108 #if H5C_COLLECT_CACHE_STATS
109 
110 #define H5AC_DUMP_STATS_ON_CLOSE	0
111 #define H5AC_DUMP_IMAGE_STATS_ON_CLOSE  0
112 
113 #else /* H5C_COLLECT_CACHE_STATS */
114 
115 #define H5AC_DUMP_STATS_ON_CLOSE	0
116 #define H5AC_DUMP_IMAGE_STATS_ON_CLOSE  0
117 
118 #endif /* H5C_COLLECT_CACHE_STATS */
119 
120 /* Default max metadata cache size and min clean size are give here.
121  * At present, these are the same as those given in H5Cprivate.h.
122  */
123 
124 #define H5AC__DEFAULT_MAX_CACHE_SIZE	H5C__DEFAULT_MAX_CACHE_SIZE
125 #define H5AC__DEFAULT_MIN_CLEAN_SIZE	H5C__DEFAULT_MIN_CLEAN_SIZE
126 
127 /* Check if we are sanity checking tagging */
128 #if H5C_DO_TAGGING_SANITY_CHECKS
129 #define H5AC_DO_TAGGING_SANITY_CHECKS 1
130 #else
131 #define H5AC_DO_TAGGING_SANITY_CHECKS 0
132 #endif
133 
134 /*
135  * Class methods pertaining to caching.	 Each type of cached object will
136  * have a constant variable with permanent life-span that describes how
137  * to cache the object.
138  */
139 
140 #define H5AC__SERIALIZE_RESIZED_FLAG	H5C__SERIALIZE_RESIZED_FLAG
141 #define H5AC__SERIALIZE_MOVED_FLAG	H5C__SERIALIZE_MOVED_FLAG
142 
143 /* Cork actions: cork/uncork/get cork status of an object */
144 #define H5AC__SET_CORK             	H5C__SET_CORK
145 #define H5AC__UNCORK             	H5C__UNCORK
146 #define H5AC__GET_CORKED             	H5C__GET_CORKED
147 
148 /* Aliases for the "ring" type and values */
149 typedef H5C_ring_t       H5AC_ring_t;
150 #define H5AC_RING_INV    H5C_RING_UNDEFINED
151 #define H5AC_RING_USER   H5C_RING_USER
152 #define H5AC_RING_RDFSM  H5C_RING_RDFSM
153 #define H5AC_RING_MDFSM  H5C_RING_MDFSM
154 #define H5AC_RING_SBE    H5C_RING_SBE
155 #define H5AC_RING_SB     H5C_RING_SB
156 #define H5AC_RING_NTYPES H5C_RING_NTYPES
157 
158 /* Aliases for 'notify action' type & values */
159 typedef H5C_notify_action_t     H5AC_notify_action_t;
160 #define H5AC_NOTIFY_ACTION_AFTER_INSERT H5C_NOTIFY_ACTION_AFTER_INSERT
161 #define H5AC_NOTIFY_ACTION_AFTER_LOAD   H5C_NOTIFY_ACTION_AFTER_LOAD
162 #define H5AC_NOTIFY_ACTION_AFTER_FLUSH	H5C_NOTIFY_ACTION_AFTER_FLUSH
163 #define H5AC_NOTIFY_ACTION_BEFORE_EVICT H5C_NOTIFY_ACTION_BEFORE_EVICT
164 #define H5AC_NOTIFY_ACTION_ENTRY_DIRTIED H5C_NOTIFY_ACTION_ENTRY_DIRTIED
165 #define H5AC_NOTIFY_ACTION_ENTRY_CLEANED H5C_NOTIFY_ACTION_ENTRY_CLEANED
166 #define H5AC_NOTIFY_ACTION_CHILD_DIRTIED H5C_NOTIFY_ACTION_CHILD_DIRTIED
167 #define H5AC_NOTIFY_ACTION_CHILD_CLEANED H5C_NOTIFY_ACTION_CHILD_CLEANED
168 #define H5AC_NOTIFY_ACTION_CHILD_UNSERIALIZED H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED
169 #define H5AC_NOTIFY_ACTION_CHILD_SERIALIZED H5C_NOTIFY_ACTION_CHILD_SERIALIZED
170 
171 #define H5AC__CLASS_NO_FLAGS_SET 	H5C__CLASS_NO_FLAGS_SET
172 #define H5AC__CLASS_SPECULATIVE_LOAD_FLAG H5C__CLASS_SPECULATIVE_LOAD_FLAG
173 
174 /* The following flags should only appear in test code */
175 #define H5AC__CLASS_SKIP_READS              H5C__CLASS_SKIP_READS
176 #define H5AC__CLASS_SKIP_WRITES             H5C__CLASS_SKIP_WRITES
177 
178 typedef H5C_get_initial_load_size_func_t	H5AC_get_initial_load_size_func_t;
179 typedef H5C_get_final_load_size_func_t	H5AC_get_final_load_size_func_t;
180 typedef H5C_verify_chksum_func_t	H5AC_verify_chksum_func_t;
181 typedef H5C_deserialize_func_t		H5AC_deserialize_func_t;
182 typedef H5C_image_len_func_t		H5AC_image_len_func_t;
183 
184 #define H5AC__SERIALIZE_NO_FLAGS_SET    H5C__SERIALIZE_NO_FLAGS_SET
185 #define H5AC__SERIALIZE_RESIZED_FLAG    H5C__SERIALIZE_RESIZED_FLAG
186 #define H5AC__SERIALIZE_MOVED_FLAG      H5C__SERIALIZE_MOVED_FLAG
187 
188 typedef H5C_pre_serialize_func_t	H5AC_pre_serialize_func_t;
189 typedef H5C_serialize_func_t		H5AC_serialize_func_t;
190 typedef H5C_notify_func_t		H5AC_notify_func_t;
191 typedef H5C_free_icr_func_t		H5AC_free_icr_func_t;
192 typedef H5C_get_fsf_size_t		H5AC_get_fsf_size_t;
193 
194 typedef H5C_class_t			H5AC_class_t;
195 
196 /* Cache entry info */
197 typedef H5C_cache_entry_t		H5AC_info_t;
198 
199 /* Typedef for metadata cache (defined in H5Cpkg.h) */
200 typedef H5C_t	H5AC_t;
201 
202 /* Metadata cache proxy entry type */
203 typedef struct H5AC_proxy_entry_t {
204     H5AC_info_t cache_info;             /* Information for H5AC cache functions */
205                                         /* (MUST be first field in structure) */
206 
207     /* General fields */
208     haddr_t addr;                       /* Address of the entry in the file */
209                                         /* (Should be in 'temporary' address space) */
210 
211     /* Parent fields */
212     H5SL_t *parents;                    /* Skip list to track parent addresses */
213 
214     /* Child fields */
215     size_t nchildren;                   /* Number of children */
216     size_t ndirty_children;             /* Number of dirty children */
217                                         /* (Note that this currently duplicates some cache functionality) */
218     size_t nunser_children;             /* Number of unserialized children */
219                                         /* (Note that this currently duplicates some cache functionality) */
220 } H5AC_proxy_entry_t;
221 
222 /* Default cache configuration. */
223 #define H5AC__DEFAULT_METADATA_WRITE_STRATEGY   \
224                                 H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED
225 
226 #ifdef H5_HAVE_PARALLEL
227 #define H5AC__DEFAULT_CACHE_CONFIG                                            \
228 {                                                                             \
229   /* int         version                = */ H5AC__CURR_CACHE_CONFIG_VERSION, \
230   /* hbool_t     rpt_fcn_enabled        = */ FALSE,                           \
231   /* hbool_t     open_trace_file        = */ FALSE,                           \
232   /* hbool_t     close_trace_file       = */ FALSE,                           \
233   /* char        trace_file_name[]      = */ "",                              \
234   /* hbool_t     evictions_enabled      = */ TRUE,                            \
235   /* hbool_t     set_initial_size       = */ TRUE,                            \
236   /* size_t      initial_size           = */ ( 2 * 1024 * 1024),              \
237   /* double      min_clean_fraction     = */ 0.3f,                            \
238   /* size_t      max_size               = */ (32 * 1024 * 1024),              \
239   /* size_t      min_size               = */ (1 * 1024 * 1024),               \
240   /* long int    epoch_length           = */ 50000,                           \
241   /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,             \
242   /* double      lower_hr_threshold     = */ 0.9f,                            \
243   /* double      increment              = */ 2.0f,                            \
244   /* hbool_t     apply_max_increment    = */ TRUE,                            \
245   /* size_t      max_increment          = */ (4 * 1024 * 1024),               \
246   /* enum H5C_cache_flash_incr_mode       */                                  \
247   /*                    flash_incr_mode = */ H5C_flash_incr__add_space,       \
248   /* double      flash_multiple         = */ 1.0f,                            \
249   /* double      flash_threshold        = */ 0.25f,                           \
250   /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, \
251   /* double      upper_hr_threshold     = */ 0.999f,                          \
252   /* double      decrement              = */ 0.9f,                            \
253   /* hbool_t     apply_max_decrement    = */ TRUE,                            \
254   /* size_t      max_decrement          = */ (1 * 1024 * 1024),               \
255   /* int         epochs_before_eviction = */ 3,                               \
256   /* hbool_t     apply_empty_reserve    = */ TRUE,                            \
257   /* double      empty_reserve          = */ 0.1f,                            \
258   /* size_t	 dirty_bytes_threshold  = */ (256 * 1024),                    \
259   /* int	metadata_write_strategy = */                                  \
260 				       H5AC__DEFAULT_METADATA_WRITE_STRATEGY  \
261 }
262 #else /* H5_HAVE_PARALLEL */
263 #define H5AC__DEFAULT_CACHE_CONFIG                                            \
264 {                                                                             \
265   /* int         version                = */ H5C__CURR_AUTO_SIZE_CTL_VER,     \
266   /* hbool_t     rpt_fcn_enabled        = */ FALSE,                           \
267   /* hbool_t     open_trace_file        = */ FALSE,                           \
268   /* hbool_t     close_trace_file       = */ FALSE,                           \
269   /* char        trace_file_name[]      = */ "",                              \
270   /* hbool_t     evictions_enabled      = */ TRUE,                            \
271   /* hbool_t     set_initial_size       = */ TRUE,                            \
272   /* size_t      initial_size           = */ ( 2 * 1024 * 1024),              \
273   /* double      min_clean_fraction     = */ 0.01f,                           \
274   /* size_t      max_size               = */ (32 * 1024 * 1024),              \
275   /* size_t      min_size               = */ ( 1 * 1024 * 1024),              \
276   /* long int    epoch_length           = */ 50000,                           \
277   /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,             \
278   /* double      lower_hr_threshold     = */ 0.9f,                            \
279   /* double      increment              = */ 2.0f,                            \
280   /* hbool_t     apply_max_increment    = */ TRUE,                            \
281   /* size_t      max_increment          = */ (4 * 1024 * 1024),               \
282   /* enum H5C_cache_flash_incr_mode       */                                  \
283   /*                    flash_incr_mode = */ H5C_flash_incr__add_space,       \
284   /* double      flash_multiple         = */ 1.4f,                            \
285   /* double      flash_threshold        = */ 0.25f,                           \
286   /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,\
287   /* double      upper_hr_threshold     = */ 0.999f,                          \
288   /* double      decrement              = */ 0.9f,                            \
289   /* hbool_t     apply_max_decrement    = */ TRUE,                            \
290   /* size_t      max_decrement          = */ (1 * 1024 * 1024),               \
291   /* int         epochs_before_eviction = */ 3,                               \
292   /* hbool_t     apply_empty_reserve    = */ TRUE,                            \
293   /* double      empty_reserve          = */ 0.1f,                            \
294   /* size_t	 dirty_bytes_threshold  = */ (256 * 1024),                    \
295   /* int	metadata_write_strategy = */                                  \
296 				       H5AC__DEFAULT_METADATA_WRITE_STRATEGY  \
297 }
298 #endif /* H5_HAVE_PARALLEL */
299 
300 #define H5AC__DEFAULT_CACHE_IMAGE_CONFIG                                     \
301 {                                                                            \
302    /* int32_t version            = */ H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, \
303    /* hbool_t generate_image     = */ FALSE,                                 \
304    /* hbool_t save_resize_status = */ FALSE,                                 \
305    /* int32_t entry_ageout       = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE  \
306 }
307 /*
308  * Library prototypes.
309  */
310 
311 /* #defines of flags used in the flags parameters in some of the
312  * following function calls.  Note that they are just copies of
313  * the equivalent flags from H5Cprivate.h.
314  */
315 
316 #define H5AC__NO_FLAGS_SET		  H5C__NO_FLAGS_SET
317 #define H5AC__SET_FLUSH_MARKER_FLAG	  H5C__SET_FLUSH_MARKER_FLAG
318 #define H5AC__DELETED_FLAG		  H5C__DELETED_FLAG
319 #define H5AC__DIRTIED_FLAG		  H5C__DIRTIED_FLAG
320 #define H5AC__PIN_ENTRY_FLAG		  H5C__PIN_ENTRY_FLAG
321 #define H5AC__UNPIN_ENTRY_FLAG		  H5C__UNPIN_ENTRY_FLAG
322 #define H5AC__FLUSH_INVALIDATE_FLAG	  H5C__FLUSH_INVALIDATE_FLAG
323 #define H5AC__FLUSH_CLEAR_ONLY_FLAG	  H5C__FLUSH_CLEAR_ONLY_FLAG
324 #define H5AC__FLUSH_MARKED_ENTRIES_FLAG   H5C__FLUSH_MARKED_ENTRIES_FLAG
325 #define H5AC__FLUSH_IGNORE_PROTECTED_FLAG H5C__FLUSH_IGNORE_PROTECTED_FLAG
326 #define H5AC__READ_ONLY_FLAG		  H5C__READ_ONLY_FLAG
327 #define H5AC__FREE_FILE_SPACE_FLAG	  H5C__FREE_FILE_SPACE_FLAG
328 #define H5AC__TAKE_OWNERSHIP_FLAG         H5C__TAKE_OWNERSHIP_FLAG
329 #define H5AC__FLUSH_LAST_FLAG		  H5C__FLUSH_LAST_FLAG
330 #define H5AC__FLUSH_COLLECTIVELY_FLAG	  H5C__FLUSH_COLLECTIVELY_FLAG
331 
332 
333 /* #defines of flags used to report entry status in the
334  * H5AC_get_entry_status() call.
335  */
336 
337 #define H5AC_ES__IN_CACHE               0x0001
338 #define H5AC_ES__IS_DIRTY               0x0002
339 #define H5AC_ES__IS_PROTECTED           0x0004
340 #define H5AC_ES__IS_PINNED              0x0008
341 #define H5AC_ES__IS_FLUSH_DEP_PARENT    0x0010
342 #define H5AC_ES__IS_FLUSH_DEP_CHILD     0x0020
343 #define H5AC_ES__IS_CORKED              0x0040
344 #define H5AC_ES__IMAGE_IS_UP_TO_DATE    0x0080
345 
346 /* Metadata entry class declarations */
347 H5_DLLVAR const H5AC_class_t H5AC_BT[1];
348 H5_DLLVAR const H5AC_class_t H5AC_SNODE[1];
349 H5_DLLVAR const H5AC_class_t H5AC_LHEAP_PRFX[1];
350 H5_DLLVAR const H5AC_class_t H5AC_LHEAP_DBLK[1];
351 H5_DLLVAR const H5AC_class_t H5AC_GHEAP[1];
352 H5_DLLVAR const H5AC_class_t H5AC_OHDR[1];
353 H5_DLLVAR const H5AC_class_t H5AC_OHDR_CHK[1];
354 H5_DLLVAR const H5AC_class_t H5AC_BT2_HDR[1];
355 H5_DLLVAR const H5AC_class_t H5AC_BT2_INT[1];
356 H5_DLLVAR const H5AC_class_t H5AC_BT2_LEAF[1];
357 H5_DLLVAR const H5AC_class_t H5AC_FHEAP_HDR[1];
358 H5_DLLVAR const H5AC_class_t H5AC_FHEAP_DBLOCK[1];
359 H5_DLLVAR const H5AC_class_t H5AC_FHEAP_IBLOCK[1];
360 H5_DLLVAR const H5AC_class_t H5AC_FSPACE_HDR[1];
361 H5_DLLVAR const H5AC_class_t H5AC_FSPACE_SINFO[1];
362 H5_DLLVAR const H5AC_class_t H5AC_SOHM_TABLE[1];
363 H5_DLLVAR const H5AC_class_t H5AC_SOHM_LIST[1];
364 H5_DLLVAR const H5AC_class_t H5AC_EARRAY_HDR[1];
365 H5_DLLVAR const H5AC_class_t H5AC_EARRAY_IBLOCK[1];
366 H5_DLLVAR const H5AC_class_t H5AC_EARRAY_SBLOCK[1];
367 H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLOCK[1];
368 H5_DLLVAR const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1];
369 H5_DLLVAR const H5AC_class_t H5AC_FARRAY_HDR[1];
370 H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLOCK[1];
371 H5_DLLVAR const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1];
372 H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1];
373 H5_DLLVAR const H5AC_class_t H5AC_DRVRINFO[1];
374 H5_DLLVAR const H5AC_class_t H5AC_EPOCH_MARKER[1];
375 H5_DLLVAR const H5AC_class_t H5AC_PROXY_ENTRY[1];
376 H5_DLLVAR const H5AC_class_t H5AC_PREFETCHED_ENTRY[1];
377 
378 
379 /* external function declarations: */
380 
381 H5_DLL herr_t H5AC_init(void);
382 H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr,
383     H5AC_cache_image_config_t * image_config_ptr);
384 H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr,
385     unsigned *status_ptr);
386 H5_DLL herr_t H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type,
387     haddr_t addr, void *thing, unsigned int flags);
388 H5_DLL herr_t H5AC_pin_protected_entry(void *thing);
389 H5_DLL herr_t H5AC_prep_for_file_close(H5F_t *f);
390 H5_DLL herr_t H5AC_create_flush_dependency(void *parent_thing, void *child_thing);
391 H5_DLL void * H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr,
392     void *udata, unsigned flags);
393 H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size);
394 H5_DLL herr_t H5AC_unpin_entry(void *thing);
395 H5_DLL herr_t H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing);
396 H5_DLL herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr,
397     void *thing, unsigned flags);
398 H5_DLL herr_t H5AC_flush(H5F_t *f);
399 H5_DLL herr_t H5AC_mark_entry_dirty(void *thing);
400 H5_DLL herr_t H5AC_mark_entry_clean(void *thing);
401 H5_DLL herr_t H5AC_mark_entry_unserialized(void *thing);
402 H5_DLL herr_t H5AC_mark_entry_serialized(void *thing);
403 H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type,
404     haddr_t old_addr, haddr_t new_addr);
405 H5_DLL herr_t H5AC_dest(H5F_t *f);
406 H5_DLL herr_t H5AC_evict(H5F_t *f);
407 H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type,
408     haddr_t addr, unsigned flags);
409 H5_DLL herr_t H5AC_remove_entry(void *entry);
410 H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr,
411     H5AC_cache_config_t *config_ptr);
412 H5_DLL herr_t H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr,
413     size_t *min_clean_size_ptr, size_t *cur_size_ptr, uint32_t *cur_num_entries_ptr);
414 H5_DLL herr_t H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr);
415 H5_DLL herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t *cache_ptr);
416 H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr,
417     H5AC_cache_config_t *config_ptr);
418 H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr);
419 
420 /* Cache image routines */
421 H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr,
422     hsize_t len, hbool_t rw);
423 H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr);
424 H5_DLL hbool_t H5AC_cache_image_pending(const H5F_t *f);
425 H5_DLL herr_t H5AC_force_cache_image_load(H5F_t * f);
426 H5_DLL herr_t H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr,
427     hsize_t *image_len);
428 
429 /* Tag & Ring routines */
430 H5_DLL void H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag);
431 H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag);
432 H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global);
433 H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag);
434 H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f);
435 H5_DLL herr_t H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked);
436 H5_DLL herr_t H5AC_get_entry_ring(const H5F_t *f, haddr_t addr, H5AC_ring_t *ring);
437 H5_DLL void H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring);
438 H5_DLL herr_t H5AC_unsettle_entry_ring(void *entry);
439 H5_DLL herr_t H5AC_unsettle_ring(H5F_t * f, H5AC_ring_t ring);
440 H5_DLL herr_t H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id,
441     unsigned flags);
442 H5_DLL herr_t H5AC_get_tag(const void *thing, /*OUT*/ haddr_t *tag);
443 
444 /* Virtual entry routines */
445 H5_DLL H5AC_proxy_entry_t *H5AC_proxy_entry_create(void);
446 H5_DLL herr_t H5AC_proxy_entry_add_parent(H5AC_proxy_entry_t *pentry, void *parent);
447 H5_DLL herr_t H5AC_proxy_entry_remove_parent(H5AC_proxy_entry_t *pentry, void *parent);
448 H5_DLL herr_t H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f,
449     void *child);
450 H5_DLL herr_t H5AC_proxy_entry_remove_child(H5AC_proxy_entry_t *pentry, void *child);
451 H5_DLL herr_t H5AC_proxy_entry_dest(H5AC_proxy_entry_t *pentry);
452 
453 #ifdef H5_HAVE_PARALLEL
454 H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr);
455 #endif /* H5_HAVE_PARALLEL */
456 
457 /* Debugging functions */
458 H5_DLL herr_t H5AC_stats(const H5F_t *f);
459 #ifndef NDEBUG
460 H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
461 H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr,
462     void **entry_ptr_ptr);
463 H5_DLL herr_t H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr,
464     haddr_t child_addr, hbool_t *fd_exists_ptr);
465 H5_DLL herr_t H5AC_verify_entry_type(const H5F_t *f, haddr_t addr,
466     const H5AC_class_t *expected_type, hbool_t *in_cache_ptr,
467     hbool_t *type_ok_ptr);
468 H5_DLL hbool_t H5AC_get_serialization_in_progress(H5F_t *f);
469 H5_DLL hbool_t H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring);
470 #endif /* NDEBUG */ /* end debugging functions */
471 
472 #endif /* !_H5ACprivate_H */
473 
474