mirror of https://github.com/mkerrisk/man-pages
quotactl.2: Major updates
Update the page to consolidate information from the outdated man-pages quotactl.2 page and the quotactl.2 page in the "quota-tools" pachage. The page in "quota-tools" has now been dropped by Jan Kara, so that there is just one canonical quotactl.2 page (in pan-pages). Various other pieces added to the page by mtk. Reported-by: Petr Gajdos <pgajdos@suse.cz> Reported-by: Jan Blunck <jblunck@novell.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
245dec52ca
commit
1eeddf2527
605
man2/quotactl.2
605
man2/quotactl.2
|
@ -1,243 +1,504 @@
|
||||||
.\" Hey Emacs! This file is -*- nroff -*- source.
|
.\" Copyright (c) 2010, Jan Kara
|
||||||
.\"
|
.\" A few pieces copyright (c) 1996 Andries Brouwer (aeb@cwi.nl)
|
||||||
.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
|
.\" and copyright 2010 (c) Michael Kerrisk <mtk.manpages@gmail.com>
|
||||||
.\"
|
.\"
|
||||||
.\" Permission is granted to make and distribute verbatim copies of this
|
.\" Permission is granted to make and distribute verbatim copies of this
|
||||||
.\" manual provided the copyright notice and this permission notice are
|
.\" manual provided the copyright notice and this permission notice are
|
||||||
.\" preserved on all copies.
|
.\" preserved on all copies.
|
||||||
.\"
|
.\"
|
||||||
.\" Permission is granted to copy and distribute modified versions of this
|
.\" Permission is granted to copy and distribute modified versions of
|
||||||
.\" manual under the conditions for verbatim copying, provided that the
|
.\" this manual under the conditions for verbatim copying, provided that
|
||||||
.\" entire resulting derived work is distributed under the terms of a
|
.\" the entire resulting derived work is distributed under the terms of
|
||||||
.\" permission notice identical to this one.
|
.\" a permission notice identical to this one.
|
||||||
.\"
|
.\"
|
||||||
.\" Since the Linux kernel and libraries are constantly changing, this
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
||||||
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
.\" manual page may be incorrect or out-of-date. The author(s) assume.
|
||||||
.\" responsibility for errors or omissions, or for damages resulting from
|
.\" no responsibility for errors or omissions, or for damages resulting.
|
||||||
.\" the use of the information contained herein. The author(s) may not
|
.\" from the use of the information contained herein. The author(s) may.
|
||||||
.\" have taken the same level of care in the production of this manual,
|
.\" not have taken the same level of care in the production of this.
|
||||||
.\" which is licensed free of charge, as they might when working
|
.\" manual, which is licensed free of charge, as they might when working.
|
||||||
.\" professionally.
|
.\" professionally.
|
||||||
.\"
|
.\"
|
||||||
.\" Formatted or processed versions of this manual, if unaccompanied by
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
||||||
.\" the source, must acknowledge the copyright and authors of this work.
|
.\" the source, must acknowledge the copyright and authors of this work.
|
||||||
.\"
|
.\"
|
||||||
.\" FIXME There is much that is missing and/or out of date in this page.
|
.TH QUOTACTL 2 2010-06-16 "Linux" "Linux Programmer's Manual"
|
||||||
.\" (There is a quotactl.2 page in the quotactl package that seems to
|
|
||||||
.\" have more info than this page.)
|
|
||||||
.\" As things stand the page more or less documents Linux 2.2 reality:
|
|
||||||
.\"
|
|
||||||
.\" Linux 2.2 has:
|
|
||||||
.\"
|
|
||||||
.\" Q_GETQUOTA
|
|
||||||
.\" Q_GETSTATS
|
|
||||||
.\" Q_QUOTAOFF
|
|
||||||
.\" Q_QUOTAON
|
|
||||||
.\" Q_RSQUASH (not currently documented)
|
|
||||||
.\" Q_SETQLIM
|
|
||||||
.\" Q_SETQUOTA
|
|
||||||
.\" Q_SETUSE
|
|
||||||
.\" Q_SYNC
|
|
||||||
.\"
|
|
||||||
.\" Linux 2.4 has:
|
|
||||||
.\"
|
|
||||||
.\" Q_COMP_QUOTAOFF
|
|
||||||
.\" Q_COMP_QUOTAON
|
|
||||||
.\" Q_COMP_SYNC
|
|
||||||
.\" Q_GETFMT
|
|
||||||
.\" Q_GETINFO
|
|
||||||
.\" Q_GETQUOTA
|
|
||||||
.\" Q_QUOTAOFF
|
|
||||||
.\" Q_QUOTAON
|
|
||||||
.\" Q_SETINFO
|
|
||||||
.\" Q_SETQUOTA
|
|
||||||
.\" Q_SYNC
|
|
||||||
.\" Q_V1_GETQUOTA Q_V1_GETSTATS Q_V1_RSQUASH Q_V1_SETQLIM
|
|
||||||
.\" Q_V1_SETQUOTA Q_V1_SETUSE
|
|
||||||
.\" Q_V2_GETINFO Q_V2_GETQUOTA Q_V2_SETFLAGS Q_V2_SETGRACE
|
|
||||||
.\" Q_V2_SETINFO Q_V2_SETQUOTA Q_V2_SETUSE
|
|
||||||
.\" Q_XGETQSTAT Q_XGETQUOTA Q_XQUOTAOFF Q_XQUOTAON Q_XQUOTARM
|
|
||||||
.\" Q_XSETQLIM
|
|
||||||
.\"
|
|
||||||
.\" Linux 2.6.16 has:
|
|
||||||
.\"
|
|
||||||
.\" Q_GETFMT
|
|
||||||
.\" Q_GETINFO
|
|
||||||
.\" Q_GETQUOTA
|
|
||||||
.\" Q_QUOTAOFF
|
|
||||||
.\" Q_QUOTAON
|
|
||||||
.\" Q_SETINFO
|
|
||||||
.\" Q_SETQUOTA
|
|
||||||
.\" Q_SYNC
|
|
||||||
.\" Q_XGETQSTAT
|
|
||||||
.\" Q_XGETQUOTA
|
|
||||||
.\" Q_XQUOTAOFF
|
|
||||||
.\" Q_XQUOTAON
|
|
||||||
.\" Q_XQUOTARM
|
|
||||||
.\" Q_XQUOTASYNC
|
|
||||||
.\" Q_XSETQLIM
|
|
||||||
.\"
|
|
||||||
.TH QUOTACTL 2 2007-06-01 "Linux" "Linux Programmer's Manual"
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
quotactl \- manipulate disk quota
|
quotactl \- manipulate disk quotas
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.nf
|
.nf
|
||||||
.B #include <sys/types.h>
|
|
||||||
.br
|
|
||||||
.B #include <sys/quota.h>
|
.B #include <sys/quota.h>
|
||||||
.sp
|
.B #include <xfs/xqm.h>
|
||||||
|
.LP
|
||||||
.BI "int quotactl(int " cmd ", const char *" special ", int " id \
|
.BI "int quotactl(int " cmd ", const char *" special ", int " id \
|
||||||
", caddr_t " addr );
|
", caddr_t " addr );
|
||||||
.fi
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The quota system defines for each user and/or group a soft limit
|
.LP
|
||||||
and a hard limit bounding the amount of disk space that can be
|
The quota system can be used to set per-user and per-group limits on the
|
||||||
used on a given file system.
|
amount of disk space used on a file system.
|
||||||
The hard limit cannot be crossed.
|
For each user and/or group,
|
||||||
The soft limit can be crossed, but warnings will ensue.
|
a soft limit and a hard limit can be set for each file system.
|
||||||
Moreover,
|
The hard limit can't be exceeded.
|
||||||
the user cannot be above the soft limit for more than one week (by default)
|
The soft limit can be exceeded, but warnings will ensue.
|
||||||
at a time: after this week the soft limit counts as hard limit.
|
Moreover, the user can't exceed the soft limit for more than one week
|
||||||
|
(by default) at a time;
|
||||||
|
after this time, the soft limit counts as a hard limit.
|
||||||
|
|
||||||
The
|
The
|
||||||
.BR quotactl ()
|
.BR quotactl ()
|
||||||
system call manipulates these quota.
|
call manipulates disk quotas.
|
||||||
Its first argument is
|
The
|
||||||
of the form
|
.I cmd
|
||||||
.BI QCMD( subcmd , type )
|
argument indicates a command to be applied to the user or
|
||||||
where
|
group ID specified in
|
||||||
|
.IR id .
|
||||||
|
To initialize the
|
||||||
|
.IR cmd
|
||||||
|
argument, use the
|
||||||
|
.IR "QCMD(subcmd, type)"
|
||||||
|
macro.
|
||||||
|
The
|
||||||
.I type
|
.I type
|
||||||
is either
|
value is either
|
||||||
.B USRQUOTA
|
.BR USRQUOTA ,
|
||||||
|
for user quotas,
|
||||||
or
|
or
|
||||||
.B GRPQUOTA
|
.BR GRPQUOTA ,
|
||||||
(for user quota and group quota, respectively), and
|
for group quotas.
|
||||||
|
The
|
||||||
.I subcmd
|
.I subcmd
|
||||||
is described below.
|
value is described below.
|
||||||
|
|
||||||
The second argument
|
The
|
||||||
.I special
|
.I special
|
||||||
is the block special device these quota apply to.
|
argument is a pointer to a null-terminated string containing the pathname
|
||||||
It must be mounted.
|
of the (mounted) block special device for the file system being manipulated.
|
||||||
|
|
||||||
The third argument
|
The
|
||||||
.I id
|
|
||||||
is the user or group ID these quota apply to (when relevant).
|
|
||||||
|
|
||||||
The fourth argument
|
|
||||||
.I addr
|
.I addr
|
||||||
is the address of a data structure, depending on the command.
|
argument is the address of an optional, command-specific, data structure
|
||||||
|
that is copied in or out of the system.
|
||||||
|
The interpretation of
|
||||||
|
.I addr
|
||||||
|
is given with each command below.
|
||||||
|
|
||||||
The
|
The
|
||||||
.I subcmd
|
.I subcmd
|
||||||
is one of
|
value is one of the following:
|
||||||
.TP 1.1i
|
.TP 8
|
||||||
.B Q_QUOTAON
|
.SB Q_QUOTAON
|
||||||
Enable quota.
|
Turn on quotas for a file system.
|
||||||
|
The
|
||||||
|
.I id
|
||||||
|
argument is the identification number of the quota format to be used.
|
||||||
|
Currently, there are three supported quota formats:
|
||||||
|
.RS
|
||||||
|
.TP 13
|
||||||
|
.BR QFMT_VFS_OLD
|
||||||
|
The original quota format.
|
||||||
|
.TP
|
||||||
|
.BR QFMT_VFS_V0
|
||||||
|
The standard VFS v0 quota format, which can handle 32-bit UIDs and GIDs
|
||||||
|
and quota limits up to 2^42 bytes and 2^32 inodes.
|
||||||
|
.TP
|
||||||
|
.BR QFMT_VFS_V1
|
||||||
|
A quota format that can handle 32-bit UIDs and GIDs
|
||||||
|
and quota limits of 2^64 bytes and 2^64 inodes.
|
||||||
|
.RE
|
||||||
|
.IP
|
||||||
|
The
|
||||||
|
.IR addr
|
||||||
|
argument points to the pathname of a file containing the quotas for
|
||||||
|
the file system.
|
||||||
|
The quota file must exist; it is normally created with the
|
||||||
|
.BR quotacheck (8)
|
||||||
|
program.
|
||||||
|
This operation requires privilege
|
||||||
|
.RB ( CAP_SYS_ADMIN ).
|
||||||
|
.TP 8
|
||||||
|
.B Q_QUOTAOFF
|
||||||
|
Turn off quotas for a file system.
|
||||||
The
|
The
|
||||||
.I addr
|
.I addr
|
||||||
argument is the pathname of the file containing
|
and
|
||||||
the quota for the file system.
|
.I id
|
||||||
.TP
|
arguments are ignored.
|
||||||
.B Q_QUOTAOFF
|
This operation requires privilege
|
||||||
Disable quota.
|
.RB ( CAP_SYS_ADMIN ).
|
||||||
.TP
|
.TP
|
||||||
.B Q_GETQUOTA
|
.B Q_GETQUOTA
|
||||||
Get limits and current usage of disk space.
|
Get disk quota limits and current usage for user or group
|
||||||
|
.IR id .
|
||||||
The
|
The
|
||||||
.I addr
|
.I addr
|
||||||
argument is a pointer to a dqblk structure (defined in
|
argument is a pointer to a
|
||||||
.IR <sys/quota.h> ).
|
.I dqblk
|
||||||
|
structure defined in
|
||||||
|
.IR <sys/quota.h>
|
||||||
|
as follows:
|
||||||
|
.in +4n
|
||||||
|
.nf
|
||||||
|
|
||||||
|
/* uint64_t is an unsigned 64-but integer */
|
||||||
|
|
||||||
|
struct dqblk { /* Definition since Linux 2.4.22 */
|
||||||
|
uint64_t dqb_bhardlimit; /* absolute limit on disk
|
||||||
|
quota blocks alloc */
|
||||||
|
uint64_t dqb_bsoftlimit; /* preferred limit on
|
||||||
|
disk quota blocks */
|
||||||
|
uint64_t dqb_curspace; /* current quota block
|
||||||
|
count */
|
||||||
|
uint64_t dqb_ihardlimit; /* maximum number of
|
||||||
|
allocated inodes */
|
||||||
|
uint64_t dqb_isoftlimit; /* preferred inode limit */
|
||||||
|
uint64_t dqb_curinodes; /* current number of
|
||||||
|
allocated inodes */
|
||||||
|
uint64_t dqb_btime; /* time limit for excessive
|
||||||
|
disk use */
|
||||||
|
uint64_t dqb_itime; /* time limit for excessive
|
||||||
|
files */
|
||||||
|
uint32_t dqb_valid; /* bit mask of QIF_*
|
||||||
|
constants */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Flags in dqb_valid that indicate which fields in
|
||||||
|
dqblk structure are valid. */
|
||||||
|
|
||||||
|
#define QIF_BLIMITS 1
|
||||||
|
#define QIF_SPACE 2
|
||||||
|
#define QIF_ILIMITS 4
|
||||||
|
#define QIF_INODES 8
|
||||||
|
#define QIF_BTIME 16
|
||||||
|
#define QIF_ITIME 32
|
||||||
|
#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
|
||||||
|
#define QIF_USAGE (QIF_SPACE | QIF_INODES)
|
||||||
|
#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
|
||||||
|
#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
|
||||||
|
|
||||||
|
.fi
|
||||||
|
.in
|
||||||
|
The
|
||||||
|
.I dqb_valid
|
||||||
|
field is a bit mask that is set to indicate the entries in the
|
||||||
|
.I dqblk
|
||||||
|
structure that are valid.
|
||||||
|
Currently, the kernel fills in all entries of the
|
||||||
|
.I dqblk
|
||||||
|
structure and marks them as valid in the
|
||||||
|
.I dqb_valid
|
||||||
|
field.
|
||||||
|
Unprivileged users may retrieve only their own quotas;
|
||||||
|
a privileged user
|
||||||
|
.RB ( CAP_SYS_ADMIN )
|
||||||
|
can retrieve the quotas of any user.
|
||||||
.TP
|
.TP
|
||||||
.B Q_SETQUOTA
|
.B Q_SETQUOTA
|
||||||
Set limits and current usage;
|
Set quota information for user or group
|
||||||
.I addr
|
.IR id ,
|
||||||
is as before.
|
using the information supplied in the
|
||||||
.TP
|
.I dqblk
|
||||||
|
structure pointed to by
|
||||||
|
.IR addr .
|
||||||
|
The
|
||||||
|
.I dqb_valid
|
||||||
|
field of the
|
||||||
|
.I dqblk
|
||||||
|
structure indicates which entries in the structure have been set by the caller.
|
||||||
|
This operation supersedes the
|
||||||
.B Q_SETQLIM
|
.B Q_SETQLIM
|
||||||
Set limits;
|
and
|
||||||
.I addr
|
|
||||||
is as before.
|
|
||||||
.TP
|
|
||||||
.B Q_SETUSE
|
.B Q_SETUSE
|
||||||
Set usage.
|
operations in the previous quota interfaces.
|
||||||
|
This operation requires privilege
|
||||||
|
.RB ( CAP_SYS_ADMIN ).
|
||||||
|
.TP
|
||||||
|
.B Q_GETINFO
|
||||||
|
Get information (like grace times) about quotafile.
|
||||||
|
The
|
||||||
|
.I addr
|
||||||
|
argument should be a pointer to a
|
||||||
|
.I dqinfo
|
||||||
|
structure.
|
||||||
|
This structure is defined in
|
||||||
|
.IR <sys/quota.h>
|
||||||
|
as follows:
|
||||||
|
.in +4n
|
||||||
|
.nf
|
||||||
|
|
||||||
|
/* uint64_t is an unsigned 64-bit integer;
|
||||||
|
uint32_t is an unsigned 32-bit integer */
|
||||||
|
|
||||||
|
struct dqinfo { /* Defined since kernel 2.4.22 */
|
||||||
|
uint64_t dqi_bgrace; /* Time before block soft limit
|
||||||
|
becomes hard limit */
|
||||||
|
|
||||||
|
uint64_t dqi_igrace; /* Time before inode soft limit
|
||||||
|
becomes hard limit */
|
||||||
|
uint32_t dqi_flags; /* Flags for quotafile
|
||||||
|
(DQF_*) */
|
||||||
|
uint32_t dqi_valid;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Bits for dqi_flags */
|
||||||
|
|
||||||
|
#define DQF_INFO_DIRTY (1 << 16) /* Is info dirty? */
|
||||||
|
|
||||||
|
/* Flags in dqi_valid that indicate which fields in
|
||||||
|
dqinfo structure are valid. */
|
||||||
|
|
||||||
|
# define IIF_BGRACE 1
|
||||||
|
# define IIF_IGRACE 2
|
||||||
|
# define IIF_FLAGS 4
|
||||||
|
# define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
|
||||||
|
|
||||||
|
.fi
|
||||||
|
.in
|
||||||
|
The
|
||||||
|
.I dqi_valid
|
||||||
|
field in the
|
||||||
|
.I dqinfo
|
||||||
|
structure indicates the entries in the structure that are valid.
|
||||||
|
Currently, the kernel fills in all entries of the
|
||||||
|
.I dqinfo
|
||||||
|
structure and marks them all as valid in the
|
||||||
|
.I dqi_valid
|
||||||
|
field.
|
||||||
|
The
|
||||||
|
.I id
|
||||||
|
argument is ignored.
|
||||||
|
.TP
|
||||||
|
.B Q_SETINFO
|
||||||
|
Set information about quotafile.
|
||||||
|
The
|
||||||
|
.I addr
|
||||||
|
argument should be a pointer to a
|
||||||
|
.I dqinfo
|
||||||
|
structure.
|
||||||
|
The
|
||||||
|
.I dqi_valid
|
||||||
|
field of the
|
||||||
|
.I dqinfo
|
||||||
|
structure indicates the entries in the structure
|
||||||
|
that have been set by the caller.
|
||||||
|
This operation supersedes the
|
||||||
|
.B Q_SETGRACE
|
||||||
|
and
|
||||||
|
.B Q_SETFLAGS
|
||||||
|
operations in the previous quota interfaces.
|
||||||
|
The
|
||||||
|
.I id
|
||||||
|
argument is ignored.
|
||||||
|
This operation requires privilege
|
||||||
|
.RB ( CAP_SYS_ADMIN ).
|
||||||
|
.TP
|
||||||
|
.B Q_GETFMT
|
||||||
|
Get quota format used on the specified file system.
|
||||||
|
The
|
||||||
|
.I addr
|
||||||
|
argument should be a pointer to a 4-byte buffer
|
||||||
|
where the format number will be stored.
|
||||||
.TP
|
.TP
|
||||||
.B Q_SYNC
|
.B Q_SYNC
|
||||||
Sync disk copy of a file system's quota.
|
Update the on-disk copy of quota usages for a file system.
|
||||||
|
If
|
||||||
|
.I special
|
||||||
|
is NULL, then all file systems with active quotas are sync'ed.
|
||||||
|
The
|
||||||
|
.I addr
|
||||||
|
and
|
||||||
|
.I id
|
||||||
|
arguments are ignored.
|
||||||
.TP
|
.TP
|
||||||
.B Q_GETSTATS
|
.B Q_GETSTATS
|
||||||
Get collected stats.
|
Get statistics and other generic information about the quota subsystem.
|
||||||
.SH "RETURN VALUE"
|
The
|
||||||
|
.I addr
|
||||||
|
argument should be a pointer to a
|
||||||
|
.I dqstats
|
||||||
|
structure in which data should be stored.
|
||||||
|
This structure is defined in
|
||||||
|
.IR <sys/quota.h>.
|
||||||
|
The
|
||||||
|
.I special
|
||||||
|
and
|
||||||
|
.I id
|
||||||
|
arguments are ignored.
|
||||||
|
This operation is obsolete and not supported by recent kernels.
|
||||||
|
.\" Q_GETSTATS was removed in kernel 2.4.22.
|
||||||
|
Files in
|
||||||
|
.I /proc/sys/fs/quota/
|
||||||
|
carry the information instead.
|
||||||
|
.PP
|
||||||
|
For XFS file systems making use of the XFS Quota Manager (XQM),
|
||||||
|
the above commands are bypassed and the following commands are used:
|
||||||
|
.TP 8
|
||||||
|
.B Q_XQUOTAON
|
||||||
|
Turn on quotas for an XFS file system.
|
||||||
|
XFS provides the ability to turn on/off quota limit enforcement
|
||||||
|
with quota accounting.
|
||||||
|
Therefore, XFS expects
|
||||||
|
.I addr
|
||||||
|
to be a pointer to an
|
||||||
|
.I "unsigned int"
|
||||||
|
that contains either the flags
|
||||||
|
.B XFS_QUOTA_UDQ_ACCT
|
||||||
|
and/or
|
||||||
|
.B XFS_QUOTA_UDQ_ENFD
|
||||||
|
(for user quota), or
|
||||||
|
.B XFS_QUOTA_GDQ_ACCT
|
||||||
|
and/or
|
||||||
|
.B XFS_QUOTA_GDQ_ENFD
|
||||||
|
(for group quota), as defined in
|
||||||
|
.IR <xfs/xqm.h> .
|
||||||
|
This operation requires privilege
|
||||||
|
.RB ( CAP_SYS_ADMIN ).
|
||||||
|
.TP
|
||||||
|
.B Q_XQUOTAOFF
|
||||||
|
Turn off quotas for an XFS file system.
|
||||||
|
As with
|
||||||
|
.BR Q_QUOTAON ,
|
||||||
|
XFS file systems expect a pointer to an
|
||||||
|
.I "unsigned int"
|
||||||
|
that specifies whether quota accounting and/or limit enforcement need
|
||||||
|
to be turned off.
|
||||||
|
This operation requires privilege
|
||||||
|
.RB ( CAP_SYS_ADMIN ).
|
||||||
|
.TP
|
||||||
|
.B Q_XGETQUOTA
|
||||||
|
Get disk quota limits and current usage for user
|
||||||
|
.IR id .
|
||||||
|
The
|
||||||
|
.I addr
|
||||||
|
argument is a pointer to an
|
||||||
|
.I fs_disk_quota
|
||||||
|
structure (defined in
|
||||||
|
.IR <xfs/xqm.h> ).
|
||||||
|
Unprivileged users may retrieve only their own quotas;
|
||||||
|
a privileged user
|
||||||
|
.RB ( CAP_SYS_ADMIN )
|
||||||
|
may retrieve the quotas of any user.
|
||||||
|
.TP
|
||||||
|
.B Q_XSETQLIM
|
||||||
|
Set disk quota limits for user
|
||||||
|
.IR id .
|
||||||
|
The
|
||||||
|
.I addr
|
||||||
|
argument is a pointer to an
|
||||||
|
.I fs_disk_quota
|
||||||
|
structure (defined in
|
||||||
|
.IR <xfs/xqm.h> ).
|
||||||
|
This operation requires privilege
|
||||||
|
.RB ( CAP_SYS_ADMIN ).
|
||||||
|
.TP
|
||||||
|
.B Q_XGETQSTAT
|
||||||
|
Returns an
|
||||||
|
.I fs_quota_stat
|
||||||
|
structure containing XFS file system specific quota information.
|
||||||
|
This is useful for finding out how much space is used to store quota
|
||||||
|
information, and also to get quotaon/off status of a given local XFS
|
||||||
|
file system.
|
||||||
|
.TP
|
||||||
|
.B Q_XQUOTARM
|
||||||
|
Free the disk space taken by disk quotas.
|
||||||
|
Quotas must have already been turned off.
|
||||||
|
.PP
|
||||||
|
There is no command equivalent to
|
||||||
|
.B Q_SYNC
|
||||||
|
for XFS since
|
||||||
|
.BR sync (1)
|
||||||
|
writes quota information to disk (in addition to the other file system
|
||||||
|
metadata that it writes out).
|
||||||
|
.SH RETURN VALUES
|
||||||
|
.LP
|
||||||
On success,
|
On success,
|
||||||
.BR quotactl ()
|
.BR quotactl ()
|
||||||
returns 0.
|
returns 0; on error \-1
|
||||||
On error, \-1 is returned, and
|
is returned, and
|
||||||
.I errno
|
.I errno
|
||||||
is set appropriately.
|
is set to indicate the error.
|
||||||
.SH ERRORS
|
.SH ERRORS
|
||||||
.TP 0.9i
|
|
||||||
.B EACCES
|
|
||||||
The quota file is not an ordinary file.
|
|
||||||
.TP
|
|
||||||
.B EBUSY
|
|
||||||
.B Q_QUOTAON
|
|
||||||
was asked, but quotas were enabled already.
|
|
||||||
.TP
|
.TP
|
||||||
.B EFAULT
|
.B EFAULT
|
||||||
Bad
|
|
||||||
.I addr
|
.I addr
|
||||||
value.
|
or
|
||||||
|
.I special
|
||||||
|
is invalid.
|
||||||
.TP
|
.TP
|
||||||
.B EINVAL
|
.B EINVAL
|
||||||
|
.I cmd
|
||||||
|
or
|
||||||
.I type
|
.I type
|
||||||
is not a known quota type.
|
is invalid.
|
||||||
Or,
|
.TP
|
||||||
|
.B ENOENT
|
||||||
|
The file specified by
|
||||||
.I special
|
.I special
|
||||||
could not be found.
|
or
|
||||||
|
.I addr
|
||||||
|
does not exist.
|
||||||
.TP
|
.TP
|
||||||
.B EIO
|
.B ENOSYS
|
||||||
Cannot read or write the quota file.
|
The kernel has not been compiled with the
|
||||||
.TP
|
.B CONFIG_QUOTA
|
||||||
.B EMFILE
|
option.
|
||||||
Too many open files: cannot open quota file.
|
|
||||||
.TP
|
|
||||||
.B ENODEV
|
|
||||||
.I special
|
|
||||||
cannot be found in the mount table.
|
|
||||||
.TP
|
|
||||||
.B ENOPKG
|
|
||||||
The kernel was compiled without quota support.
|
|
||||||
.TP
|
.TP
|
||||||
.B ENOTBLK
|
.B ENOTBLK
|
||||||
.I special
|
.I special
|
||||||
is not a block special device.
|
is not a block device.
|
||||||
.TP
|
.TP
|
||||||
.B EPERM
|
.B EPERM
|
||||||
The process was not root (for the file system), and
|
The caller lacked the required privilege
|
||||||
.B Q_GETQUOTA
|
.RB ( CAP_SYS_ADMIN )
|
||||||
was asked for another
|
for the specified operation.
|
||||||
.I id
|
|
||||||
than that of the process itself, or anything other than
|
|
||||||
.B Q_GETSTATS
|
|
||||||
or
|
|
||||||
.B Q_SYNC
|
|
||||||
was asked.
|
|
||||||
.TP
|
.TP
|
||||||
.B ESRCH
|
.B ESRCH
|
||||||
.B Q_GETQUOTA
|
No disk quota is found for the indicated user.
|
||||||
or
|
Quotas have not been turned on for this file system.
|
||||||
.B Q_SETQUOTA
|
.LP
|
||||||
or
|
If
|
||||||
.B Q_SETUSE
|
.I cmd
|
||||||
or
|
is
|
||||||
.B Q_SETQLIM
|
.BR Q_SETQUOTA ,
|
||||||
was asked for a file system that didn't have quota enabled.
|
.BR quotactl ()
|
||||||
.SH "CONFORMING TO"
|
may also set
|
||||||
BSD.
|
.I errno
|
||||||
|
to:
|
||||||
|
.TP
|
||||||
|
.B ERANGE
|
||||||
|
Specified limits are out of range allowed by quota format.
|
||||||
|
.LP
|
||||||
|
If
|
||||||
|
.I cmd
|
||||||
|
is
|
||||||
|
.BR Q_QUOTAON ,
|
||||||
|
.BR quotactl ()
|
||||||
|
may also set
|
||||||
|
.I errno
|
||||||
|
to:
|
||||||
|
.TP
|
||||||
|
.B EACCES
|
||||||
|
The quota file pointed to by
|
||||||
|
.I addr
|
||||||
|
exists, but is not a regular file; or,
|
||||||
|
the quota file pointed to by
|
||||||
|
.I addr
|
||||||
|
exists, but is not on the file system pointed to by
|
||||||
|
.IR special .
|
||||||
|
.TP
|
||||||
|
.B EBUSY
|
||||||
|
.B Q_QUOTAON
|
||||||
|
attempted, but another
|
||||||
|
.B Q_QUOTAON
|
||||||
|
had already been performed.
|
||||||
|
.TP
|
||||||
|
.B EINVAL
|
||||||
|
The quota file is corrupted.
|
||||||
|
.TP
|
||||||
|
.B ESRCH
|
||||||
|
Specified quota format was not found.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR quota (1),
|
.BR quota (1),
|
||||||
.BR getrlimit (2),
|
.BR getrlimit (2),
|
||||||
.BR setrlimit (2),
|
|
||||||
.BR ulimit (3),
|
|
||||||
.BR quotacheck (8),
|
.BR quotacheck (8),
|
||||||
.BR quotaon (8)
|
.BR quotaon (8)
|
||||||
|
|
Loading…
Reference in New Issue