1IOCTL-XFS-FSGEOMETRY(2)       System Calls Manual      IOCTL-XFS-FSGEOMETRY(2)
2
3
4

NAME

6       ioctl_xfs_fsgeometry - report XFS filesystem layout and features
7

SYNOPSIS

9       #include <xfs/xfs_fs.h>
10
11       int ioctl(int fd, XFS_IOC_FSGEOMETRY, struct xfs_fsop_geom *arg);
12       int ioctl(int fd, XFS_IOC_FSGEOMETRY_V4, struct xfs_fsop_geom_v4 *arg);
13       int ioctl(int fd, XFS_IOC_FSGEOMETRY_V1, struct xfs_fsop_geom_v1 *arg);
14

DESCRIPTION

16       Report the details of an XFS filesystem layout, features, and other de‐
17       scriptive items.  This information is conveyed in a  structure  of  the
18       following form:
19
20           struct xfs_fsop_geom {
21                __u32         blocksize;
22                __u32         rtextsize;
23                __u32         agblocks;
24                __u32         agcount;
25                __u32         logblocks;
26                __u32         sectsize;
27                __u32         inodesize;
28                __u32         imaxpct;
29                __u64         datablocks;
30                __u64         rtblocks;
31                __u64         rtextents;
32                __u64         logstart;
33                unsigned char uuid[16];
34                __u32         sunit;
35                __u32         swidth;
36                __s32         version;
37                __u32         flags;
38                __u32         logsectsize;
39                __u32         rtsectsize;
40                __u32         dirblocksize;
41                /* struct xfs_fsop_geom_v1 stops here. */
42
43                __u32         logsunit;
44                /* struct xfs_fsop_geom_v4 stops here. */
45
46                __u32         sick;
47                __u32         checked;
48                __u64         reserved[17];
49           };
50
51       blocksize is the size of a fundamental filesystem block, in bytes.
52
53       rtextsize is the size of an extent on the realtime volume, in bytes.
54
55       agblocks  is  the  size  of an allocation group, in units of filesystem
56       blocks.
57
58       agcount is the number of allocation groups in the filesystem.
59
60       logblocks is the size of the log, in units of filesystem blocks.
61
62       sectsize is the smallest amount of data that can be written to the data
63       device atomically, in bytes.
64
65       inodesize is the size of an inode record, in bytes.
66
67       imaxpct  is  the maximum percentage of the filesystem that can be allo‐
68       cated to inode record blocks.
69
70       datablocks is the size of the  data  device,  in  units  of  filesystem
71       blocks.
72
73       rtblocks  is  the  size  of the realtime device, in units of filesystem
74       blocks.
75
76       rtextents is the number of extents that can be allocated on  the  real‐
77       time device.
78
79       logstart  is  the  start of the log, in units of filesystem blocks.  If
80       the filesystem has an external log, this will be zero.
81
82       uuid is the universal unique identifier of the filesystem.
83
84       sunit is what the filesystem has been told is the size of a RAID stripe
85       unit on the underlying data device, in filesystem blocks.
86
87       swidth  is  what  the  filesystem  has been told is the width of a RAID
88       stripe on the underlying data device, in units of RAID stripe units.
89
90       version  is  the  version  of  this  structure.   This  value  will  be
91       XFS_FSOP_GEOM_VERSION.
92
93       flags  tell  us  what features are enabled on the filesystem.  Refer to
94       the section FILESYSTEM FEATURE FLAGS below for more  information  about
95       each feature.
96
97       logsectsize  is  the smallest amount of data that can be written to the
98       log device atomically, in bytes.
99
100       rtsectsize is the smallest amount of data that can be  written  to  the
101       realtime device atomically, in bytes.
102
103       dirblocksize is the size of directory blocks, in bytes.
104
105       logsunit  is  what  the  filesystem has been told is the size of a RAID
106       stripe unit on the underlying log device, in filesystem  blocks.   This
107       field is meaningful only if the flag XFS_FSOP_GEOM_FLAGS_LOGV2 is set.
108
109       The  fields  sick  and  checked indicate the relative health of various
110       whole-filesystem metadata.  Please see the section XFS METADATA  HEALTH
111       REPORTING for more details.
112
113       reserved is set to zero.
114

FILESYSTEM FEATURE FLAGS

