From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
linux-unionfs@vger.kernel.org, fstests@vger.kernel.org
Subject: [PATCH v2 1/4] common/rc: factor out _require_scratch_fs_option
Date: Wed, 25 Apr 2018 23:53:24 -0600 [thread overview]
Message-ID: <1524722007-30891-2-git-send-email-amir73il@gmail.com> (raw)
In-Reply-To: <1524722007-30891-1-git-send-email-amir73il@gmail.com>
Factor out _require_scratch_fs_option and _check_scratch_fs_option
from the helper _require_scratch_dax.
Those are generic helpers to test if mount option is supported and
if mount option was enabled.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
common/rc | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/common/rc b/common/rc
index 366489b..78bc59d 100644
--- a/common/rc
+++ b/common/rc
@@ -3036,20 +3036,35 @@ _require_scratch_shutdown()
_scratch_unmount
}
-# Does dax mount option work on this dev/fs?
-_require_scratch_dax()
+_check_scratch_fs_option()
+{
+ local opt=$1
+
+ _fs_options $SCRATCH_DEV | grep -qw "$opt"
+}
+
+# Does mount option work on this dev/fs?
+_require_scratch_fs_option()
{
+ local opt=$1
+
_require_scratch
_scratch_mkfs > /dev/null 2>&1
- _try_scratch_mount -o dax || \
- _notrun "mount $SCRATCH_DEV with dax failed"
- # Check options to be sure. XFS ignores dax option
+ _try_scratch_mount -o "$opt" || \
+ _notrun "mount $SCRATCH_DEV with $opt failed"
+ # Check options to be sure. For example, XFS ignores dax option
# and goes on if dev underneath does not support dax.
- _fs_options $SCRATCH_DEV | grep -qw "dax" || \
- _notrun "$SCRATCH_DEV $FSTYP does not support -o dax"
+ _check_scratch_fs_option "$opt" || \
+ _notrun "$SCRATCH_DEV $FSTYP does not support -o $opt"
_scratch_unmount
}
+# Does dax mount option work on this dev/fs?
+_require_scratch_dax()
+{
+ _require_scratch_fs_option "dax"
+}
+
# Does norecovery support by this fs?
_require_norecovery()
{
--
2.7.4
next prev parent reply other threads:[~2018-04-26 5:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 5:53 [PATCH v2 0/4] Fix failing overlay nonsamefs fstests Amir Goldstein
2018-04-26 5:53 ` Amir Goldstein [this message]
2018-04-26 5:53 ` [PATCH v2 2/4] overlay/041: fix call to _overlay_check_scratch_dirs Amir Goldstein
2018-04-26 5:53 ` [PATCH v2 3/4] overlay/043: require and enable redirect_dir Amir Goldstein
2018-04-26 5:53 ` [PATCH v2 4/4] overlay/04{1,3,4}: enable xino feature Amir Goldstein
2018-04-27 2:43 ` Eryu Guan
2018-04-27 2:31 ` [PATCH v2 0/4] Fix failing overlay nonsamefs fstests 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=1524722007-30891-2-git-send-email-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox