1IOCTL-XFS-FSOP-GEOMETRY(2) System Calls Manual IOCTL-XFS-FSOP-GEOMETRY(2)
2
3
4
6 ioctl_xfs_fsop_geometry - report XFS filesystem layout and features
7
9 #include <xfs/xfs_fs.h>
10
11 int ioctl(int fd, XFS_IOC_FSOP_GEOMETRY, struct xfs_fsop_geom*arg);
12 int ioctl(int fd, XFS_IOC_FSOP_GEOMETRY_V1, struct xfs_fsop_geom_v1
13 *arg);
14
16 Report the details of an XFS filesystem layout, features, and other
17 descriptive 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 };
45
46 blocksize is the size of a fundamental filesystem block, in bytes.
47
48 rtextsize is the size of an extent on the realtime volume, in bytes.
49
50 agblocks is the size of an allocation group, in units of filesystem
51 blocks.
52
53 agcount is the number of allocation groups in the filesystem.
54
55 logblocks is the size of the log, in units of filesystem blocks.
56
57 sectsize is the smallest amount of data that can be written to the data
58 device atomically, in bytes.
59
60 inodesize is the size of an inode record, in bytes.
61
62 imaxpct is the maximum percentage of the filesystem that can be allo‐
63 cated to inode record blocks.
64
65 datablocks is the size of the data device, in units of filesystem
66 blocks.
67
68 rtblocks is the size of the realtime device, in units of filesystem
69 blocks.
70
71 rtextents is the number of extents that can be allocated on the real‐
72 time device.
73
74 logstart is the start of the log, in units of filesystem blocks. If
75 the filesystem has an external log, this will be zero.
76
77 uuid is the universal unique identifier of the filesystem.
78
79 sunit is what the filesystem has been told is the size of a RAID stripe
80 unit on the underlying data device, in filesystem blocks.
81
82 swidth is what the filesystem has been told is the width of a RAID
83 stripe on the underlying data device, in units of RAID stripe units.
84
85 version is the version of this structure. This value will be
86 XFS_FSOP_GEOM_VERSION.
87
88 flags tell us what features are enabled on the filesystem. Refer to
89 the section FILESYSTEM FEATURE FLAGS below for more information about
90 each feature.
91
92 logsectsize is the smallest amount of data that can be written to the
93 log device atomically, in bytes.
94
95 rtsectsize is the smallest amount of data that can be written to the
96 realtime device atomically, in bytes.
97
98 dirblocksize is the size of directory blocks, in bytes.
99
100 logsunit is what the filesystem has been told is the size of a RAID
101 stripe unit on the underlying log device, in filesystem blocks. This
102 field is meaningful only if the flag XFS_FSOP_GEOM_FLAGS_LOGV2 is set.
103
105 Filesystem features are reported to userspace as a combination the fol‐
106 lowing flags:
107
108 XFS_FSOP_GEOM_FLAGS_ATTR
109 Extended attributes are present.
110
111 XFS_FSOP_GEOM_FLAGS_NLINK
112 Files on this filesystem support up to 2^32 hard links. If this
113 flag is not set, files on this filesystem support only up to
114 2^16 hard links.
115
116 XFS_FSOP_GEOM_FLAGS_QUOTA
117 Quotas are enabled.
118
119 XFS_FSOP_GEOM_FLAGS_IALIGN
120 Inodes are aligned for better performance.
121
122 XFS_FSOP_GEOM_FLAGS_DALIGN
123 Filesystem tries to align data block allocations to RAID stripe
124 units for better performance.
125
126 XFS_FSOP_GEOM_FLAGS_SHARED
127 Unused.
128
129 XFS_FSOP_GEOM_FLAGS_EXTFLG
130 Filesystem supports unwritten extents.
131
132 XFS_FSOP_GEOM_FLAGS_DIRV2
133 Directories are in version 2 format and maintain free space data
134 for better performance. Version 1 format directories are no
135 longer supported.
136
137 XFS_FSOP_GEOM_FLAGS_LOGV2
138 Log uses the V2 format.
139
140 XFS_FSOP_GEOM_FLAGS_SECTOR
141 The log device has a sector size larger than 512 bytes.
142
143 XFS_FSOP_GEOM_FLAGS_ATTR2
144 Filesystem contains V2 extended attributes.
145
146 XFS_FSOP_GEOM_FLAGS_PROJID32
147 Project IDs can be as large as 2^32. If this flag is not set,
148 the filesystem supports only 2^16 project IDs.
149
150 XFS_FSOP_GEOM_FLAGS_DIRV2CI
151 Case-insensitive lookups are supported on directories.
152
153 XFS_FSOP_GEOM_FLAGS_LAZYSB
154 On-disk superblock counters are updated only at unmount time.
155
156 XFS_FSOP_GEOM_FLAGS_V5SB
157 Metadata blocks are self describing and contain checksums.
158
159 XFS_FSOP_GEOM_FLAGS_FTYPE
160 Directories contain inode types in directory entries.
161
162 XFS_FSOP_GEOM_FLAGS_FINOBT
163 Filesystem maintains an index of free inodes.
164
165 XFS_FSOP_GEOM_FLAGS_SPINODES
166 Filesystem may allocate discontiguous inode chunks when free
167 space is fragmented.
168
169 XFS_FSOP_GEOM_FLAGS_RMAPBT
170 Filesystem stores reverse mappings of blocks to owners.
171
172 XFS_FSOP_GEOM_FLAGS_REFLINK
173 Filesystem supports sharing blocks between files.
174
175
177 On error, -1 is returned, and errno is set to indicate the error.
178
180 Error codes can be one of, but are not limited to, the following:
181
182 EFAULT The kernel was not able to copy into the userspace buffer.
183
184 EFSBADCRC
185 Metadata checksum validation failed while performing the query.
186
187 EFSCORRUPTED
188 Metadata corruption was encountered while performing the query.
189
190 EIO An I/O error was encountered while performing the query.
191
193 This API is specific to XFS filesystem on the Linux kernel.
194
196 ioctl(2)
197
198
199
200XFS 2019-06-17 IOCTL-XFS-FSOP-GEOMETRY(2)