]> git.baikalelectronics.ru Git - kernel.git/commit
quota: add new quotactl Q_GETNEXTQUOTA
authorEric Sandeen <sandeen@redhat.com>
Mon, 8 Feb 2016 00:22:21 +0000 (11:22 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 8 Feb 2016 00:22:21 +0000 (11:22 +1100)
commit69e1004f2eee07e0acfe1ab7f835d4354704b0b0
tree5913c59e71e12e53e4002bf0e973539af13a4f89
parentd1ea4ac2a228bc390bb06f88988683a1bf1291d9
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>
fs/quota/quota.c
include/uapi/linux/quota.h