LLAPI_QUOTACTL(3)
β¨ LLAPI_QUOTACTL β¨
okay bestie, welcome to the llapi_quotactl(3) page, aka the Lustre Library Functions girlies' guide to manipulating disk quotas on a Lustre filesystem π
like yes we're literally doing quota admin and we're gonna be so cute about it.
no cap, this one's from the Lustre User API corner of the manual, section 3, and it's genuinely iconic for anyone running a Lustre filesystem. let's go π¦
πΈ NAME πΈ
ok so like, the whole point: llapi_quotactl β manipulate disk quotas on a Lustre filesystem. that's the vibe. that's the function. periodt.
β¨ SYNOPSIS β¨
first thing first, you gotta bring in the header or nothing works, bestie:
#include <lustre/lustreapi.h>
int llapi_quotactl(char *mnt, struct if_quotactl *qctl);
and here's the lil struct lineup you're working with β copy these exactly, i'm not playing:
struct if_quotactl {
__u32 qc_cmd;
__u32 qc_type;
__u32 qc_id;
__u32 qc_stat;
struct obd_dqinfo qc_dqinfo;
struct obd_dqblk qc_dqblk;
char obd_type[16];
struct obd_uuid obd_uuid;
};
struct obd_dqblk {
__u64 dqb_bhardlimit;
__u64 dqb_bsoftlimit;
__u64 dqb_curspace;
__u64 dqb_ihardlimit;
__u64 dqb_isoftlimit;
__u64 dqb_curinodes;
__u64 dqb_btime;
__u64 dqb_itime;
__u32 dqb_valid;
__u32 padding;
};
struct obd_dqinfo {
__u64 dqi_bgrace;
__u64 dqi_igrace;
__u32 dqi_flags;
__u32 dqi_valid;
};
struct obd_uuid {
char uuid[40];
};
π DESCRIPTION π
so the llapi_quotactl() function manipulates disk quotas on a Lustre filesystem mnt. and qc_cmd is the command you're throwing at UID qc_id or GID qc_id β your pick, main character energy either way π
here's the command menu, one by one, no skips:
LUSTRE_Q_QUOTAONβ turn on quotas for a Lustre filesystem. ok so heads up: this one is Deprecated as of 2.4.0 π.qc_typeisUSRQUOTA,GRPQUOTAorUGQUOTA(that's both user and group quotas, bestie). and the quota files must exist β they're normally created with thellapi_quotacheck(3)call.
this call is restricted to the super-user. like, actual super-user. don't try it.
LUSTRE_Q_QUOTAOFFβ turn off quotas for a Lustre filesystem. also Deprecated as of 2.4.0 π.qc_typeisUSRQUOTA,GRPQUOTAorUGQUOTA(both user and group quotas).
again: this call is restricted to the super-user.
LUSTRE_Q_GETQUOTAβ get disk quota limits and current usage for user or groupqc_id.qc_typeisUSRQUOTAorGRPQUOTA.uuidmay be filled with an OBD UUID string to query quota information from a specific node.dqb_validmay be set nonzero to query information only from MDS. and ifuuidis an empty string anddqb_validis zero, then you get the clusterwide limits and usage back. on returnobd_dqblkcontains the requested information (heads up: block limits unit is kilobyte).dqb_btimeanddqb_itimeare the block and inode softlimit grace period expiration timestamps for the requested user or group π
quotas must be turned on before using this command. fr fr.
LUSTRE_Q_SETQUOTAβ set disk quota limits for user or groupqc_id.qc_typeisUSRQUOTAorGRPQUOTA.dqb_validmust be set toQIF_ILIMITS,QIF_BLIMITSorQIF_LIMITS(that's both inode limits and block limits) depending on what limits you're updating.obd_dqblkmust be filled with limit values (as set indqb_valid, and yes, block limits unit is kilobyte).
quotas must be turned on before using this command too. obviously π
LUSTRE_Q_GETINFOβ get information about quotas.qc_typeis eitherUSRQUOTAorGRPQUOTA. on return,dqi_igraceis the default inode grace period duration for all users or all groups (in seconds),dqi_bgraceis the default block grace period duration for all users or all groups (in seconds), anddqi_flagsis not used by the current Lustre version β so like, don't expect anything from it.LUSTRE_Q_SETINFOβ set quota information (like grace times, bestie β³).qc_typeis eitherUSRQUOTAorGRPQUOTA.dqi_igraceis inode grace time (in seconds),dqi_bgraceis block grace time (in seconds), anddqi_flagsis not used by the current Lustre version and must be zeroed.
β RETURN VALUES β
llapi_quotactl() returns:
0β on success. slay β¨-1β on failure, and it setserrnoto indicate the error. π
π ERRORS π
ok so when things go wrong (and they might), here's what errno is telling you:
EFAULTβqctlis invalid.ENOSYSβ the kernel or Lustre modules have not been compiled with theQUOTAoption.ENOMEMβ insufficient memory to complete operation.ENOTTYβqc_cmdis invalid.EBUSYβ cannot process during quotacheck.ENOENTβuuiddoes not correspond to OBD ormntdoes not exist.EPERMβ the call is privileged and the caller was not the super-user.ESRCHβ no disk quota is found for the indicated user.
and also: quotas have not been turned on for this filesystem. double-check that before you spiral π«Ά
π AVAILABILITY π
llapi_quotactl() is part of the lustre(7) user application interface library since release 2.4.0. she's been here a minute, and she's still serving π
π SEE ALSO π
ok that's the whole page bestie, you're officially quota-literate π this lil masterpiece came to you from the Lustre User API crew, dated 2024-08-28, and it's the LLAPI_QUOTACTL(3) page in all her glory. mwah. go forth and quota responsibly π§β¨
π¦ where this page comes from
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms