LLAPI\_QUOTACTL(3) Lustre Library Functions LLAPI\_QUOTACTL(3)

# [NAME](#NAME)

llapi\_quotactl - manipulate disk quotas on a Lustre filesystem

# [SYNOPSIS](#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](#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**](#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)](/man/enterprise-packages/lustre/llapi_quotacheck.3) call.

This call is restricted to the super-user.

[**LUSTRE\_Q\_QUOTAOFF**](#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**](#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**](#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**](#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**](#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](#RETURN_VALUES)

**llapi\_quotactl()** returns:

0

on success.

-1

on failure and sets **errno** to indicate the error.

# [ERRORS](#ERRORS)

EFAULT

*qctl* is invalid.

[**ENOSYS**](#ENOSYS)

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

[**ENOMEM**](#ENOMEM)

Insufficient memory to complete operation.

[**ENOTTY**](#ENOTTY)

*qc\_cmd* is invalid.

[**EBUSY**](#EBUSY)

Cannot process during quotacheck.

[**ENOENT**](#ENOENT)

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

[**EPERM**](#EPERM)

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

[**ESRCH**](#ESRCH)

No disk quota is found for the indicated user.

Quotas have not been turned on for this filesystem.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_quotactl()** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.4.0

# [SEE ALSO](#SEE_ALSO)

[**lfs**(1)](/man/enterprise-packages/lustre/lfs.1), [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-28 Lustre User API

---

Document: llapi_quotactl(3) from lustre 2.17.60-r0 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
