LLAPI_QUOTACTL(3)

NAME
llapi_quotactl - manipulate disk quotas on a Lustre filesystem

SYNOPSIS
#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];
};

DESCRIPTION

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.

LUSTRE_Q_QUOTAON
    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.

LUSTRE_Q_QUOTAOFF
    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.

LUSTRE_Q_GETQUOTA
    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.

LUSTRE_Q_SETQUOTA
    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.

LUSTRE_Q_GETINFO
    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.

LUSTRE_Q_SETINFO
    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.

RETURN VALUES

llapi_quotactl() returns:

0   on success.

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

ERRORS

EFAULT
    qctl is invalid.

ENOSYS
    The kernel or Lustre modules have not been compiled with the QUOTA option.

ENOMEM
    Insufficient memory to complete operation.

ENOTTY
    qc_cmd is invalid.

EBUSY
    Cannot process during quotacheck.

ENOENT
    uuid does not correspond to OBD or mnt does not exist

EPERM
    The call is privileged and the caller was not the super-user.

ESRCH
    No disc quota is found for the indicated user.

    Quotas have not been turned on for this filesystem.

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