Add a helper to determine if the kernel supports
the GETNEXTQUOTA quotactl.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
fi
}
+#
+# Do we have GETNEXTQUOTA? Querying ID 0 should work.
+#
+_require_getnextquota()
+{
+ _require_test_program "test-nextquota"
+ $here/src/test-nextquota -i 0 -u -d $SCRATCH_DEV &> $seqres.full || \
+ _notrun "No GETNEXTQUOTA support"
+}
+
#
# ext4 (for now) is unique in that we must enable the project quota feature
# prior to mount. This is a relatively new feature ...
TYPES="u g"
MOUNT_OPTIONS="-o usrquota,grpquota"
_qmount
-
-# Ok, do we even have GETNEXTQUOTA? Querying ID 0 should work.
-$here/src/test-nextquota -i 0 -u -d $SCRATCH_DEV &> $seqres.full || \
- _notrun "No GETNEXTQUOTA support"
+_require_getnextquota
echo "Launch all quotas"
_scratch_mkfs >> $seqres.full 2>&1
MOUNT_OPTIONS="-o usrquota,grpquota"
-
_qmount
-
-# Ok, do we even have GETNEXTQUOTA? Querying ID 0 should work.
-$here/src/test-nextquota -i 0 -u -d $SCRATCH_DEV &> $seqres.full || \
- _notrun "No GETNEXTQUOTA support"
+_require_getnextquota
echo "Launch all quotas"