IOCTL-XFS-RTGROUP-GEOMETRY(2)
π IOCTL-XFS-RTGROUP-GEOMETRY π
okay bestie, so this whole page lives in the System Calls Manual and the star of the show is the ioctl called ioctl_xfs_rtgroup_geometry β say that three times fast, I dare you π«Ά. She's giving "I just want to know about my realtime groups" energy and honestly? iconic.
β¨ NAME β¨
ioctl_xfs_rtgroup_geometry β literally just here to query XFS realtime group geometry info π
πΈ SYNOPSIS πΈ
#include <xfs/xfs_fs.h>
int ioctl(int fd, XFS_IOC_RTGROUP_GEOMETRY, struct xfs_rtgroup_geometry
*arg);
no cap, that's the whole vibe.
π¦ DESCRIPTION π¦
So this XFS ioctl? She retrieves the geometry information for a given realtime group. Think of it as sliding into the DMs of one specific realtime group and asking "so what's your deal bestie".
The tea gets delivered in a struct that looks exactly like this:
struct xfs_rtgroup_geometry {
__u32 rg_number;
__u32 rg_length;
__u32 rg_sick;
__u32 rg_checked;
__u32 rg_flags;
__u32 rg_writepointer;
__u32 rg_reserved[26];
};
and here's what each field is actually doing:
rg_numberβ you, the caller, gotta set this one yourself. It's the index of the realtime group you're tryna learn about. yes, you have to do a little work. it's giving participation πrg_lengthβ this gets returned to you: the length of the realtime group, measured in units of filesystem blocks. slay.rg_flagsβ you can set this field to change the operational behavior of the ioctl. but rn? no flags are defined, so this field must be zero. periodt.rg_writepointerβ for zoned devices only, this returns the writepointer block offset into the respective realtime group. heads up though: this field is valid only if theXFS_RTGROUP_GEOM_WRITEPOINTERflag is set inrg_flags. don't come for me if you forget π«rg_reservedandrg_padβ all reserved fields get set to zero on return. pristine. immaculate. β¨
π the health check section π
the fields rg_sick and rg_checked are here to tell you about the relative health of various realtime group metadata. it's basically a vibe check for your filesystem:
- if a given sick flag is set in
rg_sick, then that piece of metadata has been observed to be damaged π and the same bit will be set inrg_checked. - if a given sick flag is set in
rg_checkedbut not set inrg_sick, then that piece of metadata has been checked and is not faulty. she's healthy, we love that π - if a given sick flag is not set in
rg_checked, then no conclusion can be made. we simply do not know. the mystery remains π
π the flags π
these are the flags that apply to those fields:
XFS_RTGROUP_GEOM_SICK_SUPERβ realtime group superblock.XFS_RTGROUP_GEOM_SICK_BITMAPβ realtime bitmap for this group.XFS_RTGROUP_GEOM_SICK_SUMMARYβ realtime summary for this group.XFS_RTGROUP_GEOM_SICK_RTRMAPBTβ reverse mapping btree for this group.
π RETURN VALUE π
on error, -1 is returned and errno is set to indicate the error. classic. no notes.
π ERRORS π
error codes can be one of β but are not limited to β the following:
EFSBADCRCβ metadata checksum validation failed while performing the query. the checksum said "not today" βEFSCORRUPTEDβ metadata corruption was encountered while performing the query. she's broken bestie, truly πEINVALβ the specified realtime group number is not valid for this filesystem. wrong number, wrong girl π΅EIOβ an I/O error was encountered while performing the query. the disk is being dramatic π€
π CONFORMING TO π
this API is specific to the XFS filesystem on the Linux kernel. no portability, no traveling, she stays home π
π₯ SEE ALSO π₯
and that's the whole page babes π one last thing: this little masterpiece comes from the XFS crew and it's dated 2022-08-18 β so yeah, she's been serving correct information since then, fr fr. go query some realtime groups, main character π¦β¨
π¦ where this page comes from
- arch rolling: xfsprogs 7.2.1-1 Β· GPL-2.0-only AND LGPL-2.1-only
- nixpkgs unstable: xfsprogs 7.2.1
- π the page's license: GPL-2.0-or-later
- Copyright (c) 2022-2024 Oracle. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms