From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com ([134.134.136.20]:56448 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759214AbdKQU2g (ORCPT ); Fri, 17 Nov 2017 15:28:36 -0500 From: Ross Zwisler Subject: [fstests PATCH v4 1/4] common/rc: add _scratch_has_mount_option() Date: Fri, 17 Nov 2017 13:28:25 -0700 Message-Id: <20171117202828.25472-2-ross.zwisler@linux.intel.com> In-Reply-To: <20171117202828.25472-1-ross.zwisler@linux.intel.com> References: <20171117202828.25472-1-ross.zwisler@linux.intel.com> Sender: fstests-owner@vger.kernel.org To: fstests Cc: Ross Zwisler , linux-xfs , linux-nvdimm , Jan Kara , Dave Chinner , Dan Williams , Amir Goldstein List-ID: Allow tests to inquire about whether a mount option is set, rather than just disallowing it via _exclude_scratch_mount_option(). Signed-off-by: Ross Zwisler Suggested-by: Amir Goldstein --- common/rc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/rc b/common/rc index 0cda9da..701b1ff 100644 --- a/common/rc +++ b/common/rc @@ -3105,6 +3105,16 @@ _exclude_scratch_mount_option() done } +_scratch_has_mount_option() +{ + local mnt_opts=$(_normalize_mount_options) + + if echo $mnt_opts | grep -qw "$1"; then + return 0 + fi + return 1 +} + _require_atime() { _exclude_scratch_mount_option "noatime" -- 2.9.5