Coverage Report

Created: 2026-11-22 07:04

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