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 | | * Purpose: Free-space metadata statistics functions. |
15 | | * |
16 | | */ |
17 | | |
18 | | /****************/ |
19 | | /* Module Setup */ |
20 | | /****************/ |
21 | | |
22 | | #include "H5FSmodule.h" /* This source code file is part of the H5FS module */ |
23 | | |
24 | | /***********/ |
25 | | /* Headers */ |
26 | | /***********/ |
27 | | #include "H5private.h" /* Generic Functions */ |
28 | | #include "H5Eprivate.h" /* Error handling */ |
29 | | #include "H5FSpkg.h" /* Free-space manager */ |
30 | | |
31 | | /****************/ |
32 | | /* Local Macros */ |
33 | | /****************/ |
34 | | |
35 | | /********************/ |
36 | | /* Package Typedefs */ |
37 | | /********************/ |
38 | | |
39 | | /******************/ |
40 | | /* Local Typedefs */ |
41 | | /******************/ |
42 | | |
43 | | /********************/ |
44 | | /* Local Prototypes */ |
45 | | /********************/ |
46 | | |
47 | | /*********************/ |
48 | | /* Package Variables */ |
49 | | /*********************/ |
50 | | |
51 | | /*****************************/ |
52 | | /* Library Private Variables */ |
53 | | /*****************************/ |
54 | | |
55 | | /*******************/ |
56 | | /* Local Variables */ |
57 | | /*******************/ |
58 | | |
59 | | /*------------------------------------------------------------------------- |
60 | | * Function: H5FS_stat_info |
61 | | * |
62 | | * Purpose: Retrieve metadata statistics for the free-space manager |
63 | | * |
64 | | * Return: SUCCEED (Can't fail) |
65 | | * |
66 | | *------------------------------------------------------------------------- |
67 | | */ |
68 | | herr_t |
69 | | H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *stats) |
70 | 20 | { |
71 | 20 | FUNC_ENTER_NOAPI_NOINIT_NOERR |
72 | | |
73 | | /* Check arguments. */ |
74 | 20 | assert(frsp); |
75 | 20 | assert(stats); |
76 | | |
77 | | /* Report statistics for free space */ |
78 | 20 | stats->tot_space = frsp->tot_space; |
79 | 20 | stats->tot_sect_count = frsp->tot_sect_count; |
80 | 20 | stats->serial_sect_count = frsp->serial_sect_count; |
81 | 20 | stats->ghost_sect_count = frsp->ghost_sect_count; |
82 | 20 | stats->addr = frsp->addr; |
83 | 20 | stats->hdr_size = (hsize_t)H5FS_HEADER_SIZE(f); |
84 | 20 | stats->sect_addr = frsp->sect_addr; |
85 | 20 | stats->alloc_sect_size = frsp->alloc_sect_size; |
86 | 20 | stats->sect_size = frsp->sect_size; |
87 | | |
88 | 20 | FUNC_LEAVE_NOAPI(SUCCEED) |
89 | 20 | } /* H5FS_stat_info() */ |