]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_quota: wire up XFS_GETQSTATV
authorEric Sandeen <sandeen@sandeen.net>
Fri, 26 Aug 2016 01:20:28 +0000 (11:20 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 26 Aug 2016 01:20:28 +0000 (11:20 +1000)
commitbb92709f2e26c595b31d6f5dfc65e1aa120fd39b
tree1a4c0b3dab9025768680b44a25baa5d39a070cad
parent74642d8e2f514bd35715601c913e149285343808
xfs_quota: wire up XFS_GETQSTATV

The new XFS_GETQSTATV quotactl, available since kernel v3.12,
was never implemented in xfs_quota, and the "state" command
continues to use XFS_GETQSTAT, which cannot report both
group & project quota on newer formats.

The new call has room for all 3 quota types (user, group, and
quota), vs just two, where previously project and quota
overlapped.

So:

First, try XFS_GETQSTATV.
If it passes, we have all the information we need, and we print
it. state_qfilestat() is modified to take the newer structure.

If it fails, try XFS_GETQSTAT.  If that passes, we are on an
older kernel with neither XFS_GETQSTATV nor the on-disk project
quota inode.  We copy the available information into the newer
statv structure, carefully determining wither group or project
(or neither) is actually active, and print it with the same
state_qfilestat routine.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/xqm.h
quota/linux.c
quota/state.c