diff mbox

[8/9,v5] common/quota: give quota mount option per filesystem

Message ID 1423204633-66673-9-git-send-email-jaegeuk@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Jaegeuk Kim Feb. 6, 2015, 6:37 a.m. UTC
This patch add _get_quota_option to assign the mount option selectively
in:

  tests/xfs/087

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 common/quota  | 15 +++++++++++++++
 tests/xfs/087 |  7 ++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

Comments

Dave Chinner Feb. 10, 2015, 6:01 a.m. UTC | #1
On Thu, Feb 05, 2015 at 10:37:12PM -0800, Jaegeuk Kim wrote:
> This patch add _get_quota_option to assign the mount option selectively
> in:
> 
>   tests/xfs/087
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  common/quota  | 15 +++++++++++++++
>  tests/xfs/087 |  7 ++++---
>  2 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/common/quota b/common/quota
> index b320cf2..a103826 100644
> --- a/common/quota
> +++ b/common/quota
> @@ -78,6 +78,21 @@ _require_xfs_quota()
>  }
>  
>  #
> +# give quota option accoring to the filesystems.
> +#
> +_get_quota_option()
> +{
> +    case $FSTYP in
> +    xfs)
> +        _require_xfs_quota
> +        echo "-o uquota"
> +        ;;
> +    *)
> +        ;;
> +    esac
> +}

Looking at this, it's pretty specific to the test, so it's probably
best just to leave it as a helper function in the test itself.

Otherwise look s good.

Cheers,

Dave.
diff mbox

Patch

diff --git a/common/quota b/common/quota
index b320cf2..a103826 100644
--- a/common/quota
+++ b/common/quota
@@ -78,6 +78,21 @@  _require_xfs_quota()
 }
 
 #
+# give quota option accoring to the filesystems.
+#
+_get_quota_option()
+{
+    case $FSTYP in
+    xfs)
+        _require_xfs_quota
+        echo "-o uquota"
+        ;;
+    *)
+        ;;
+    esac
+}
+
+#
 # checks that the XFS project quota support in the kernel is enabled.
 #
 _require_prjquota()
diff --git a/tests/xfs/087 b/tests/xfs/087
index 8da0f9c..2fd6f1a 100755
--- a/tests/xfs/087
+++ b/tests/xfs/087
@@ -62,7 +62,8 @@  _require_scratch
 _require_scratch_shutdown
 _require_logstate
 _require_v2log 
-_require_xfs_quota
+
+QUOTA_OPTION=`_get_quota_option`
 
 echo "*** init FS"
 umount $SCRATCH_DEV >/dev/null 2>&1
@@ -90,7 +91,7 @@  do
 
     # mount the FS
     _echofull "mount"
-    if ! _scratch_mount -o uquota >>$seqres.full 2>&1; then
+    if ! _scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1; then
 	_echofull "mount failed: $MOUNT_OPTIONS"
 	continue
     fi
@@ -116,7 +117,7 @@  do
     _scratch_xfs_logprint -n >>$seqres.full 2>&1
 
     _echofull "mount with replay"
-    _scratch_mount -o uquota >>$seqres.full 2>&1 \
+    _scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1 \
 	|| _fail "mount failed: $MOUNT_OPTIONS"
 
     # check on what FS looks like after log recovery