aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2016-02-07 19:22:21 -0500
committerDave Chinner <david@fromorbit.com>2016-02-07 19:22:21 -0500
commit926132c0257a5a8d149a6a395cc3405e55420566 (patch)
tree5913c59e71e12e53e4002bf0e973539af13a4f89 /include/uapi
parent8b37524962b9c54423374717786198f5c0820a28 (diff)
quota: add new quotactl Q_GETNEXTQUOTA
Q_GETNEXTQUOTA is exactly like Q_GETQUOTA, except that it will return quota information for the id equal to or greater than the id requested. In other words, if the requested id has no quota, the command will return quota information for the next higher id which does have a quota set. If no higher id has an active quota, -ESRCH is returned. This allows filesystems to do efficient iteration in kernelspace, much like extN filesystems do in userspace when asked to report all active quotas. This does require a new data structure for userspace, as the current structure does not include an ID for the returned quota information. Today, Ext4 with a hidden quota inode requires getpwent-style iterations, and for systems which have i.e. LDAP backends, this can be very slow, or even impossible if iteration is not allowed in the configuration. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/quota.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/uapi/linux/quota.h b/include/uapi/linux/quota.h
index 9c95b2c1c88a..38baddb807f5 100644
--- a/include/uapi/linux/quota.h
+++ b/include/uapi/linux/quota.h
@@ -71,6 +71,7 @@
71#define Q_SETINFO 0x800006 /* set information about quota files */ 71#define Q_SETINFO 0x800006 /* set information about quota files */
72#define Q_GETQUOTA 0x800007 /* get user quota structure */ 72#define Q_GETQUOTA 0x800007 /* get user quota structure */
73#define Q_SETQUOTA 0x800008 /* set user quota structure */ 73#define Q_SETQUOTA 0x800008 /* set user quota structure */
74#define Q_GETNEXTQUOTA 0x800009 /* get disk limits and usage >= ID */
74 75
75/* Quota format type IDs */ 76/* Quota format type IDs */
76#define QFMT_VFS_OLD 1 77#define QFMT_VFS_OLD 1
@@ -119,6 +120,19 @@ struct if_dqblk {
119 __u32 dqb_valid; 120 __u32 dqb_valid;
120}; 121};
121 122
123struct if_nextdqblk {
124 __u64 dqb_bhardlimit;
125 __u64 dqb_bsoftlimit;
126 __u64 dqb_curspace;
127 __u64 dqb_ihardlimit;
128 __u64 dqb_isoftlimit;
129 __u64 dqb_curinodes;
130 __u64 dqb_btime;
131 __u64 dqb_itime;
132 __u32 dqb_valid;
133 __u32 dqb_id;
134};
135
122/* 136/*
123 * Structure used for setting quota information about file via quotactl 137 * Structure used for setting quota information about file via quotactl
124 * Following flags are used to specify which fields are valid 138 * Following flags are used to specify which fields are valid