116       Filesystem features are reported to userspace as a combination the fol‐
117       lowing flags:
118
119       XFS_FSOP_GEOM_FLAGS_ATTR
120              Extended attributes are present.
121
122       XFS_FSOP_GEOM_FLAGS_NLINK
123              Files on this filesystem support up to 2^32 hard links.  If this
124              flag  is  not  set,  files on this filesystem support only up to
125              2^16 hard links.
126
127       XFS_FSOP_GEOM_FLAGS_QUOTA
128              Quotas are enabled.
129
130       XFS_FSOP_GEOM_FLAGS_IALIGN
131              Inodes are aligned for better performance.
132
133       XFS_FSOP_GEOM_FLAGS_DALIGN
134              Filesystem tries to align data block allocations to RAID  stripe
135              units for better performance.
136
137       XFS_FSOP_GEOM_FLAGS_SHARED
138              Unused.
139
140       XFS_FSOP_GEOM_FLAGS_EXTFLG
141              Filesystem supports unwritten extents.
142
143       XFS_FSOP_GEOM_FLAGS_DIRV2
144              Directories are in version 2 format and maintain free space data
145              for better performance.  Version 1  format  directories  are  no
146              longer supported.
147
148       XFS_FSOP_GEOM_FLAGS_LOGV2
149              Log uses the V2 format.
150
151       XFS_FSOP_GEOM_FLAGS_SECTOR
152              The log device has a sector size larger than 512 bytes.
153
154       XFS_FSOP_GEOM_FLAGS_ATTR2
155              Filesystem contains V2 extended attributes.
156
157       XFS_FSOP_GEOM_FLAGS_PROJID32
158              Project  IDs  can be as large as 2^32.  If this flag is not set,
159              the filesystem supports only 2^16 project IDs.
160
161       XFS_FSOP_GEOM_FLAGS_DIRV2CI
162              Case-insensitive lookups are supported on directories.
163
164       XFS_FSOP_GEOM_FLAGS_LAZYSB
165              On-disk superblock counters are updated only at unmount time.
166
167       XFS_FSOP_GEOM_FLAGS_V5SB
168              Metadata blocks are self describing and contain checksums.
169
170       XFS_FSOP_GEOM_FLAGS_FTYPE
171              Directories contain inode types in directory entries.
172
173       XFS_FSOP_GEOM_FLAGS_FINOBT
174              Filesystem maintains an index of free inodes.
175
176       XFS_FSOP_GEOM_FLAGS_SPINODES
177              Filesystem may allocate discontiguous  inode  chunks  when  free
178              space is fragmented.
179
180       XFS_FSOP_GEOM_FLAGS_RMAPBT
181              Filesystem stores reverse mappings of blocks to owners.
182
183       XFS_FSOP_GEOM_FLAGS_REFLINK
184              Filesystem supports sharing blocks between files.
185

XFS METADATA HEALTH REPORTING

187       The  online filesystem checking utility scans metadata and records what
188       it finds in the kernel incore state.  The following scheme is used  for
189       userspace to read the incore health status of the filesystem:
190
191
192       • If  a given sick flag is set in sick, then that piece of metadata has
193         been observed to be damaged.  The same bit should be set in checked.
194
195       • If a given sick flag is set in checked but is not set in  sick,  then
196         that piece of metadata has been checked and is not faulty.
197
198       • If a given sick flag is not set in checked, then no conclusion can be
199         made.
200
201       The following flags apply to these fields:
202
203           XFS_FSOP_GEOM_SICK_COUNTERS
204                  Inode and space summary counters.
205
206           XFS_FSOP_GEOM_SICK_UQUOTA
207                  User quota information.
208
209           XFS_FSOP_GEOM_SICK_GQUOTA
210                  Group quota information.
211
212           XFS_FSOP_GEOM_SICK_PQUOTA
213                  Project quota information.
214
215           XFS_FSOP_GEOM_SICK_RT_BITMAP
216                  Free space bitmap for the realtime device.
217
218           XFS_FSOP_GEOM_SICK_RT_SUMMARY
219                  Free space summary for the realtime device.
220
221

RETURN VALUE

223       On error, -1 is returned, and errno is set to indicate the error.
224

ERRORS

226       Error codes can be one of, but are not limited to, the following:
227
228       EFAULT The kernel was not able to copy into the userspace buffer.
229
230       EFSBADCRC
231              Metadata checksum validation failed while performing the query.
232
233       EFSCORRUPTED
234              Metadata corruption was encountered while performing the query.
235
236       EIO    An I/O error was encountered while performing the query.
237

CONFORMING TO

239       This API is specific to XFS filesystem on the Linux kernel.
240

SEE ALSO

242       ioctl(2)
243
244
245
246XFS                               2019-06-17           IOCTL-XFS-FSGEOMETRY(2)
Impressum