]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/quotactl.2
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man2 / quotactl.2
CommitLineData
1eeddf25
JK
1.\" Copyright (c) 2010, Jan Kara
2.\" A few pieces copyright (c) 1996 Andries Brouwer (aeb@cwi.nl)
3.\" and copyright 2010 (c) Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 4.\"
5fbde956 5.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da 6.\"
45186a5d 7.TH QUOTACTL 2 2021-03-22 "Linux man-pages (unreleased)"
fea681da 8.SH NAME
1eeddf25 9quotactl \- manipulate disk quotas
0b486d63
AC
10.SH LIBRARY
11Standard C library
8fc3b2cf 12.RI ( libc ", " \-lc )
fea681da 13.SH SYNOPSIS
cb2431bf 14.nf
fea681da 15.B #include <sys/quota.h>
05214ec7
AC
16.BR "#include <xfs/xqm.h>" " /* Definition of " Q_X* " and " XFS_QUOTA_* \
17" constants"
18.RB " (or " <linux/dqblk_xfs.h> "; see NOTES) */"
dd3568a1 19.PP
cb2431bf
MK
20.BI "int quotactl(int " cmd ", const char *" special ", int " id \
21", caddr_t " addr );
cb2431bf 22.fi
fea681da 23.SH DESCRIPTION
093b6f20 24The quota system can be used to set per-user, per-group, and per-project limits
b5b42cc5 25on the amount of disk space used on a filesystem.
1eeddf25 26For each user and/or group,
9ee4a2b6 27a soft limit and a hard limit can be set for each filesystem.
1eeddf25
JK
28The hard limit can't be exceeded.
29The soft limit can be exceeded, but warnings will ensue.
955ea4e7
ES
30Moreover, the user can't exceed the soft limit for more than grace period
31duration (one week by default) at a time;
32after this, the soft limit counts as a hard limit.
efeece04 33.PP
fea681da 34The
e511ffb6 35.BR quotactl ()
1eeddf25
JK
36call manipulates disk quotas.
37The
38.I cmd
39argument indicates a command to be applied to the user or
40group ID specified in
41.IR id .
42To initialize the
1ae6b2c7 43.I cmd
1eeddf25 44argument, use the
1ae6b2c7 45.I QCMD(subcmd, type)
1eeddf25
JK
46macro.
47The
fea681da 48.I type
1eeddf25
JK
49value is either
50.BR USRQUOTA ,
51for user quotas,
1eeddf25 52.BR GRPQUOTA ,
b5b42cc5
ES
53for group quotas, or (since Linux 4.1)
54.\" 847aac644e92e5624f2c153bab409bf713d5ff9a
55.BR PRJQUOTA ,
56for project quotas.
1eeddf25 57The
fea681da 58.I subcmd
1eeddf25 59value is described below.
efeece04 60.PP
1eeddf25 61The
fea681da 62.I special
1eeddf25 63argument is a pointer to a null-terminated string containing the pathname
9ee4a2b6 64of the (mounted) block special device for the filesystem being manipulated.
efeece04 65.PP
1eeddf25 66The
fea681da 67.I addr
1eeddf25
JK
68argument is the address of an optional, command-specific, data structure
69that is copied in or out of the system.
70The interpretation of
71.I addr
96e60ae5 72is given with each operation below.
efeece04 73.PP
fea681da
MK
74The
75.I subcmd
96e60ae5 76value is one of the following operations:
0019177e 77.TP
5a11d358 78.B Q_QUOTAON
9ee4a2b6 79Turn on quotas for a filesystem.
c13182ef 80The
1eeddf25
JK
81.I id
82argument is the identification number of the quota format to be used.
83Currently, there are three supported quota formats:
84.RS
85.TP 13
1ae6b2c7 86.B QFMT_VFS_OLD
1eeddf25 87The original quota format.
fea681da 88.TP
1ae6b2c7 89.B QFMT_VFS_V0
1eeddf25
JK
90The standard VFS v0 quota format, which can handle 32-bit UIDs and GIDs
91and quota limits up to 2^42 bytes and 2^32 inodes.
92.TP
1ae6b2c7 93.B QFMT_VFS_V1
1eeddf25 94A quota format that can handle 32-bit UIDs and GIDs
58f638a2 95and quota limits of 2^63 - 1 bytes and 2^63 - 1 inodes.
1eeddf25
JK
96.RE
97.IP
98The
1ae6b2c7 99.I addr
1eeddf25 100argument points to the pathname of a file containing the quotas for
9ee4a2b6 101the filesystem.
1eeddf25
JK
102The quota file must exist; it is normally created with the
103.BR quotacheck (8)
f5fd82cc
MK
104program
105.IP
106Quota information can be also stored in hidden system inodes
107for ext4, XFS, and other filesystems if the filesystem is configured so.
ae848b1d
YX
108In this case, there are no visible quota files and there is no need to
109use
110.BR quotacheck (8).
f5fd82cc
MK
111Quota information is always kept consistent by the filesystem and the
112.B Q_QUOTAON
113operation serves only to enable enforcement of quota limits.
114The presence of hidden
115system inodes with quota information is indicated by the
116.B DQF_SYS_FILE
117flag in the
118.I dqi_flags
119field returned by the
120.B Q_GETINFO
121operation.
122.IP
1eeddf25
JK
123This operation requires privilege
124.RB ( CAP_SYS_ADMIN ).
0019177e 125.TP
fea681da 126.B Q_QUOTAOFF
9ee4a2b6 127Turn off quotas for a filesystem.
1eeddf25
JK
128The
129.I addr
130and
131.I id
132arguments are ignored.
133This operation requires privilege
134.RB ( CAP_SYS_ADMIN ).
fea681da
MK
135.TP
136.B Q_GETQUOTA
1eeddf25
JK
137Get disk quota limits and current usage for user or group
138.IR id .
c13182ef 139The
fea681da 140.I addr
1eeddf25
JK
141argument is a pointer to a
142.I dqblk
143structure defined in
1ae6b2c7 144.I <sys/quota.h>
1eeddf25 145as follows:
e646a1ba 146.IP
1eeddf25 147.in +4n
e646a1ba 148.EX
72da9ef1 149/* uint64_t is an unsigned 64\-bit integer;
8f172c56 150 uint32_t is an unsigned 32\-bit integer */
1eeddf25 151
d38f98b6
MK
152struct dqblk { /* Definition since Linux 2.4.22 */
153 uint64_t dqb_bhardlimit; /* Absolute limit on disk
154 quota blocks alloc */
155 uint64_t dqb_bsoftlimit; /* Preferred limit on
156 disk quota blocks */
157 uint64_t dqb_curspace; /* Current occupied space
158 (in bytes) */
159 uint64_t dqb_ihardlimit; /* Maximum number of
160 allocated inodes */
161 uint64_t dqb_isoftlimit; /* Preferred inode limit */
162 uint64_t dqb_curinodes; /* Current number of
163 allocated inodes */
164 uint64_t dqb_btime; /* Time limit for excessive
165 disk use */
166 uint64_t dqb_itime; /* Time limit for excessive
167 files */
168 uint32_t dqb_valid; /* Bit mask of QIF_*
169 constants */
1eeddf25
JK
170};
171
172/* Flags in dqb_valid that indicate which fields in
173 dqblk structure are valid. */
174
175#define QIF_BLIMITS 1
176#define QIF_SPACE 2
177#define QIF_ILIMITS 4
178#define QIF_INODES 8
179#define QIF_BTIME 16
180#define QIF_ITIME 32
181#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
182#define QIF_USAGE (QIF_SPACE | QIF_INODES)
183#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
184#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
e646a1ba 185.EE
1eeddf25 186.in
e646a1ba 187.IP
1eeddf25
JK
188The
189.I dqb_valid
190field is a bit mask that is set to indicate the entries in the
191.I dqblk
192structure that are valid.
193Currently, the kernel fills in all entries of the
194.I dqblk
195structure and marks them as valid in the
196.I dqb_valid
197field.
198Unprivileged users may retrieve only their own quotas;
199a privileged user
200.RB ( CAP_SYS_ADMIN )
201can retrieve the quotas of any user.
fea681da 202.TP
8d03f12c
MK
203.BR Q_GETNEXTQUOTA " (since Linux 4.6)"
204.\" commit 926132c0257a5a8d149a6a395cc3405e55420566
205This operation is the same as
206.BR Q_GETQUOTA ,
207but it returns quota information for the next ID greater than or equal to
1ae6b2c7 208.I id
8d03f12c 209that has a quota set.
efeece04 210.IP
8d03f12c
MK
211The
212.I addr
213argument is a pointer to a
214.I nextdqblk
215structure whose fields are as for the
216.IR dqblk ,
217except for the addition of a
218.I dqb_id
219field that is used to return the ID for which
220quota information is being returned:
efeece04 221.IP
8d03f12c 222.in +4n
b8302363 223.EX
8d03f12c
MK
224struct nextdqblk {
225 uint64_t dqb_bhardlimit;
226 uint64_t dqb_bsoftlimit;
227 uint64_t dqb_curspace;
228 uint64_t dqb_ihardlimit;
229 uint64_t dqb_isoftlimit;
230 uint64_t dqb_curinodes;
231 uint64_t dqb_btime;
232 uint64_t dqb_itime;
233 uint32_t dqb_valid;
234 uint32_t dqb_id;
235};
b8302363 236.EE
e646a1ba 237.in
8d03f12c 238.TP
fea681da 239.B Q_SETQUOTA
1eeddf25
JK
240Set quota information for user or group
241.IR id ,
242using the information supplied in the
243.I dqblk
244structure pointed to by
245.IR addr .
246The
247.I dqb_valid
248field of the
249.I dqblk
250structure indicates which entries in the structure have been set by the caller.
251This operation supersedes the
252.B Q_SETQLIM
253and
254.B Q_SETUSE
255operations in the previous quota interfaces.
256This operation requires privilege
257.RB ( CAP_SYS_ADMIN ).
258.TP
4c8a2e1d 259.BR Q_GETINFO " (since Linux 2.4.22)"
1eeddf25
JK
260Get information (like grace times) about quotafile.
261The
fea681da 262.I addr
1eeddf25
JK
263argument should be a pointer to a
264.I dqinfo
265structure.
266This structure is defined in
1ae6b2c7 267.I <sys/quota.h>
1eeddf25 268as follows:
e646a1ba 269.IP
1eeddf25 270.in +4n
e646a1ba 271.EX
72da9ef1
MK
272/* uint64_t is an unsigned 64\-bit integer;
273 uint32_t is an unsigned 32\-bit integer */
1eeddf25
JK
274
275struct dqinfo { /* Defined since kernel 2.4.22 */
d38f98b6
MK
276 uint64_t dqi_bgrace; /* Time before block soft limit
277 becomes hard limit */
278 uint64_t dqi_igrace; /* Time before inode soft limit
279 becomes hard limit */
280 uint32_t dqi_flags; /* Flags for quotafile
281 (DQF_*) */
1eeddf25
JK
282 uint32_t dqi_valid;
283};
284
285/* Bits for dqi_flags */
286
b09639d9
MK
287/* Quota format QFMT_VFS_OLD */
288
d38f98b6
MK
289#define DQF_ROOT_SQUASH (1 << 0) /* Root squash enabled */
290 /* Before Linux v4.0, this had been defined
291 privately as V1_DQF_RSQUASH */
b09639d9 292
2219bd3f
ES
293/* Quota format QFMT_VFS_V0 / QFMT_VFS_V1 */
294
093b6f20
MK
295#define DQF_SYS_FILE (1 << 16) /* Quota stored in
296 a system file */
1eeddf25
JK
297
298/* Flags in dqi_valid that indicate which fields in
299 dqinfo structure are valid. */
300
d38f98b6
MK
301#define IIF_BGRACE 1
302#define IIF_IGRACE 2
303#define IIF_FLAGS 4
304#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
e646a1ba 305.EE
1eeddf25 306.in
e646a1ba 307.IP
1eeddf25
JK
308The
309.I dqi_valid
310field in the
311.I dqinfo
312structure indicates the entries in the structure that are valid.
313Currently, the kernel fills in all entries of the
314.I dqinfo
315structure and marks them all as valid in the
316.I dqi_valid
317field.
318The
319.I id
320argument is ignored.
fea681da 321.TP
4c8a2e1d 322.BR Q_SETINFO " (since Linux 2.4.22)"
1eeddf25
JK
323Set information about quotafile.
324The
fea681da 325.I addr
1eeddf25
JK
326argument should be a pointer to a
327.I dqinfo
328structure.
329The
330.I dqi_valid
331field of the
332.I dqinfo
333structure indicates the entries in the structure
334that have been set by the caller.
335This operation supersedes the
336.B Q_SETGRACE
337and
338.B Q_SETFLAGS
339operations in the previous quota interfaces.
340The
341.I id
342argument is ignored.
343This operation requires privilege
344.RB ( CAP_SYS_ADMIN ).
fea681da 345.TP
4c8a2e1d 346.BR Q_GETFMT " (since Linux 2.4.22)"
9ee4a2b6 347Get quota format used on the specified filesystem.
1eeddf25
JK
348The
349.I addr
350argument should be a pointer to a 4-byte buffer
351where the format number will be stored.
fea681da
MK
352.TP
353.B Q_SYNC
9ee4a2b6 354Update the on-disk copy of quota usages for a filesystem.
1eeddf25
JK
355If
356.I special
9ee4a2b6 357is NULL, then all filesystems with active quotas are sync'ed.
1eeddf25
JK
358The
359.I addr
360and
361.I id
362arguments are ignored.
fea681da 363.TP
3cf5ae17 364.BR Q_GETSTATS " (supported up to Linux 2.4.21)"
1eeddf25
JK
365Get statistics and other generic information about the quota subsystem.
366The
367.I addr
368argument should be a pointer to a
369.I dqstats
370structure in which data should be stored.
371This structure is defined in
c367cd59 372.IR <sys/quota.h> .
1eeddf25
JK
373The
374.I special
375and
376.I id
377arguments are ignored.
efeece04 378.IP
3cf5ae17 379This operation is obsolete and was removed in Linux 2.4.22.
1eeddf25
JK
380Files in
381.I /proc/sys/fs/quota/
382carry the information instead.
383.PP
9ee4a2b6 384For XFS filesystems making use of the XFS Quota Manager (XQM),
96e60ae5 385the above operations are bypassed and the following operations are used:
0019177e 386.TP
1eeddf25 387.B Q_XQUOTAON
9ee4a2b6 388Turn on quotas for an XFS filesystem.
1eeddf25
JK
389XFS provides the ability to turn on/off quota limit enforcement
390with quota accounting.
391Therefore, XFS expects
392.I addr
393to be a pointer to an
394.I "unsigned int"
5d771a4a 395that contains a bitwise combination of the following flags (defined in
90d79b64 396.IR <xfs/xqm.h> ):
efeece04 397.IP
90d79b64 398.in +4n
b8302363 399.EX
36a35d67
MK
400XFS_QUOTA_UDQ_ACCT /* User quota accounting */
401XFS_QUOTA_UDQ_ENFD /* User quota limits enforcement */
402XFS_QUOTA_GDQ_ACCT /* Group quota accounting */
403XFS_QUOTA_GDQ_ENFD /* Group quota limits enforcement */
404XFS_QUOTA_PDQ_ACCT /* Project quota accounting */
405XFS_QUOTA_PDQ_ENFD /* Project quota limits enforcement */
b8302363 406.EE
e646a1ba 407.in
efeece04 408.IP
1eeddf25
JK
409This operation requires privilege
410.RB ( CAP_SYS_ADMIN ).
90d79b64
ES
411The
412.I id
413argument is ignored.
1eeddf25
JK
414.TP
415.B Q_XQUOTAOFF
9ee4a2b6 416Turn off quotas for an XFS filesystem.
1eeddf25
JK
417As with
418.BR Q_QUOTAON ,
9ee4a2b6 419XFS filesystems expect a pointer to an
1eeddf25
JK
420.I "unsigned int"
421that specifies whether quota accounting and/or limit enforcement need
90d79b64 422to be turned off (using the same flags as for
093b6f20 423.B Q_XQUOTAON
96e60ae5 424operation).
1eeddf25
JK
425This operation requires privilege
426.RB ( CAP_SYS_ADMIN ).
90d79b64
ES
427The
428.I id
429argument is ignored.
1eeddf25
JK
430.TP
431.B Q_XGETQUOTA
432Get disk quota limits and current usage for user
433.IR id .
434The
435.I addr
436argument is a pointer to an
437.I fs_disk_quota
093b6f20 438structure, which is defined in
90d79b64
ES
439.I <xfs/xqm.h>
440as follows:
efeece04 441.IP
90d79b64 442.in +4n
b8302363 443.EX
093b6f20
MK
444/* All the blk units are in BBs (Basic Blocks) of
445 512 bytes. */
90d79b64 446
d38f98b6 447#define FS_DQUOT_VERSION 1 /* fs_disk_quota.d_version */
90d79b64 448
d38f98b6
MK
449#define XFS_USER_QUOTA (1<<0) /* User quota type */
450#define XFS_PROJ_QUOTA (1<<1) /* Project quota type */
451#define XFS_GROUP_QUOTA (1<<2) /* Group quota type */
90d79b64
ES
452
453struct fs_disk_quota {
d38f98b6
MK
454 int8_t d_version; /* Version of this structure */
455 int8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */
456 uint16_t d_fieldmask; /* Field specifier */
457 uint32_t d_id; /* User, project, or group ID */
093b6f20
MK
458 uint64_t d_blk_hardlimit; /* Absolute limit on
459 disk blocks */
460 uint64_t d_blk_softlimit; /* Preferred limit on
461 disk blocks */
462 uint64_t d_ino_hardlimit; /* Maximum # allocated
463 inodes */
464 uint64_t d_ino_softlimit; /* Preferred inode limit */
d38f98b6
MK
465 uint64_t d_bcount; /* # disk blocks owned by
466 the user */
467 uint64_t d_icount; /* # inodes owned by the user */
468 int32_t d_itimer; /* Zero if within inode limits */
469 /* If not, we refuse service */
470 int32_t d_btimer; /* Similar to above; for
471 disk blocks */
472 uint16_t d_iwarns; /* # warnings issued with
473 respect to # of inodes */
474 uint16_t d_bwarns; /* # warnings issued with
475 respect to disk blocks */
d064d41a 476 int32_t d_padding2; /* Padding \- for future use */
093b6f20
MK
477 uint64_t d_rtb_hardlimit; /* Absolute limit on realtime
478 (RT) disk blocks */
479 uint64_t d_rtb_softlimit; /* Preferred limit on RT
480 disk blocks */
d38f98b6
MK
481 uint64_t d_rtbcount; /* # realtime blocks owned */
482 int32_t d_rtbtimer; /* Similar to above; for RT
483 disk blocks */
484 uint16_t d_rtbwarns; /* # warnings issued with
485 respect to RT disk blocks */
d064d41a 486 int16_t d_padding3; /* Padding \- for future use */
d38f98b6 487 char d_padding4[8]; /* Yet more padding */
90d79b64 488};
b8302363 489.EE
e646a1ba 490.in
efeece04 491.IP
1eeddf25
JK
492Unprivileged users may retrieve only their own quotas;
493a privileged user
494.RB ( CAP_SYS_ADMIN )
495may retrieve the quotas of any user.
3b177104
MK
496.TP
497.BR Q_XGETNEXTQUOTA " (since Linux 4.6)"
8d03f12c
MK
498.\" commit 8b37524962b9c54423374717786198f5c0820a28
499This operation is the same as
500.BR Q_XGETQUOTA ,
90d79b64
ES
501but it returns (in the
502.I fs_disk_quota
503structure pointed by
504.IR addr )
505quota information for the next ID greater than or equal to
1ae6b2c7 506.I id
093b6f20
MK
507that has a quota set.
508Note that since
90d79b64
ES
509.I fs_disk_quota
510already has
511.I q_id
512field, no separate structure type is needed (in contrast with
513.B Q_GETQUOTA
514and
515.B Q_GETNEXTQUOTA
96e60ae5 516operations)
1eeddf25
JK
517.TP
518.B Q_XSETQLIM
519Set disk quota limits for user
520.IR id .
521The
522.I addr
523argument is a pointer to an
524.I fs_disk_quota
90d79b64 525structure.
1eeddf25
JK
526This operation requires privilege
527.RB ( CAP_SYS_ADMIN ).
528.TP
529.B Q_XGETQSTAT
869c706f 530Returns XFS filesystem-specific quota information in the
1eeddf25 531.I fs_quota_stat
869c706f
MK
532structure pointed by
533.IR addr .
1eeddf25 534This is useful for finding out how much space is used to store quota
093b6f20
MK
535information, and also to get the quota on/off status of a given local XFS
536filesystem.
537The
90d79b64
ES
538.I fs_quota_stat
539structure itself is defined as follows:
efeece04 540.IP
90d79b64 541.in +4n
b8302363 542.EX
90d79b64
ES
543#define FS_QSTAT_VERSION 1 /* fs_quota_stat.qs_version */
544
545struct fs_qfilestat {
093b6f20
MK
546 uint64_t qfs_ino; /* Inode number */
547 uint64_t qfs_nblks; /* Number of BBs
d064d41a 548 512\-byte\-blocks */
093b6f20 549 uint32_t qfs_nextents; /* Number of extents */
90d79b64
ES
550};
551
552struct fs_quota_stat {
d38f98b6
MK
553 int8_t qs_version; /* Version number for
554 future changes */
555 uint16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
556 int8_t qs_pad; /* Unused */
557 struct fs_qfilestat qs_uquota; /* User quota storage
558 information */
559 struct fs_qfilestat qs_gquota; /* Group quota storage
560 information */
561 uint32_t qs_incoredqs; /* Number of dquots in core */
562 int32_t qs_btimelimit; /* Limit for blocks timer */
563 int32_t qs_itimelimit; /* Limit for inodes timer */
564 int32_t qs_rtbtimelimit;/* Limit for RT
565 blocks timer */
566 uint16_t qs_bwarnlimit; /* Limit for # of warnings */
567 uint16_t qs_iwarnlimit; /* Limit for # of warnings */
90d79b64 568};
b8302363 569.EE
e646a1ba 570.in
efeece04 571.IP
90d79b64
ES
572The
573.I id
574argument is ignored.
575.TP
576.B Q_XGETQSTATV
869c706f 577Returns XFS filesystem-specific quota information in the
90d79b64 578.I fs_quota_statv
869c706f
MK
579pointed to by
580.IR addr .
96e60ae5 581This version of the operation uses a structure with proper versioning support,
093b6f20
MK
582along with appropriate layout (all fields are naturally aligned) and
583padding to avoiding special compat handling;
584it also provides the ability to get statistics regarding
585the project quota file.
586The
90d79b64
ES
587.I fs_quota_statv
588structure itself is defined as follows:
efeece04 589.IP
90d79b64 590.in +4n
b8302363 591.EX
90d79b64
ES
592#define FS_QSTATV_VERSION1 1 /* fs_quota_statv.qs_version */
593
594struct fs_qfilestatv {
d38f98b6
MK
595 uint64_t qfs_ino; /* Inode number */
596 uint64_t qfs_nblks; /* Number of BBs
d064d41a 597 512\-byte\-blocks */
d38f98b6 598 uint32_t qfs_nextents; /* Number of extents */
d064d41a 599 uint32_t qfs_pad; /* Pad for 8\-byte alignment */
90d79b64
ES
600};
601
602struct fs_quota_statv {
d38f98b6
MK
603 int8_t qs_version; /* Version for future
604 changes */
d064d41a 605 uint8_t qs_pad1; /* Pad for 16\-bit alignment */
d38f98b6
MK
606 uint16_t qs_flags; /* XFS_QUOTA_.* flags */
607 uint32_t qs_incoredqs; /* Number of dquots incore */
608 struct fs_qfilestatv qs_uquota; /* User quota
609 information */
610 struct fs_qfilestatv qs_gquota; /* Group quota
611 information */
612 struct fs_qfilestatv qs_pquota; /* Project quota
613 information */
093b6f20
MK
614 int32_t qs_btimelimit; /* Limit for blocks timer */
615 int32_t qs_itimelimit; /* Limit for inodes timer */
d38f98b6
MK
616 int32_t qs_rtbtimelimit; /* Limit for RT blocks
617 timer */
093b6f20
MK
618 uint16_t qs_bwarnlimit; /* Limit for # of warnings */
619 uint16_t qs_iwarnlimit; /* Limit for # of warnings */
620 uint64_t qs_pad2[8]; /* For future proofing */
90d79b64 621};
b8302363 622.EE
e646a1ba 623.in
efeece04 624.IP
90d79b64
ES
625The
626.I qs_version
627field of the structure should be filled with the version of the structure
628supported by the callee (for now, only
629.I FS_QSTAT_VERSION1
093b6f20
MK
630is supported).
631The kernel will fill the structure in accordance with
90d79b64
ES
632version provided.
633The
634.I id
635argument is ignored.
1eeddf25 636.TP
26f3978f
YX
637.BR Q_XQUOTARM " (buggy until Linux 3.16)"
638.\" 9da93f9b7cdf8ab28da6b364cdc1fafc8670b4dc
fcd4007b
MK
639Free the disk space taken by disk quotas.
640The
90d79b64
ES
641.I addr
642argument should be a pointer to an
643.I "unsigned int"
644value containing flags (the same as in
645.I d_flags
646field of
647.I fs_disk_quota
64e4eac9 648structure)
ef9e5be0 649which identify what types of quota
64e4eac9
MK
650should be removed.
651(Note that the quota type passed in the
90d79b64
ES
652.I cmd
653argument is ignored, but should remain valid in order to pass preliminary
64e4eac9 654quotactl syscall handler checks.)
efeece04 655.IP
093b6f20
MK
656Quotas must have already been turned off.
657The
90d79b64
ES
658.I id
659argument is ignored.
942627c9 660.TP
721381be 661.BR Q_XQUOTASYNC " (since Linux 2.6.15; no-op since Linux 3.4)"
d38be90d 662.\" Added in commit ee34807a65aa0c5911dc27682863afca780a003e
96e60ae5 663This operation was an XFS quota equivalent to
a5394cba 664.BR Q_SYNC ,
d38be90d 665but it is no-op since Linux 3.4,
942627c9 666.\" 4b217ed9e30f94b6e8e5e262020ef0ceab6113af
d38be90d 667as
1eeddf25 668.BR sync (1)
d38be90d
MK
669writes quota information to disk now
670(in addition to the other filesystem metadata that it writes out).
671The
942627c9
ES
672.IR special ", " id " and " addr
673arguments are ignored.
6acbcbc6 674.SH RETURN VALUE
fea681da 675On success,
e511ffb6 676.BR quotactl ()
1eeddf25
JK
677returns 0; on error \-1
678is returned, and
fea681da 679.I errno
1eeddf25 680is set to indicate the error.
fea681da 681.SH ERRORS
fea681da 682.TP
3b177104
MK
683.B EACCES
684.I cmd
685is
686.BR Q_QUOTAON ,
687and the quota file pointed to by
688.I addr
689exists, but is not a regular file or
690is not on the filesystem pointed to by
691.IR special .
692.TP
693.B EBUSY
694.I cmd
695is
696.BR Q_QUOTAON ,
697but another
698.B Q_QUOTAON
699had already been performed.
700.TP
fea681da 701.B EFAULT
fea681da 702.I addr
1eeddf25
JK
703or
704.I special
705is invalid.
fea681da
MK
706.TP
707.B EINVAL
1eeddf25
JK
708.I cmd
709or
fea681da 710.I type
1eeddf25 711is invalid.
fea681da 712.TP
3b177104
MK
713.B EINVAL
714.I cmd
715is
716.BR Q_QUOTAON ,
717but the specified quota file is corrupted.
718.TP
64e4eac9
MK
719.BR EINVAL " (since Linux 5.5)"
720.\" 3dd4d40b420846dd35869ccc8f8627feef2cff32
ef9e5be0
YX
721.I cmd
722is
723.BR Q_XQUOTARM ,
64e4eac9
MK
724but
725.I addr
726does not point to valid quota types.
ef9e5be0 727.TP
1eeddf25
JK
728.B ENOENT
729The file specified by
fea681da 730.I special
1eeddf25
JK
731or
732.I addr
733does not exist.
fea681da 734.TP
1eeddf25
JK
735.B ENOSYS
736The kernel has not been compiled with the
737.B CONFIG_QUOTA
738option.
fea681da
MK
739.TP
740.B ENOTBLK
741.I special
1eeddf25 742is not a block device.
fea681da
MK
743.TP
744.B EPERM
1eeddf25
JK
745The caller lacked the required privilege
746.RB ( CAP_SYS_ADMIN )
747for the specified operation.
fea681da 748.TP
3b177104 749.B ERANGE
1eeddf25
JK
750.I cmd
751is
752.BR Q_SETQUOTA ,
3b177104 753but the specified limits are out of the range allowed by the quota format.
1eeddf25 754.TP
3b177104
MK
755.B ESRCH
756No disk quota is found for the indicated user.
757Quotas have not been turned on for this filesystem.
758.TP
759.B ESRCH
1eeddf25
JK
760.I cmd
761is
762.BR Q_QUOTAON ,
3b177104 763but the specified quota format was not found.
8d03f12c
MK
764.TP
765.B ESRCH
766.I cmd
767is
768.B Q_GETNEXTQUOTA
769or
770.BR Q_XGETNEXTQUOTA ,
771but there is no ID greater than or equal to
1ae6b2c7 772.I id
8d03f12c 773that has an active quota.
90d79b64
ES
774.SH NOTES
775Instead of
776.I <xfs/xqm.h>
777one can use
778.IR <linux/dqblk_xfs.h> ,
779taking into account that there are several naming discrepancies:
780.IP \(bu 3
781Quota enabling flags (of format
782.BR XFS_QUOTA_[UGP]DQ_{ACCT,ENFD} )
093b6f20 783are defined without a leading "X", as
90d79b64
ES
784.BR FS_QUOTA_[UGP]DQ_{ACCT,ENFD} .
785.IP \(bu
093b6f20 786The same is true for
90d79b64 787.B XFS_{USER,GROUP,PROJ}_QUOTA
093b6f20 788quota type flags, which are defined as
90d79b64
ES
789.BR FS_{USER,GROUP,PROJ}_QUOTA .
790.IP \(bu
791The
792.I dqblk_xfs.h
093b6f20 793header file defines its own
90d79b64
ES
794.BR XQM_USRQUOTA ,
795.BR XQM_GRPQUOTA ,
796and
797.B XQM_PRJQUOTA
798constants for the available quota types, but their values are the same as for
799constants without the
800.B XQM_
801prefix.
47297adb 802.SH SEE ALSO
fea681da
MK
803.BR quota (1),
804.BR getrlimit (2),
fea681da
MK
805.BR quotacheck (8),
806.BR quotaon (8)