IOCTL-XFS-GETRESBLKS(2)
πΎ ioctl_xfs_getresblks β query and set XFS free space reservation information
okay bestie, so this is section 2 of the manual, ioctl-xfs-getresblks(2), and it's all about poking at XFS's emergency snack stash π. Sit down, hydrate, let's go.
β¨ NAME β¨
ioctl_xfs_getresblks β query and set XFS free space reservation information
πΈ SYNOPSIS πΈ
#include <xfs/xfs_fs.h>
int ioctl(int fd, XFS_IOC_GET_RESBLKS, struct xfs_fsop_resblks *arg);
int ioctl(int fd, XFS_IOC_SET_RESBLKS, struct xfs_fsop_resblks *arg);
π DESCRIPTION π
So basically you're either querying or setting the free space reservation info. These blocks are the ones the filesystem keeps tucked away like a little emergency fund, as a final attempt to stop metadata updates from absolutely flopping because there's not enough space. It's giving "last line of defense" π‘οΈ.
π¨ Only the system administrator can use these ioctls, because overriding the defaults is extremely dangerous. Not me exaggerating β that's literally what it says. Periodt.
And listen: this functionality is intended only for use by XFS filesystem developers. So if that's not you... bestie, why are you here π.
The reservation info travels around in a struct that looks exactly like this:
struct xfs_fsop_resblks {
__u64 resblks;
__u64 resblks_avail;
};
resblks β the number of blocks the filesystem will try to maintain to prevent critical out of space situations. The main character of the reservation, honestly π.
resblks_avail β the number of reserved blocks still remaining. The leftovers. The crumbs. The β¨remainingβ¨.
π₯ RETURN VALUE π₯
On error, -1 is returned, and errno is set to indicate the error. Classic.
π ERRORS π
Error codes can be one of, but are not limited to, the following (so don't come for me if you see something else, fr fr):
EFSBADCRCβ Metadata checksum validation failed while performing the query. The checksum said "ma'am this is not it" πEFSCORRUPTEDβ Metadata corruption was encountered while performing the query. Rot. Decay. Unwell behavior πEINVALβ The specified allocation group number is not valid for this filesystem. Wrong AG, bestie, that one doesn't exist here π«EIOβ An I/O error was encountered while performing the query. The I/O is not I/O-ing πEPERMβ Caller does not have permission to call this ioctl. You do not have the range, babes π«Ά
π CONFORMING TO π
This API is specific to XFS filesystem on the Linux kernel. It's a Linux/XFS exclusive, iykyk π .
π¦ SEE ALSO π¦
okay that's the whole vibe check β go be the XFS developer you were always meant to be β¨
with love, the XFS girlies, dated 2019-06-17, signing off from IOCTL-XFS-GETRESBLKS(2) πππ¦
π¦ where this page comes from
- alpine 3.22: xfsprogs-doc 6.14.0-r0 Β· LGPL-2.1-or-later
- alpine 3.23: xfsprogs-doc 6.17.0-r0 Β· LGPL-2.1-or-later
- alpine 3.24: xfsprogs-doc 7.0.1-r0 Β· LGPL-2.1-or-later
- arch rolling: xfsprogs 7.2.0-1
- arch rolling: xfsprogs 7.2.1-1 Β· GPL-2.0-only AND LGPL-2.1-only
- centos-stream 10: xfsprogs-devel 6.16.0-1.el10 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- centos-stream 9: xfsprogs-devel 6.4.0-9.el9 Β· GPL+ and LGPLv2+
- centos-stream 9: xfsprogs-devel 6.4.0-9.el9 Β· GPL+ and LGPLv2+
- debian bookworm: xfslibs-dev 6.1.0-1 Β· GPL-2.0-only
- debian trixie: xfslibs-dev 6.13.0-2+deb13u1 Β· GPL-2.0-only
- fedora 43: xfsprogs-devel 6.15.0-3.fc43 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 43: xfsprogs-devel 6.15.0-3.fc43 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs-devel 6.18.0-2.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs-devel 6.18.0-2.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs-devel 7.1.1-1.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs-devel 7.1.1-1.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- nixos 26.05: xfsprogs 6.19.0
- nixpkgs unstable: xfsprogs 7.2.1
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: xfsprogs 6.19.0-160000.3.1 Β· GPL-2.0-or-later
- ubuntu jammy: xfslibs-dev 5.13.0-1ubuntu2 Β· GPL-2.0-only
- ubuntu jammy: xfslibs-dev 5.13.0-1ubuntu2.1 Β· GPL-2.0-only
- ubuntu noble: xfslibs-dev 6.6.0-1ubuntu2 Β· GPL-2.0-only
- ubuntu noble: xfslibs-dev 6.6.0-1ubuntu2.1 Β· GPL-2.0-only
- ubuntu questing: xfslibs-dev 6.13.0-2ubuntu2
- ubuntu resolute: xfslibs-dev 6.18.0-3 Β· GPL-2.0-only
- ubuntu stonking: xfslibs-dev 6.19.0-1 Β· GPL-2.0-only
- π the page's license: GPL-2.0+
- Copyright (c) 2019, Oracle. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms