1IOCTL-XFS-AG-GEOMETRY(2) System Calls Manual IOCTL-XFS-AG-GEOMETRY(2)
2
3
4
6 ioctl_xfs_ag_geometry - query XFS allocation group geometry information
7
9 #include <xfs/xfs_fs.h>
10
11 int ioctl(int fd, XFS_IOC_AG_GEOMETRY, struct xfs_ag_geometry *arg);
12
14 This XFS ioctl retrieves the geometry information for a given alloca‐
15 tion group. The geometry information is conveyed in a structure of the
16 following form:
17
18 struct xfs_ag_geometry {
19 uint32_t ag_number;
20 uint32_t ag_length;
21 uint32_t ag_freeblks;
22 uint32_t ag_icount;
23 uint32_t ag_ifree;
24 uint32_t ag_sick;
25 uint32_t ag_checked;
26 uint32_t ag_flags;
27 uint64_t ag_reserved[12];
28 };
29
30 ag_number
31 The caller must set this field to the index of the allocation
32 group that the caller wishes to learn about.
33
34 ag_length
35 The length of the allocation group is returned in this field, in
36 units of filesystem blocks.
37
38 ag_freeblks
39 The number of free blocks in the allocation group is returned in
40 this field, in units of filesystem blocks.
41
42 ag_icount
43 The number of inode records allocated in this allocation group
44 is returned in this field.
45
46 ag_ifree
47 The number of unused inode records (of the space allocated) in
48 this allocation group is returned in this field.
49
50 ag_flags
51 The caller can set this field to change the operational behavior
52 of the ioctl. Currently no flags are defined, so this field
53 must be zero.
54
55 ag_reserved
56 All reserved fields will be set to zero on return.
57
58 The fields ag_sick and ag_checked indicate the relative health of vari‐
59 ous allocation group metadata:
60
61 · If a given sick flag is set in ag_sick, then that piece of metadata
62 has been observed to be damaged. The same bit will be set in
63 ag_checked.
64
65 · If a given sick flag is set in ag_checked and is not set in ag_sick,
66 then that piece of metadata has been checked and is not faulty.
67
68 · If a given sick flag is not set in ag_checked, then no conclusion can
69 be made.
70
71 The following flags apply to these fields:
72
73 XFS_AG_GEOM_SICK_SB
74 Allocation group superblock.
75
76 XFS_AG_GEOM_SICK_AGF
77 Free space header.
78
79 XFS_AG_GEOM_SICK_AGFL
80 Free space reserve list.
81
82 XFS_AG_GEOM_SICK_AGI
83 Inode header.
84
85 XFS_AG_GEOM_SICK_BNOBT or XFS_AG_GEOM_SICK_CNTBT
86 Free space btrees.
87
88 XFS_AG_GEOM_SICK_INOBT or XFS_AG_GEOM_SICK_FINOBT
89 Inode btrees.
90
91 XFS_AG_GEOM_SICK_RMAPBT
92 Reverse mapping btree.
93
94 XFS_AG_GEOM_SICK_REFCNTBT
95 Reference count btree.
96
98 On error, -1 is returned, and errno is set to indicate the error.
99
101 Error codes can be one of, but are not limited to, the following:
102
103 EFSBADCRC
104 Metadata checksum validation failed while performing the query.
105
106 EFSCORRUPTED
107 Metadata corruption was encountered while performing the query.
108
109 EINVAL The specified allocation group number is not valid for this
110 filesystem.
111
112 EIO An I/O error was encountered while performing the query.
113
115 This API is specific to XFS filesystem on the Linux kernel.
116
118 ioctl(2)
119
120
121
122XFS 2019-08-30 IOCTL-XFS-AG-GEOMETRY(2)