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://www.hdfgroup.org/licenses. *
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: H5Fquery.c
17 * Jan 10 2008
18 * Quincey Koziol
19 *
20 * Purpose: File structure query routines.
21 *
22 *-------------------------------------------------------------------------
23 */
24
25 /****************/
26 /* Module Setup */
27 /****************/
28
29 #include "H5Fmodule.h" /* This source code file is part of the H5F module */
30
31 /***********/
32 /* Headers */
33 /***********/
34 #include "H5private.h" /* Generic Functions */
35 #include "H5Eprivate.h" /* Error handling */
36 #include "H5Fpkg.h" /* File access */
37 #include "H5FDprivate.h" /* File drivers */
38
39 /****************/
40 /* Local Macros */
41 /****************/
42
43 /******************/
44 /* Local Typedefs */
45 /******************/
46
47 /********************/
48 /* Package Typedefs */
49 /********************/
50
51 /********************/
52 /* Local Prototypes */
53 /********************/
54
55 /*********************/
56 /* Package Variables */
57 /*********************/
58
59 /*****************************/
60 /* Library Private Variables */
61 /*****************************/
62
63 /*******************/
64 /* Local Variables */
65 /*******************/
66
67 /*-------------------------------------------------------------------------
68 * Function: H5F_shared_get_intent
69 *
70 * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags
71 * (Mainly added to stop non-file routines from poking about in the
72 * H5F_shared_t data structure)
73 *
74 * Return: 'intent' on success/abort on failure (shouldn't fail)
75 *-------------------------------------------------------------------------
76 */
77 unsigned
H5F_shared_get_intent(const H5F_shared_t * f_sh)78 H5F_shared_get_intent(const H5F_shared_t *f_sh)
79 {
80 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
81 FUNC_ENTER_NOAPI_NOINIT_NOERR
82
83 HDassert(f_sh);
84
85 FUNC_LEAVE_NOAPI(f_sh->flags)
86 } /* end H5F_shared_get_intent() */
87
88 /*-------------------------------------------------------------------------
89 * Function: H5F_get_intent
90 *
91 * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags
92 * (Mainly added to stop non-file routines from poking about in the
93 * H5F_t data structure)
94 *
95 * Return: 'intent' on success/abort on failure (shouldn't fail)
96 *-------------------------------------------------------------------------
97 */
98 unsigned
H5F_get_intent(const H5F_t * f)99 H5F_get_intent(const H5F_t *f)
100 {
101 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
102 FUNC_ENTER_NOAPI_NOINIT_NOERR
103
104 HDassert(f);
105
106 FUNC_LEAVE_NOAPI(f->shared->flags)
107 } /* end H5F_get_intent() */
108
109 /*-------------------------------------------------------------------------
110 * Function: H5F_get_low_bound
111 *
112 * Purpose: Quick and dirty routine to retrieve the file's low_bound.
113 * (Mainly added to stop non-file routines from poking about in the
114 * H5F_t data structure)
115 *
116 * Return: low_bound on success/abort on failure (shouldn't fail)
117 *
118 * Programmer: Vailin Choi; June 2016
119 *
120 *-------------------------------------------------------------------------
121 */
122 H5F_libver_t
H5F_get_low_bound(const H5F_t * f)123 H5F_get_low_bound(const H5F_t *f)
124 {
125 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
126 FUNC_ENTER_NOAPI_NOINIT_NOERR
127
128 HDassert(f);
129
130 FUNC_LEAVE_NOAPI(f->shared->low_bound)
131 } /* end H5F_get_low_bound() */
132
133 /*-------------------------------------------------------------------------
134 * Function: H5F_get_high_bound
135 *
136 * Purpose: Quick and dirty routine to retrieve the file's high_bound.
137 * (Mainly added to stop non-file routines from poking about in the
138 * H5F_t data structure)
139 *
140 * Return: high_bound on success/abort on failure (shouldn't fail)
141 *
142 * Programmer: Vailin Choi; June 2016
143 *
144 *-------------------------------------------------------------------------
145 */
146 H5F_libver_t
H5F_get_high_bound(const H5F_t * f)147 H5F_get_high_bound(const H5F_t *f)
148 {
149 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
150 FUNC_ENTER_NOAPI_NOINIT_NOERR
151
152 HDassert(f);
153
154 FUNC_LEAVE_NOAPI(f->shared->high_bound)
155 } /* end H5F_get_high_bound() */
156
157 /*-------------------------------------------------------------------------
158 * Function: H5F_get_open_name
159 *
160 * Purpose: Retrieve the name used to open a file.
161 *
162 * Return: Success: The name of the file.
163 * Failure: ? (should not happen)
164 *-------------------------------------------------------------------------
165 */
166 char *
H5F_get_open_name(const H5F_t * f)167 H5F_get_open_name(const H5F_t *f)
168 {
169 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
170 FUNC_ENTER_NOAPI_NOINIT_NOERR
171
172 HDassert(f);
173 HDassert(f->open_name);
174
175 FUNC_LEAVE_NOAPI(f->open_name)
176 } /* end H5F_get_open_name() */
177
178 /*-------------------------------------------------------------------------
179 * Function: H5F_get_actual_name
180 *
181 * Purpose: Retrieve the actual name of a file, after resolving symlinks, etc.
182 *
183 * Return: Success: The name of the file.
184 * Failure: ? (should not happen)
185 *-------------------------------------------------------------------------
186 */
187 char *
H5F_get_actual_name(const H5F_t * f)188 H5F_get_actual_name(const H5F_t *f)
189 {
190 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
191 FUNC_ENTER_NOAPI_NOINIT_NOERR
192
193 HDassert(f);
194 HDassert(f->actual_name);
195
196 FUNC_LEAVE_NOAPI(f->actual_name)
197 } /* end H5F_get_actual_name() */
198
199 /*-------------------------------------------------------------------------
200 * Function: H5F_get_extpath
201 *
202 * Purpose: Retrieve the file's 'extpath' flags
203 * This is used by H5L_extern_traverse() and H5D_build_file_prefix()
204 * to retrieve the main file's location when searching the target file.
205 *
206 * Return: 'extpath' on success/abort on failure (shouldn't fail)
207 *-------------------------------------------------------------------------
208 */
209 char *
H5F_get_extpath(const H5F_t * f)210 H5F_get_extpath(const H5F_t *f)
211 {
212 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
213 FUNC_ENTER_NOAPI_NOINIT_NOERR
214
215 HDassert(f);
216 HDassert(f->shared);
217 HDassert(f->shared->extpath);
218
219 FUNC_LEAVE_NOAPI(f->shared->extpath)
220 } /* end H5F_get_extpath() */
221
222 /*-------------------------------------------------------------------------
223 * Function: H5F_get_shared
224 *
225 * Purpose: Retrieve the file's 'shared' pointer
226 *
227 * Return: 'shared' on success/abort on failure (shouldn't fail)
228 *-------------------------------------------------------------------------
229 */
230 H5F_shared_t *
H5F_get_shared(const H5F_t * f)231 H5F_get_shared(const H5F_t *f)
232 {
233 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
234 FUNC_ENTER_NOAPI_NOINIT_NOERR
235
236 HDassert(f);
237
238 FUNC_LEAVE_NOAPI(f->shared)
239 } /* end H5F_get_shared() */
240
241 /*-------------------------------------------------------------------------
242 * Function: H5F_same_shared
243 *
244 * Purpose: Determine if two files have the same shared file pointer
245 *
246 * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
247 *-------------------------------------------------------------------------
248 */
249 hbool_t
H5F_same_shared(const H5F_t * f1,const H5F_t * f2)250 H5F_same_shared(const H5F_t *f1, const H5F_t *f2)
251 {
252 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
253 FUNC_ENTER_NOAPI_NOINIT_NOERR
254
255 HDassert(f1);
256 HDassert(f1->shared);
257 HDassert(f2);
258 HDassert(f2->shared);
259
260 FUNC_LEAVE_NOAPI(f1->shared == f2->shared)
261 } /* end H5F_same_shared() */
262
263 /*-------------------------------------------------------------------------
264 * Function: H5F_get_nopen_objs
265 *
266 * Purpose: Retrieve the file's 'nopen_objs' value
267 *
268 * Return: 'nopen_objs' on success/abort on failure (shouldn't fail)
269 *-------------------------------------------------------------------------
270 */
271 unsigned
H5F_get_nopen_objs(const H5F_t * f)272 H5F_get_nopen_objs(const H5F_t *f)
273 {
274 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
275 FUNC_ENTER_NOAPI_NOINIT_NOERR
276
277 HDassert(f);
278
279 FUNC_LEAVE_NOAPI(f->nopen_objs)
280 } /* end H5F_get_nopen_objs() */
281
282 /*-------------------------------------------------------------------------
283 * Function: H5F_file_id_exists
284 *
285 * Purpose: Determines if a file ID exists for this file struct
286 *
287 * Return: TRUE/FALSE
288 *-------------------------------------------------------------------------
289 */
290 hbool_t
H5F_file_id_exists(const H5F_t * f)291 H5F_file_id_exists(const H5F_t *f)
292 {
293 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
294 FUNC_ENTER_NOAPI_NOINIT_NOERR
295
296 HDassert(f);
297
298 FUNC_LEAVE_NOAPI(f->id_exists)
299 } /* end H5F_file_id_exists() */
300
301 /*-------------------------------------------------------------------------
302 * Function: H5F_get_parent
303 *
304 * Purpose: Retrieve the file's 'parent' pointer
305 *
306 * Return: 'parent' on success/abort on failure (shouldn't fail)
307 *-------------------------------------------------------------------------
308 */
309 H5F_t *
H5F_get_parent(const H5F_t * f)310 H5F_get_parent(const H5F_t *f)
311 {
312 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
313 FUNC_ENTER_NOAPI_NOINIT_NOERR
314
315 HDassert(f);
316
317 FUNC_LEAVE_NOAPI(f->parent)
318 } /* end H5F_get_parent() */
319
320 /*-------------------------------------------------------------------------
321 * Function: H5F_get_nmounts
322 *
323 * Purpose: Retrieve the file's 'nmounts' value
324 *
325 * Return: 'nmounts' on success/abort on failure (shouldn't fail)
326 *-------------------------------------------------------------------------
327 */
328 unsigned
H5F_get_nmounts(const H5F_t * f)329 H5F_get_nmounts(const H5F_t *f)
330 {
331 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
332 FUNC_ENTER_NOAPI_NOINIT_NOERR
333
334 HDassert(f);
335
336 FUNC_LEAVE_NOAPI(f->nmounts)
337 } /* end H5F_get_nmounts() */
338
339 /*-------------------------------------------------------------------------
340 * Function: H5F_get_read_attempts
341 *
342 * Purpose: Retrieve the file's 'read_attempts' value
343 *
344 * Return: '# of read attempts' on success/abort on failure (shouldn't fail)
345 *-------------------------------------------------------------------------
346 */
347 unsigned
H5F_get_read_attempts(const H5F_t * f)348 H5F_get_read_attempts(const H5F_t *f)
349 {
350 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
351 FUNC_ENTER_NOAPI_NOINIT_NOERR
352
353 HDassert(f);
354
355 FUNC_LEAVE_NOAPI(f->shared->read_attempts)
356 } /* end H5F_get_read_attempts() */
357
358 /*-------------------------------------------------------------------------
359 * Function: H5F_get_fcpl
360 *
361 * Purpose: Retrieve the value of a file's FCPL.
362 *
363 * Return: Success: The FCPL for the file.
364 * Failure: ? (should not happen)
365 *-------------------------------------------------------------------------
366 */
367 hid_t
H5F_get_fcpl(const H5F_t * f)368 H5F_get_fcpl(const H5F_t *f)
369 {
370 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
371 FUNC_ENTER_NOAPI_NOINIT_NOERR
372
373 HDassert(f);
374 HDassert(f->shared);
375
376 FUNC_LEAVE_NOAPI(f->shared->fcpl_id)
377 } /* end H5F_get_fcpl() */
378
379 /*-------------------------------------------------------------------------
380 * Function: H5F_sizeof_addr
381 *
382 * Purpose: Quick and dirty routine to retrieve the size of the file's size_t
383 * (Mainly added to stop non-file routines from poking about in the
384 * H5F_t data structure)
385 *
386 * Return: 'sizeof_addr' on success/abort on failure (shouldn't fail)
387 *-------------------------------------------------------------------------
388 */
389 uint8_t
H5F_sizeof_addr(const H5F_t * f)390 H5F_sizeof_addr(const H5F_t *f)
391 {
392 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
393 FUNC_ENTER_NOAPI_NOINIT_NOERR
394
395 HDassert(f);
396 HDassert(f->shared);
397
398 FUNC_LEAVE_NOAPI(f->shared->sizeof_addr)
399 } /* end H5F_sizeof_addr() */
400
401 /*-------------------------------------------------------------------------
402 * Function: H5F_sizeof_size
403 *
404 * Purpose: Quick and dirty routine to retrieve the size of the file's off_t
405 * (Mainly added to stop non-file routines from poking about in the
406 * H5F_t data structure)
407 *
408 * Return: 'sizeof_size' on success/abort on failure (shouldn't fail)
409 *-------------------------------------------------------------------------
410 */
411 uint8_t
H5F_sizeof_size(const H5F_t * f)412 H5F_sizeof_size(const H5F_t *f)
413 {
414 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
415 FUNC_ENTER_NOAPI_NOINIT_NOERR
416
417 HDassert(f);
418 HDassert(f->shared);
419
420 FUNC_LEAVE_NOAPI(f->shared->sizeof_size)
421 } /* H5F_sizeof_size() */
422
423 /*-------------------------------------------------------------------------
424 * Function: H5F_get_sohm_addr
425 *
426 * Purpose: Retrieve the file's 'sohm_addr' value
427 *
428 * Return: 'sohm_addr' on success/abort on failure (shouldn't fail)
429 *-------------------------------------------------------------------------
430 */
431 haddr_t
H5F_get_sohm_addr(const H5F_t * f)432 H5F_get_sohm_addr(const H5F_t *f)
433 {
434 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
435 FUNC_ENTER_NOAPI_NOINIT_NOERR
436
437 HDassert(f);
438 HDassert(f->shared);
439
440 FUNC_LEAVE_NOAPI(f->shared->sohm_addr)
441 } /* end H5F_get_sohm_addr() */
442
443 /*-------------------------------------------------------------------------
444 * Function: H5F_get_sohm_vers
445 *
446 * Purpose: Retrieve the file's 'sohm_vers' value
447 *
448 * Return: 'sohm_vers' on success/abort on failure (shouldn't fail)
449 *-------------------------------------------------------------------------
450 */
451 unsigned
H5F_get_sohm_vers(const H5F_t * f)452 H5F_get_sohm_vers(const H5F_t *f)
453 {
454 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
455 FUNC_ENTER_NOAPI_NOINIT_NOERR
456
457 HDassert(f);
458 HDassert(f->shared);
459
460 FUNC_LEAVE_NOAPI(f->shared->sohm_vers)
461 } /* end H5F_get_sohm_vers() */
462
463 /*-------------------------------------------------------------------------
464 * Function: H5F_get_sohm_nindexes
465 *
466 * Purpose: Retrieve the file's 'sohm_nindexes' value
467 *
468 * Return: 'sohm_nindexes' on success/abort on failure (shouldn't fail)
469 *-------------------------------------------------------------------------
470 */
471 unsigned
H5F_get_sohm_nindexes(const H5F_t * f)472 H5F_get_sohm_nindexes(const H5F_t *f)
473 {
474 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
475 FUNC_ENTER_NOAPI_NOINIT_NOERR
476
477 HDassert(f);
478 HDassert(f->shared);
479
480 FUNC_LEAVE_NOAPI(f->shared->sohm_nindexes)
481 } /* end H5F_get_sohm_nindexes() */
482
483 /*-------------------------------------------------------------------------
484 * Function: H5F_sym_leaf_k
485 *
486 * Purpose: Replaced a macro to retrieve the symbol table leaf size,
487 * now that the generic properties are being used to store
488 * the values.
489 *
490 * Return: Success: Non-negative, and the symbol table leaf size is
491 * returned.
492 * Failure: Negative (should not happen)
493 *-------------------------------------------------------------------------
494 */
495 unsigned
H5F_sym_leaf_k(const H5F_t * f)496 H5F_sym_leaf_k(const H5F_t *f)
497 {
498 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
499 FUNC_ENTER_NOAPI_NOINIT_NOERR
500
501 HDassert(f);
502 HDassert(f->shared);
503 HDassert(f->shared->sblock);
504
505 FUNC_LEAVE_NOAPI(f->shared->sblock->sym_leaf_k)
506 } /* end H5F_sym_leaf_k() */
507
508 /*-------------------------------------------------------------------------
509 * Function: H5F_get_min_dset_ohdr
510 *
511 * Purpose: Get the setting flag for minimized dataset object headers
512 *
513 * Return: TRUE/FALSE as set in file
514 *-------------------------------------------------------------------------
515 */
516 hbool_t
H5F_get_min_dset_ohdr(const H5F_t * f)517 H5F_get_min_dset_ohdr(const H5F_t *f)
518 {
519 FUNC_ENTER_NOAPI_NOINIT_NOERR
520
521 HDassert(f);
522
523 FUNC_LEAVE_NOAPI(f->shared->crt_dset_min_ohdr_flag)
524 } /* end H5F_get_min_dset_ohdr */
525
526 /*-------------------------------------------------------------------------
527 * Function: H5F_Kvalue
528 *
529 * Purpose: Replaced a macro to retrieve a B-tree key value for a certain
530 * type, now that the generic properties are being used to store
531 * the B-tree values.
532 *
533 * Return: Success: Non-negative, and the B-tree key value is
534 * returned.
535 * Failure: Negative (should not happen)
536 *-------------------------------------------------------------------------
537 */
538 unsigned
H5F_Kvalue(const H5F_t * f,const H5B_class_t * type)539 H5F_Kvalue(const H5F_t *f, const H5B_class_t *type)
540 {
541 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
542 FUNC_ENTER_NOAPI_NOINIT_NOERR
543
544 HDassert(f);
545 HDassert(f->shared);
546 HDassert(f->shared->sblock);
547 HDassert(type);
548
549 FUNC_LEAVE_NOAPI(f->shared->sblock->btree_k[type->id])
550 } /* end H5F_Kvalue() */
551
552 /*-------------------------------------------------------------------------
553 * Function: H5F_get_nrefs
554 *
555 * Purpose: Retrieve the file's 'nrefs' value
556 *
557 * Return: 'nrefs' on success/abort on failure (shouldn't fail)
558 *-------------------------------------------------------------------------
559 */
560 unsigned
H5F_get_nrefs(const H5F_t * f)561 H5F_get_nrefs(const H5F_t *f)
562 {
563 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
564 FUNC_ENTER_NOAPI_NOINIT_NOERR
565
566 HDassert(f);
567 HDassert(f->shared);
568
569 FUNC_LEAVE_NOAPI(f->shared->nrefs)
570 } /* end H5F_get_nrefs() */
571
572 /*-------------------------------------------------------------------------
573 * Function: H5F_rdcc_nslots
574 *
575 * Purpose: Replaced a macro to retrieve the raw data cache number of slots,
576 * now that the generic properties are being used to store
577 * the values.
578 *
579 * Return: Success: Non-negative, and the raw data cache number of
580 * of slots is returned.
581 * Failure: Negative (should not happen)
582 *-------------------------------------------------------------------------
583 */
584 size_t
H5F_rdcc_nslots(const H5F_t * f)585 H5F_rdcc_nslots(const H5F_t *f)
586 {
587 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
588 FUNC_ENTER_NOAPI_NOINIT_NOERR
589
590 HDassert(f);
591 HDassert(f->shared);
592
593 FUNC_LEAVE_NOAPI(f->shared->rdcc_nslots)
594 } /* end H5F_rdcc_nelmts() */
595
596 /*-------------------------------------------------------------------------
597 * Function: H5F_rdcc_nbytes
598 *
599 * Purpose: Replaced a macro to retrieve the raw data cache number of bytes,
600 * now that the generic properties are being used to store
601 * the values.
602 *
603 * Return: Success: Non-negative, and the raw data cache number of
604 * of bytes is returned.
605 * Failure: Negative (should not happen)
606 *-------------------------------------------------------------------------
607 */
608 size_t
H5F_rdcc_nbytes(const H5F_t * f)609 H5F_rdcc_nbytes(const H5F_t *f)
610 {
611 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
612 FUNC_ENTER_NOAPI_NOINIT_NOERR
613
614 HDassert(f);
615 HDassert(f->shared);
616
617 FUNC_LEAVE_NOAPI(f->shared->rdcc_nbytes)
618 } /* end H5F_rdcc_nbytes() */
619
620 /*-------------------------------------------------------------------------
621 * Function: H5F_rdcc_w0
622 *
623 * Purpose: Replaced a macro to retrieve the raw data cache 'w0' value
624 * now that the generic properties are being used to store
625 * the values.
626 *
627 * Return: Success: Non-negative, and the raw data cache 'w0' value
628 * is returned.
629 * Failure: Negative (should not happen)
630 *-------------------------------------------------------------------------
631 */
632 double
H5F_rdcc_w0(const H5F_t * f)633 H5F_rdcc_w0(const H5F_t *f)
634 {
635 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
636 FUNC_ENTER_NOAPI_NOINIT_NOERR
637
638 HDassert(f);
639 HDassert(f->shared);
640
641 FUNC_LEAVE_NOAPI(f->shared->rdcc_w0)
642 } /* end H5F_rdcc_w0() */
643
644 /*-------------------------------------------------------------------------
645 * Function: H5F_get_base_addr
646 *
647 * Purpose: Quick and dirty routine to retrieve the file's 'base_addr' value
648 * (Mainly added to stop non-file routines from poking about in the
649 * H5F_t data structure)
650 *
651 * Return: Non-negative on success/Negative on failure
652 *-------------------------------------------------------------------------
653 */
654 haddr_t
H5F_get_base_addr(const H5F_t * f)655 H5F_get_base_addr(const H5F_t *f)
656 {
657 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
658 FUNC_ENTER_NOAPI_NOINIT_NOERR
659
660 HDassert(f);
661 HDassert(f->shared);
662 HDassert(f->shared->sblock);
663
664 FUNC_LEAVE_NOAPI(f->shared->sblock->base_addr)
665 } /* end H5F_get_base_addr() */
666
667 /*-------------------------------------------------------------------------
668 * Function: H5F_grp_btree_shared
669 *
670 * Purpose: Replaced a macro to retrieve the shared B-tree node info
671 * now that the generic properties are being used to store
672 * the values.
673 *
674 * Return: Success: Non-void, and the shared B-tree node info
675 * is returned.
676 * Failure: void (should not happen)
677 *-------------------------------------------------------------------------
678 */
679 H5UC_t *
H5F_grp_btree_shared(const H5F_t * f)680 H5F_grp_btree_shared(const H5F_t *f)
681 {
682 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
683 FUNC_ENTER_NOAPI_NOINIT_NOERR
684
685 HDassert(f);
686 HDassert(f->shared);
687
688 FUNC_LEAVE_NOAPI(f->shared->grp_btree_shared)
689 } /* end H5F_grp_btree_shared() */
690
691 /*-------------------------------------------------------------------------
692 * Function: H5F_sieve_buf_size
693 *
694 * Purpose: Replaced a macro to retrieve the dataset sieve buffer size
695 * now that the generic properties are being used to store
696 * the values.
697 *
698 * Return: Success: Non-void, and the dataset sieve buffer size
699 * is returned.
700 * Failure: void (should not happen)
701 *-------------------------------------------------------------------------
702 */
703 size_t
H5F_sieve_buf_size(const H5F_t * f)704 H5F_sieve_buf_size(const H5F_t *f)
705 {
706 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
707 FUNC_ENTER_NOAPI_NOINIT_NOERR
708
709 HDassert(f);
710 HDassert(f->shared);
711
712 FUNC_LEAVE_NOAPI(f->shared->sieve_buf_size)
713 } /* end H5F_sieve_buf_size() */
714
715 /*-------------------------------------------------------------------------
716 * Function: H5F_gc_ref
717 *
718 * Purpose: Replaced a macro to retrieve the "garbage collect
719 * references flag" now that the generic properties are being used
720 * to store the values.
721 *
722 * Return: Success: The "garbage collect references flag" is returned.
723 * Failure: (should not happen)
724 *
725 * Programmer: Quincey Koziol
726 * Jul 8 2005
727 *
728 *-------------------------------------------------------------------------
729 */
730 unsigned
H5F_gc_ref(const H5F_t * f)731 H5F_gc_ref(const H5F_t *f)
732 {
733 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
734 FUNC_ENTER_NOAPI_NOINIT_NOERR
735
736 HDassert(f);
737 HDassert(f->shared);
738
739 FUNC_LEAVE_NOAPI(f->shared->gc_ref)
740 } /* end H5F_gc_ref() */
741
742 /*-------------------------------------------------------------------------
743 * Function: H5F_get_fc_degree
744 *
745 * Purpose: Retrieve the 'file close degree' for the file.
746 *
747 * Return: Success: Non-negative, the 'file close degree'
748 * Failure: (can't happen)
749 *-------------------------------------------------------------------------
750 */
751 H5F_close_degree_t
H5F_get_fc_degree(const H5F_t * f)752 H5F_get_fc_degree(const H5F_t *f)
753 {
754 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
755 FUNC_ENTER_NOAPI_NOINIT_NOERR
756
757 HDassert(f);
758 HDassert(f->shared);
759
760 FUNC_LEAVE_NOAPI(f->shared->fc_degree)
761 } /* end H5F_get_fc_degree() */
762
763 /*-------------------------------------------------------------------------
764 * Function: H5F_get_evict_on_close
765 *
766 * Purpose: Checks if evict-on-close is desired for objects in the
767 * file.
768 *
769 * Return: Success: Flag indicating whether the evict-on-close
770 * property was set for the file.
771 * Failure: (can't happen)
772 *-------------------------------------------------------------------------
773 */
774 hbool_t
H5F_get_evict_on_close(const H5F_t * f)775 H5F_get_evict_on_close(const H5F_t *f)
776 {
777 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
778 FUNC_ENTER_NOAPI_NOINIT_NOERR
779
780 HDassert(f);
781 HDassert(f->shared);
782
783 FUNC_LEAVE_NOAPI(f->shared->evict_on_close)
784 } /* end H5F_get_evict_on_close() */
785
786 /*-------------------------------------------------------------------------
787 * Function: H5F_store_msg_crt_idx
788 *
789 * Purpose: Retrieve the 'store message creation index' flag for the file.
790 *
791 * Return: Success: Non-negative, the 'store message creation index' flag
792 * Failure: (can't happen)
793 *-------------------------------------------------------------------------
794 */
795 hbool_t
H5F_store_msg_crt_idx(const H5F_t * f)796 H5F_store_msg_crt_idx(const H5F_t *f)
797 {
798 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
799 FUNC_ENTER_NOAPI_NOINIT_NOERR
800
801 HDassert(f);
802 HDassert(f->shared);
803
804 FUNC_LEAVE_NOAPI(f->shared->store_msg_crt_idx)
805 } /* end H5F_store_msg_crt_idx() */
806
807 /*-------------------------------------------------------------------------
808 * Function: H5F_shared_has_feature
809 *
810 * Purpose: Check if a file has a particular feature enabled
811 *
812 * Return: Success: Non-negative - TRUE or FALSE
813 * Failure: Negative (should not happen)
814 *-------------------------------------------------------------------------
815 */
816 hbool_t
H5F_shared_has_feature(const H5F_shared_t * f_sh,unsigned feature)817 H5F_shared_has_feature(const H5F_shared_t *f_sh, unsigned feature)
818 {
819 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
820 FUNC_ENTER_NOAPI_NOINIT_NOERR
821
822 HDassert(f_sh);
823
824 FUNC_LEAVE_NOAPI((hbool_t)(f_sh->lf->feature_flags & feature))
825 } /* end H5F_shared_has_feature() */
826
827 /*-------------------------------------------------------------------------
828 * Function: H5F_has_feature
829 *
830 * Purpose: Check if a file has a particular feature enabled
831 *
832 * Return: Success: Non-negative - TRUE or FALSE
833 * Failure: Negative (should not happen)
834 *-------------------------------------------------------------------------
835 */
836 hbool_t
H5F_has_feature(const H5F_t * f,unsigned feature)837 H5F_has_feature(const H5F_t *f, unsigned feature)
838 {
839 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
840 FUNC_ENTER_NOAPI_NOINIT_NOERR
841
842 HDassert(f);
843 HDassert(f->shared);
844
845 FUNC_LEAVE_NOAPI((hbool_t)(f->shared->lf->feature_flags & feature))
846 } /* end H5F_has_feature() */
847
848 /*-------------------------------------------------------------------------
849 * Function: H5F_get_driver_id
850 *
851 * Purpose: Quick and dirty routine to retrieve the file's 'driver_id' value
852 * (Mainly added to stop non-file routines from poking about in the
853 * H5F_t data structure)
854 *
855 * Return: 'driver_id' on success/abort on failure (shouldn't fail)
856 *-------------------------------------------------------------------------
857 */
858 hid_t
H5F_get_driver_id(const H5F_t * f)859 H5F_get_driver_id(const H5F_t *f)
860 {
861 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
862 FUNC_ENTER_NOAPI_NOINIT_NOERR
863
864 HDassert(f);
865 HDassert(f->shared);
866 HDassert(f->shared->lf);
867
868 FUNC_LEAVE_NOAPI(f->shared->lf->driver_id)
869 } /* end H5F_get_driver_id() */
870
871 /*-------------------------------------------------------------------------
872 * Function: H5F_get_fileno
873 *
874 * Purpose: Quick and dirty routine to retrieve the file's 'fileno' value
875 * (Mainly added to stop non-file routines from poking about in the
876 * H5F_t data structure)
877 *
878 * Return: Non-negative on success/Negative on failure
879 *-------------------------------------------------------------------------
880 */
881 herr_t
H5F_get_fileno(const H5F_t * f,unsigned long * filenum)882 H5F_get_fileno(const H5F_t *f, unsigned long *filenum)
883 {
884 herr_t ret_value = SUCCEED;
885
886 FUNC_ENTER_NOAPI(FAIL)
887
888 HDassert(f);
889 HDassert(f->shared);
890 HDassert(f->shared->lf);
891 HDassert(filenum);
892
893 /* Retrieve the file's serial number */
894 if (H5FD_get_fileno(f->shared->lf, filenum) < 0)
895 HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, FAIL, "can't retrieve fileno")
896
897 done:
898 FUNC_LEAVE_NOAPI(ret_value)
899 } /* end H5F_get_fileno() */
900
901 /*-------------------------------------------------------------------------
902 * Function: H5F_shared_get_eoa
903 *
904 * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value
905 *
906 * Return: Non-negative on success/Negative on failure
907 *-------------------------------------------------------------------------
908 */
909 haddr_t
H5F_shared_get_eoa(const H5F_shared_t * f_sh,H5FD_mem_t type)910 H5F_shared_get_eoa(const H5F_shared_t *f_sh, H5FD_mem_t type)
911 {
912 haddr_t ret_value = HADDR_UNDEF; /* Return value */
913
914 FUNC_ENTER_NOAPI(HADDR_UNDEF)
915
916 HDassert(f_sh);
917
918 /* Dispatch to driver */
919 if (HADDR_UNDEF == (ret_value = H5FD_get_eoa(f_sh->lf, type)))
920 HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed")
921
922 done:
923 FUNC_LEAVE_NOAPI(ret_value)
924 } /* end H5F_shared_get_eoa() */
925
926 /*-------------------------------------------------------------------------
927 * Function: H5F_get_eoa
928 *
929 * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value
930 *
931 * Return: Non-negative on success/Negative on failure
932 *-------------------------------------------------------------------------
933 */
934 haddr_t
H5F_get_eoa(const H5F_t * f,H5FD_mem_t type)935 H5F_get_eoa(const H5F_t *f, H5FD_mem_t type)
936 {
937 haddr_t ret_value = HADDR_UNDEF; /* Return value */
938
939 FUNC_ENTER_NOAPI(HADDR_UNDEF)
940
941 HDassert(f);
942 HDassert(f->shared);
943
944 /* Dispatch to driver */
945 if (HADDR_UNDEF == (ret_value = H5FD_get_eoa(f->shared->lf, type)))
946 HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed")
947
948 done:
949 FUNC_LEAVE_NOAPI(ret_value)
950 } /* end H5F_get_eoa() */
951
952 /*-------------------------------------------------------------------------
953 * Function: H5F_get_vfd_handle
954 *
955 * Purpose: Returns a pointer to the file handle of the low-level file
956 * driver. This is the private function for H5Fget_vfd_handle.
957 *
958 * Return: Success: Non-negative.
959 * Failure: negative.
960 *-------------------------------------------------------------------------
961 */
962 herr_t
H5F_get_vfd_handle(const H5F_t * file,hid_t fapl,void ** file_handle)963 H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_handle)
964 {
965 herr_t ret_value = SUCCEED; /* Return value */
966
967 FUNC_ENTER_NOAPI(FAIL)
968
969 /* Sanity check */
970 HDassert(file);
971 HDassert(file_handle);
972
973 /* Get the VFD handle */
974 if (H5FD_get_vfd_handle(file->shared->lf, fapl, file_handle) < 0)
975 HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver")
976
977 done:
978 FUNC_LEAVE_NOAPI(ret_value)
979 } /* end H5F_get_vfd_handle() */
980
981 /*-------------------------------------------------------------------------
982 * Function: H5F_is_tmp_addr
983 *
984 * Purpose: Quick and dirty routine to determine if an address is in
985 * the 'temporary' file space.
986 * (Mainly added to stop non-file routines from poking about in the
987 * H5F_t data structure)
988 *
989 * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
990 *-------------------------------------------------------------------------
991 */
992 hbool_t
H5F_is_tmp_addr(const H5F_t * f,haddr_t addr)993 H5F_is_tmp_addr(const H5F_t *f, haddr_t addr)
994 {
995 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
996 FUNC_ENTER_NOAPI_NOINIT_NOERR
997
998 HDassert(f);
999 HDassert(f->shared);
1000
1001 FUNC_LEAVE_NOAPI(H5F_addr_le(f->shared->tmp_addr, addr))
1002 } /* end H5F_is_tmp_addr() */
1003
1004 /*-------------------------------------------------------------------------
1005 * Function: H5F_use_tmp_space
1006 *
1007 * Purpose: Quick and dirty routine to determine if using temporary
1008 * file space is allowed for this file.
1009 * (Mainly added to stop non-file routines from poking about in the
1010 * H5F_t data structure)
1011 *
1012 * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
1013 *-------------------------------------------------------------------------
1014 */
1015 hbool_t
H5F_use_tmp_space(const H5F_t * f)1016 H5F_use_tmp_space(const H5F_t *f)
1017 {
1018 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1019 FUNC_ENTER_NOAPI_NOINIT_NOERR
1020
1021 HDassert(f);
1022 HDassert(f->shared);
1023
1024 FUNC_LEAVE_NOAPI(f->shared->use_tmp_space)
1025 } /* end H5F_use_tmp_space() */
1026
1027 #ifdef H5_HAVE_PARALLEL
1028
1029 /*-------------------------------------------------------------------------
1030 * Function: H5F_coll_md_read
1031 *
1032 * Purpose: Retrieve the 'collective metadata reads' flag for the file.
1033 *
1034 * Return: Success: Non-negative, the 'collective metadata reads' flag
1035 * Failure: (can't happen)
1036 *-------------------------------------------------------------------------
1037 */
1038 H5P_coll_md_read_flag_t
H5F_coll_md_read(const H5F_t * f)1039 H5F_coll_md_read(const H5F_t *f)
1040 {
1041 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1042 FUNC_ENTER_NOAPI_NOINIT_NOERR
1043
1044 HDassert(f);
1045
1046 FUNC_LEAVE_NOAPI(f->shared->coll_md_read)
1047 } /* end H5F_coll_md_read() */
1048 #endif /* H5_HAVE_PARALLEL */
1049
1050 /*-------------------------------------------------------------------------
1051 * Function: H5F_use_mdc_logging
1052 *
1053 * Purpose: Quick and dirty routine to determine if using MDC logging
1054 * is enabled for this file.
1055 * (Mainly added to stop non-file routines from poking about in the
1056 * H5F_t data structure)
1057 *
1058 * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
1059 *-------------------------------------------------------------------------
1060 */
1061 hbool_t
H5F_use_mdc_logging(const H5F_t * f)1062 H5F_use_mdc_logging(const H5F_t *f)
1063 {
1064 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1065 FUNC_ENTER_NOAPI_NOINIT_NOERR
1066
1067 HDassert(f);
1068 HDassert(f->shared);
1069
1070 FUNC_LEAVE_NOAPI(f->shared->use_mdc_logging)
1071 } /* end H5F_use_mdc_logging() */
1072
1073 /*-------------------------------------------------------------------------
1074 * Function: H5F_start_mdc_log_on_access
1075 *
1076 * Purpose: Quick and dirty routine to determine if we should start MDC
1077 * logging on access for this file.
1078 * (Mainly added to stop non-file routines from poking about in the
1079 * H5F_t data structure)
1080 *
1081 * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
1082 *-------------------------------------------------------------------------
1083 */
1084 hbool_t
H5F_start_mdc_log_on_access(const H5F_t * f)1085 H5F_start_mdc_log_on_access(const H5F_t *f)
1086 {
1087 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1088 FUNC_ENTER_NOAPI_NOINIT_NOERR
1089
1090 HDassert(f);
1091 HDassert(f->shared);
1092
1093 FUNC_LEAVE_NOAPI(f->shared->start_mdc_log_on_access)
1094 } /* end H5F_start_mdc_log_on_access() */
1095
1096 /*-------------------------------------------------------------------------
1097 * Function: H5F_mdc_log_location
1098 *
1099 * Purpose: Quick and dirty routine to retrieve the MDC log location
1100 * for this file.
1101 * (Mainly added to stop non-file routines from poking about in the
1102 * H5F_t data structure)
1103 *
1104 * Return: TRUE/FALSE on success/abort on failure (shouldn't fail)
1105 *-------------------------------------------------------------------------
1106 */
1107 char *
H5F_mdc_log_location(const H5F_t * f)1108 H5F_mdc_log_location(const H5F_t *f)
1109 {
1110 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1111 FUNC_ENTER_NOAPI_NOINIT_NOERR
1112
1113 HDassert(f);
1114 HDassert(f->shared);
1115
1116 FUNC_LEAVE_NOAPI(f->shared->mdc_log_location)
1117 } /* end H5F_mdc_log_location() */
1118
1119 /*-------------------------------------------------------------------------
1120 * Function: H5F_get_alignment
1121 *
1122 * Purpose: Retrieve the 'alignment' for the file.
1123 *
1124 * Return: Success: Non-negative, the 'alignment'
1125 * Failure: (can't happen)
1126 *-------------------------------------------------------------------------
1127 */
1128 hsize_t
H5F_get_alignment(const H5F_t * f)1129 H5F_get_alignment(const H5F_t *f)
1130 {
1131 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1132 FUNC_ENTER_NOAPI_NOINIT_NOERR
1133
1134 HDassert(f);
1135 HDassert(f->shared);
1136
1137 FUNC_LEAVE_NOAPI(f->shared->alignment)
1138 } /* end H5F_get_alignment() */
1139
1140 /*-------------------------------------------------------------------------
1141 * Function: H5F_get_threshold
1142 *
1143 * Purpose: Retrieve the 'threshold' for alignment in the file.
1144 *
1145 * Return: Success: Non-negative, the 'threshold'
1146 * Failure: (can't happen)
1147 *-------------------------------------------------------------------------
1148 */
1149 hsize_t
H5F_get_threshold(const H5F_t * f)1150 H5F_get_threshold(const H5F_t *f)
1151 {
1152 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1153 FUNC_ENTER_NOAPI_NOINIT_NOERR
1154
1155 HDassert(f);
1156 HDassert(f->shared);
1157
1158 FUNC_LEAVE_NOAPI(f->shared->threshold)
1159 } /* end H5F_get_threshold() */
1160
1161 /*-------------------------------------------------------------------------
1162 * Function: H5F_get_pgend_meta_thres
1163 *
1164 * Purpose: Retrieve the 'page end meta threshold size' for the file.
1165 *
1166 * Return: Success: Non-negative, the 'pgend_meta_thres'
1167 * Failure: (can't happen)
1168 *-------------------------------------------------------------------------
1169 */
1170 hsize_t
H5F_get_pgend_meta_thres(const H5F_t * f)1171 H5F_get_pgend_meta_thres(const H5F_t *f)
1172 {
1173 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1174 FUNC_ENTER_NOAPI_NOINIT_NOERR
1175
1176 HDassert(f);
1177 HDassert(f->shared);
1178
1179 FUNC_LEAVE_NOAPI(f->shared->pgend_meta_thres)
1180 } /* end H5F_get_pgend_meta_thres() */
1181
1182 /*-------------------------------------------------------------------------
1183 * Function: H5F_get_point_of_no_return
1184 *
1185 * Purpose: Retrieve the 'point of no return' value for the file.
1186 *
1187 * Return: Success: Non-negative, the 'point_of_no_return'
1188 * Failure: (can't happen)
1189 *-------------------------------------------------------------------------
1190 */
1191 hbool_t
H5F_get_point_of_no_return(const H5F_t * f)1192 H5F_get_point_of_no_return(const H5F_t *f)
1193 {
1194 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1195 FUNC_ENTER_NOAPI_NOINIT_NOERR
1196
1197 HDassert(f);
1198 HDassert(f->shared);
1199
1200 FUNC_LEAVE_NOAPI(f->shared->point_of_no_return)
1201 } /* end H5F_get_point_of_no_return() */
1202
1203 /*-------------------------------------------------------------------------
1204 * Function: H5F_get_null_fsm_addr
1205 *
1206 * Purpose: Retrieve the 'null_fsm_addr' value for the file.
1207 *
1208 * Return: Success: Non-negative, the 'null_fsm_addr'
1209 * Failure: (can't happen)
1210 *-------------------------------------------------------------------------
1211 */
1212 hbool_t
H5F_get_null_fsm_addr(const H5F_t * f)1213 H5F_get_null_fsm_addr(const H5F_t *f)
1214 {
1215 /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
1216 FUNC_ENTER_NOAPI_NOINIT_NOERR
1217
1218 HDassert(f);
1219 HDassert(f->shared);
1220
1221 FUNC_LEAVE_NOAPI(f->shared->null_fsm_addr)
1222 } /* end H5F_get_null_fsm_addr() */
1223
1224 /*-------------------------------------------------------------------------
1225 * Function: H5F_get_vol_cls
1226 *
1227 * Purpose: Get the VOL class for the file
1228 *
1229 * Return: VOL class pointer for file, can't fail
1230 *
1231 * Programmer: Quincey Koziol
1232 * Saturday, August 17, 2019
1233 *
1234 *-------------------------------------------------------------------------
1235 */
1236 const H5VL_class_t *
H5F_get_vol_cls(const H5F_t * f)1237 H5F_get_vol_cls(const H5F_t *f)
1238 {
1239 FUNC_ENTER_NOAPI_NOINIT_NOERR
1240
1241 HDassert(f);
1242 HDassert(f->shared);
1243
1244 FUNC_LEAVE_NOAPI(f->shared->vol_cls)
1245 } /* end H5F_get_vol_cls */
1246
1247 /*-------------------------------------------------------------------------
1248 * Function: H5F_get_vol_obj
1249 *
1250 * Purpose: Get the VOL object for the file
1251 *
1252 * Return: VOL object pointer for file, can't fail
1253 *
1254 *-------------------------------------------------------------------------
1255 */
1256 H5VL_object_t *
H5F_get_vol_obj(const H5F_t * f)1257 H5F_get_vol_obj(const H5F_t *f)
1258 {
1259 FUNC_ENTER_NOAPI_NOINIT_NOERR
1260
1261 HDassert(f);
1262
1263 FUNC_LEAVE_NOAPI(f->vol_obj)
1264 } /* end H5F_get_vol_obj */
1265
1266 /*-------------------------------------------------------------------------
1267 * Function: H5F_get_cont_info
1268 *
1269 * Purpose: Get the VOL container info for the file
1270 *
1271 * Return: Success: Non-negative
1272 * Failure: Negative
1273 *
1274 * Programmer: Quincey Koziol
1275 * Saturday, August 17, 2019
1276 *
1277 *-------------------------------------------------------------------------
1278 */
1279 herr_t
H5F__get_cont_info(const H5F_t * f,H5VL_file_cont_info_t * info)1280 H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info)
1281 {
1282 herr_t ret_value = SUCCEED; /* Return value */
1283
1284 FUNC_ENTER_PACKAGE
1285
1286 /* Sanity checks */
1287 HDassert(f);
1288 HDassert(f->shared);
1289
1290 /* Verify structure version */
1291 if (info->version != H5VL_CONTAINER_INFO_VERSION)
1292 HGOTO_ERROR(H5E_FILE, H5E_VERSION, FAIL, "wrong container info version #")
1293
1294 /* Set the container info fields */
1295 info->feature_flags = 0; /* None currently defined */
1296 info->token_size = H5F_SIZEOF_ADDR(f);
1297 info->blob_id_size = H5HG_HEAP_ID_SIZE(f);
1298
1299 done:
1300 FUNC_LEAVE_NOAPI(ret_value)
1301 } /* end H5F_get_cont_info */
1302
1303 /*-------------------------------------------------------------------------
1304 * Function: H5F_get_file_locking
1305 *
1306 * Purpose: Get the file locking flag for the file
1307 *
1308 * Return: TRUE/FALSE
1309 *
1310 *-------------------------------------------------------------------------
1311 */
1312 hbool_t
H5F_get_file_locking(const H5F_t * f)1313 H5F_get_file_locking(const H5F_t *f)
1314 {
1315 FUNC_ENTER_NOAPI_NOINIT_NOERR
1316
1317 HDassert(f);
1318 HDassert(f->shared);
1319
1320 FUNC_LEAVE_NOAPI(f->shared->use_file_locking)
1321 } /* end H5F_get_file_locking */
1322