All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Eryu Guan <guan@eryu.me>,
	fstests@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Cc: "Darrick J . Wong" <djwong@kernel.org>,
	David Howells <dhowells@redhat.com>,
	Christian Brauner <christian.brauner@ubuntu.com>
Subject: [PATCH v12 4/6] common/quota: move _qsetup() helper to common code
Date: Mon, 29 Mar 2021 00:33:58 +0200	[thread overview]
Message-ID: <20210328223400.1800301-5-brauner@kernel.org> (raw)
In-Reply-To: <20210328223400.1800301-1-brauner@kernel.org>

From: Christian Brauner <christian.brauner@ubuntu.com>

It's already used in two tests and will be used in a third.

Cc: Eryu Guan <guan@eryu.me>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: fstests@vger.kernel.org
Suggested-by: Eryu Guan <guan@eryu.me>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
---
/* v1 - v9 */
patch not present

/* v10 */
patch introduced

/* v11 */
unchanged

/* v12 */
unchanged
---
 common/quota  | 20 ++++++++++++++++++++
 tests/xfs/050 | 19 -------------------
 tests/xfs/299 | 19 -------------------
 3 files changed, 20 insertions(+), 38 deletions(-)

diff --git a/common/quota b/common/quota
index 1437d5f7..32a9a555 100644
--- a/common/quota
+++ b/common/quota
@@ -329,5 +329,25 @@ _report_quota_inodes() {
 	repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}' | sort -r
 }
 
+# Determine which type of quota we're using
+_qsetup()
+{
+	opt=$1
+	enforce=0
+	if [ $opt = "u" -o $opt = "uno" ]; then
+		type=u
+		eval `_choose_uid`
+	elif [ $opt = "g" -o $opt = "gno" ]; then
+		type=g
+		eval `_choose_gid`
+	elif [ $opt = "p" -o $opt = "pno" ]; then
+		type=p
+		eval `_choose_prid`
+	fi
+	[ $opt = "u" -o $opt = "g" -o $opt = "p" ] && enforce=1
+
+	echo "Using type=$type id=$id" >> $seqres.full
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/tests/xfs/050 b/tests/xfs/050
index 1df97537..e7c81d0a 100755
--- a/tests/xfs/050
+++ b/tests/xfs/050
@@ -69,25 +69,6 @@ _filter_and_check_blks()
 	' | _filter_quota_report
 }
 
-_qsetup()
-{
-	opt=$1
-	enforce=0
-	if [ $opt = "u" -o $opt = "uno" ]; then
-		type=u
-		eval `_choose_uid`
-	elif [ $opt = "g" -o $opt = "gno" ]; then
-		type=g
-		eval `_choose_gid`
-	elif [ $opt = "p" -o $opt = "pno" ]; then
-		type=p
-		eval `_choose_prid`
-	fi
-	[ $opt = "u" -o $opt = "g" -o $opt = "p" ] && enforce=1
-
-	echo "Using type=$type id=$id" >> $seqres.full
-}
-
 _exercise()
 {
 	_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
diff --git a/tests/xfs/299 b/tests/xfs/299
index b862e67e..26b7fcfd 100755
--- a/tests/xfs/299
+++ b/tests/xfs/299
@@ -62,25 +62,6 @@ _filter_and_check_blks()
 	' | _filter_quota_report
 }
 
-_qsetup()
-{
-	opt=$1
-	enforce=0
-	if [ $opt = "u" -o $opt = "uno" ]; then
-		type=u
-		eval `_choose_uid`
-	elif [ $opt = "g" -o $opt = "gno" ]; then
-		type=g
-		eval `_choose_gid`
-	elif [ $opt = "p" -o $opt = "pno" ]; then
-		type=p
-		eval `_choose_prid`
-	fi
-	[ $opt = "u" -o $opt = "g" -o $opt = "p" ] && enforce=1
-
-	echo "Using type=$type id=$id" >> $seqres.full
-}
-
 _exercise()
 {
 
-- 
2.27.0


  parent reply	other threads:[~2021-03-28 22:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 22:33 [PATCH v12 0/6] fstests: add idmapped mounts tests Christian Brauner
2021-03-28 22:33 ` [PATCH v12 1/6] generic/631: add test for detached mount propagation Christian Brauner
2021-03-28 22:33 ` [PATCH v12 3/6] common/rc: add _scratch_{u}mount_idmapped() helpers Christian Brauner
2021-03-28 22:33 ` Christian Brauner [this message]
2021-03-28 22:33 ` [PATCH v12 5/6] xfs/529: quotas and idmapped mounts Christian Brauner
2021-03-28 22:34 ` [PATCH v12 6/6] xfs/530: quotas on " Christian Brauner
     [not found] ` <20210328223400.1800301-3-brauner@kernel.org>
2021-04-11 14:30   ` [PATCH v12 2/6] generic/632: add fstests for " Eryu Guan
2021-04-11 15:12     ` Christian Brauner
2021-04-11 15:18       ` Christian Brauner
2021-04-11 15:21         ` Eryu Guan
2021-04-11 15:32           ` Christian Brauner
2021-04-12  0:40             ` Theodore Ts'o
2021-04-12 11:54               ` Christian Brauner
2021-04-12 22:41                 ` Theodore Ts'o
2021-04-14 20:47                   ` [PATCH -RFC] ext4: add feature file to advertise that ext4 supports " Theodore Ts'o
2021-04-15  5:54                     ` Christoph Hellwig
2021-04-15  7:49                       ` Christian Brauner
2021-04-15  7:55                         ` Christoph Hellwig
2021-04-15  8:13                           ` Christian Brauner
2021-04-15 14:59                         ` Theodore Ts'o
2021-04-12  7:22             ` [PATCH v12 2/6] generic/632: add fstests for " Christoph Hellwig
2021-04-12  7:30               ` Christian Brauner
2021-04-11 15:19       ` Eryu Guan
2021-04-11 14:37 ` [PATCH v12 0/6] fstests: add idmapped mounts tests Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210328223400.1800301-5-brauner@kernel.org \
    --to=brauner@kernel.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=dhowells@redhat.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=hch@lst.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.