Q_XGETQSTAT(2const)

πŸ“¦
version 6.20 Β· 2 versions
, in arch rolling, nixpkgs unstable

πŸ’– Q_XGETQSTAT β€” the manual, bestie edition πŸ’–

okay so this is Q_XGETQSTAT, and it lives in section 2const of the Linux manual pages. it's a quota command constant, it's iconic, and it's about to spill all the XFS tea. let's go πŸ¦‹


✨ NAME ✨

Q_XGETQSTAT β€” get XFS-specific quota information πŸ’…


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) β€” the classics, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

okay so there's literally more than one way to call this, here's all of them exactly as they are:

#include <xfs/xqm.h>      /* See quotactl(2) */
#include <sys/quota.h>

int quotactl(QCMD(Q_XGETQSTAT, type), const char *_Nullable special, 0,
             caddr_t addr);
#include <xfs/xqm.h>      /* See quotactl_fd(2) */
#include <sys/syscall.h>  /* Definition of SYS_* constants */
#include <unistd.h>

int syscall(SYS_quotactl_fd, int fd, QCMD(Q_XGETQSTAT, type), 0,
            struct fs_quota_stat *addr);

and here's the constant plus the structs it hands you, verbatim, do not touch:

#include <xfs/xqm.h>      /* See quotactl(2) */

#define FS_QSTAT_VERSION  1  /* fs_quota_stat.qs_version */

struct fs_quota_stat {
     int8_t    qs_version;
     uint16_t  qs_flags;
     int8_t    qs_pad;
     struct fs_qfilestat  qs_uquota;
     struct fs_qfilestat  qs_gquota;
     uint32_t  qs_incoredqs;
     int32_t   qs_btimelimit;
     int32_t   qs_itimelimit;
     int32_t   qs_rtbtimelimit;
     uint16_t  qs_bwarnlimit;
     uint16_t  qs_iwarnlimit;
};

struct fs_qfilestat {
     uint64_t  qfs_ino;
     uint64_t  qfs_nblks;
     uint32_t  qfs_nextents;
};

🌸 DESCRIPTION 🌸

so basically it returns XFS filesystem-specific quota information, and it drops all of that into the fs_quota_stat structure that addr points at. simple, clean, slay ✨

it's giving detective energy, because it's useful for finding out how much space is used to store quota information, and also for getting the quota on/off status of a given local XFS filesystem. like, hi, what's your status bestie πŸ’–

🧚 struct fs_quota_stat

  • .qs_version β€” version number for future changes. it's the little time capsule of versions, lowkey.
  • .qs_flags β€” XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} πŸ‘‘
  • .qs_pad β€” unused. it's just vibing there, taking up space, doing nothing. respect honestly.
  • .qs_uquota β€” user quota storage information.
  • .qs_gquota β€” group quota storage information.
  • .qs_incoredqs β€” number of dquots in core.
  • .qs_btimelimit β€” limit for blocks timer.
  • .qs_itimelimit β€” limit for inodes timer.
  • .qs_rtbtimelimit β€” limit for RT blocks timer.
  • .qs_bwarnlimit β€” limit for # of warnings.
  • .qs_iwarnlimit β€” limit for # of warnings.

🧚 struct fs_quota_stat (the file-stat one, yes it has the same heading as the original, i don't make the rules)

  • .qfs_ino β€” inode number.
  • .qfs_nblks β€” number of BBs 512-byte-blocks.
  • .qfs_nextents β€” number of extents.

πŸ”₯ RETURN VALUE πŸ”₯

See quotactl(2). that's it, that's the whole section. go read the other one bestie 🫢


πŸ’€ ERRORS πŸ’€

See quotactl(2). same deal, the source of truth is over there ✨


🌈 STANDARDS 🌈

Linux. periodt.


πŸ“œ HISTORY πŸ“œ

Linux. also periodt.


πŸ‘‘ SEE ALSO πŸ‘‘


aaaand that's the whole page bestie, you ate it πŸ“ this was Linux man-pages 6.20, dated 2026-06-05, and it's the Q_XGETQSTAT(2const) page β€” go forth and stat your quotas, no cap πŸ’…βœ¨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms