[PATCH 2/2] common: add _require_getnextquota helper

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



Add a helper to determine if the kernel supports
the GETNEXTQUOTA quotactl.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/common/quota b/common/quota
index d9bb8d9..d4ae861 100644
--- a/common/quota
+++ b/common/quota
@@ -109,6 +109,16 @@ _require_prjquota()
 }
 
 #
+# 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 ...
 _scratch_enable_pquota()
diff --git a/tests/generic/244 b/tests/generic/244
index 36c632e..0c64330 100755
--- a/tests/generic/244
+++ b/tests/generic/244
@@ -59,10 +59,7 @@ _scratch_mkfs >> $seqres.full 2>&1
 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"
 
diff --git a/tests/generic/395 b/tests/generic/395
index cc4a93e..151229d 100755
--- a/tests/generic/395
+++ b/tests/generic/395
@@ -57,12 +57,8 @@ _require_scratch
 _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"
 

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux