IOCTL-XFS-FSGEOMETRY(2) | System Calls Manual | IOCTL-XFS-FSGEOMETRY(2) |
ioctl_xfs_fsgeometry - report XFS filesystem layout and features
#include <xfs/xfs_fs.h>
int ioctl(int fd, XFS_IOC_FSGEOMETRY, struct
xfs_fsop_geom *arg);
int ioctl(int fd, XFS_IOC_FSGEOMETRY_V4, struct
xfs_fsop_geom_v4 *arg);
int ioctl(int fd, XFS_IOC_FSGEOMETRY_V1, struct
xfs_fsop_geom_v1 *arg);
Report the details of an XFS filesystem layout, features, and other descriptive items. This information is conveyed in a structure of the following form:
struct xfs_fsop_geom { __u32 blocksize; __u32 rtextsize; __u32 agblocks; __u32 agcount; __u32 logblocks; __u32 sectsize; __u32 inodesize; __u32 imaxpct; __u64 datablocks; __u64 rtblocks; __u64 rtextents; __u64 logstart; unsigned char uuid[16]; __u32 sunit; __u32 swidth; __s32 version; __u32 flags; __u32 logsectsize; __u32 rtsectsize; __u32 dirblocksize; /* struct xfs_fsop_geom_v1 stops here. */ __u32 logsunit; /* struct xfs_fsop_geom_v4 stops here. */ __u32 sick; __u32 checked; __u64 reserved[17]; };
blocksize is the size of a fundamental filesystem block, in bytes.
rtextsize is the size of an extent on the realtime volume, in bytes.
agblocks is the size of an allocation group, in units of filesystem blocks.
agcount is the number of allocation groups in the filesystem.
logblocks is the size of the log, in units of filesystem blocks.
sectsize is the smallest amount of data that can be written to the data device atomically, in bytes.
inodesize is the size of an inode record, in bytes.
imaxpct is the maximum percentage of the filesystem that can be allocated to inode record blocks.
datablocks is the size of the data device, in units of filesystem blocks.
rtblocks is the size of the realtime device, in units of filesystem blocks.
rtextents is the number of extents that can be allocated on the realtime device.
logstart is the start of the log, in units of filesystem blocks. If the filesystem has an external log, this will be zero.
uuid is the universal unique identifier of the filesystem.
sunit is what the filesystem has been told is the size of a RAID stripe unit on the underlying data device, in filesystem blocks.
swidth is what the filesystem has been told is the width of a RAID stripe on the underlying data device, in units of RAID stripe units.
version is the version of this structure. This value will be XFS_FSOP_GEOM_VERSION.
flags tell us what features are enabled on the filesystem. Refer to the section FILESYSTEM FEATURE FLAGS below for more information about each feature.
logsectsize is the smallest amount of data that can be written to the log device atomically, in bytes.
rtsectsize is the smallest amount of data that can be written to the realtime device atomically, in bytes.
dirblocksize is the size of directory blocks, in bytes.
logsunit is what the filesystem has been told is the size of a RAID stripe unit on the underlying log device, in filesystem blocks. This field is meaningful only if the flag XFS_FSOP_GEOM_FLAGS_LOGV2 is set.
The fields sick and checked indicate the relative health of various whole-filesystem metadata. Please see the section XFS METADATA HEALTH REPORTING for more details.
reserved is set to zero.
Filesystem features are reported to userspace as a combination the following flags:
The online filesystem checking utility scans metadata and records what it finds in the kernel incore state. The following scheme is used for userspace to read the incore health status of the filesystem:
The following flags apply to these fields:
On error, -1 is returned, and errno is set to indicate the error.
Error codes can be one of, but are not limited to, the following:
This API is specific to XFS filesystem on the Linux kernel.
2019-06-17 | XFS |