OS Manuals

llapi_quotactl(3)

llapi_quotactl - manipulate disk quotas on a Lustre filesystem

LLAPI_QUOTACTL(3) Lustre Library Functions LLAPI_QUOTACTL(3)

llapi_quotactl - manipulate disk quotas on a Lustre filesystem

#include <lustre/lustreapi.h>
int llapi_quotactl(char *mnt, struct if_quotactl *qctl);
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];
};

The llapi_quotactl() function manipulates disk quotas on a Lustre filesystem mnt. qc_cmd indicates a command to be applied to UID qc_id or GID qc_id.

Turn on quotas for a Lustre filesystem. Deprecated as of 2.4.0. qc_type is USRQUOTA, GRPQUOTA or UGQUOTA (both user and group quotas). The quota files must exist; they are normally created with the llapi_quotacheck(3) call.

This call is restricted to the super-user.

Turn off quotas for a Lustre filesystem. Deprecated as of 2.4.0. qc_type is USRQUOTA, GRPQUOTA or UGQUOTA (both user and group quotas).

This call is restricted to the super-user.

Get disk quota limits and current usage for user or group qc_id. qc_type is USRQUOTA or GRPQUOTA. uuid may be filled with OBD UUID string to query quota information from a specific node. dqb_valid may be set nonzero to query information only from MDS. If uuid is an empty string and dqb_valid is zero then clusterwide limits and usage are returned. On return obd_dqblk contains the requested information (block limits unit is kilobyte). dqb_btime and dqb_itime are block and inode softlimit grace period expiration timestamps for the requested user or group.

Quotas must be turned on before using this command.

Set disk quota limits for user or group qc_id. qc_type is USRQUOTA or GRPQUOTA. dqb_valid must be set to QIF_ILIMITS, QIF_BLIMITS or QIF_LIMITS (both inode limits and block limits) dependent on updating limits. obd_dqblk must be filled with limits values (as set in dqb_valid, block limits unit is kilobyte).

Quotas must be turned on before using this command.

Get information about quotas. qc_type is either USRQUOTA or GRPQUOTA. On return dqi_igrace is the default inode grace period duration for all users or all groups (in seconds), dqi_bgrace is the default block grace period duration for all users or all groups (in seconds), dqi_flags is not used by the current Lustre version.
Set quota information (like grace times). qc_type is either USRQUOTA or GRPQUOTA. dqi_igrace is inode grace time (in seconds), dqi_bgrace is block grace time (in seconds), dqi_flags is not used by the current Lustre version and must be zeroed.

llapi_quotactl() returns:

0
on success.
-1
on failure and sets errno to indicate the error.

EFAULT
qctl is invalid.
The kernel or Lustre modules have not been compiled with the QUOTA option.
Insufficient memory to complete operation.
qc_cmd is invalid.
Cannot process during quotacheck.
uuid does not correspond to OBD or mnt does not exist
The call is privileged and the caller was not the super-user.
No disk quota is found for the indicated user.
Quotas have not been turned on for this filesystem.

llapi_quotactl() is part of the lustre(7) user application interface library since release 2.4.0

lfs(1), lustre(7), lustreapi(7)

2024-08-28 Lustre User API

lustre 2.17.59-r2 · enterprise-packages · ingested 2026-10-11