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>