From patchwork Wed Nov 2 04:07:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaoguang Wang X-Patchwork-Id: 9408447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D16F601C2 for ; Wed, 2 Nov 2016 04:14:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D18D29DCC for ; Wed, 2 Nov 2016 04:14:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40FB729DCE; Wed, 2 Nov 2016 04:14:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA37A29DCC for ; Wed, 2 Nov 2016 04:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750957AbcKBEOQ (ORCPT ); Wed, 2 Nov 2016 00:14:16 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:51022 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750698AbcKBEOQ (ORCPT ); Wed, 2 Nov 2016 00:14:16 -0400 X-IronPort-AV: E=Sophos;i="5.20,367,1444665600"; d="scan'208";a="940482" Received: from unknown (HELO cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 02 Nov 2016 12:14:02 +0800 Received: from localhost.localdomain (unknown [10.167.226.107]) by cn.fujitsu.com (Postfix) with ESMTP id DF3EB4010D17; Wed, 2 Nov 2016 12:14:01 +0800 (CST) From: Wang Xiaoguang To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, eguan@redhat.com, darrick.wong@oracle.com Subject: [PATCH v5 1/2] common/populate: use _require_xfs_io_command() in right place Date: Wed, 2 Nov 2016 12:07:26 +0800 Message-Id: <20161102040727.5765-1-wangxg.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-yoursite-MailScanner-ID: DF3EB4010D17.A3E48 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: wangxg.fnst@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In original common/populate codes, we put _require_xfs_io_command "falloc" and _require_xfs_io_command "fpunch" in the begin of common/populate, but it's not appropriate, for fs, which does not support falloc and punch, will not be able to use other helper functions in common/populate, so here I choose to put _require_xfs_io_command "falloc" or "punch" in helper function which really use falloc and fpunch. And xfs/120 uses fpunch, add _require_xfs_io_command "fpunch". Signed-off-by: Wang Xiaoguang --- common/populate | 7 ++++--- tests/xfs/120 | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/populate b/common/populate index d0003c5..3b9b531 100644 --- a/common/populate +++ b/common/populate @@ -22,9 +22,6 @@ # Mountain View, CA 94043, USA, or: http://www.sgi.com #----------------------------------------------------------------------- -_require_xfs_io_command "falloc" -_require_xfs_io_command "fpunch" - _require_xfs_db_blocktrash_z_command() { test "${FSTYP}" = "xfs" || _notrun "cannot run xfs_db on ${FSTYP}" $XFS_DB_PROG -x -f -c 'blocktrash -z' "${TEST_DEV}" | grep -q 'nothing on stack' || _notrun "blocktrash -z not supported" @@ -90,6 +87,8 @@ __populate_fill_fs() { # types of metadata block _scratch_xfs_populate() { _scratch_mount + _require_xfs_io_command "fpunch" + blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")" dblksz="$(xfs_info "${SCRATCH_MNT}" | grep naming.*bsize | sed -e 's/^.*bsize=//g' -e 's/\([0-9]*\).*$/\1/g')" leaf_lblk="$((32 * 1073741824 / blksz))" @@ -192,6 +191,8 @@ _scratch_xfs_populate() { # types of metadata block _scratch_ext4_populate() { _scratch_mount + _require_xfs_io_command "fpunch" + blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")" dblksz="${blksz}" leaf_lblk="$((32 * 1073741824 / blksz))" diff --git a/tests/xfs/120 b/tests/xfs/120 index 3deece6..631e2f2 100755 --- a/tests/xfs/120 +++ b/tests/xfs/120 @@ -47,6 +47,7 @@ _cleanup() _supported_fs xfs _supported_os Linux +_require_xfs_io_command "fpunch" _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_xfs_crc _require_attrs