From patchwork Thu Feb 11 23:39:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 8286581 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 90CCDBEEE5 for ; Thu, 11 Feb 2016 23:57:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A16B920380 for ; Thu, 11 Feb 2016 23:57:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE8C520364 for ; Thu, 11 Feb 2016 23:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751160AbcBKXkj (ORCPT ); Thu, 11 Feb 2016 18:40:39 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:19577 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbcBKXjq (ORCPT ); Thu, 11 Feb 2016 18:39:46 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1BNdep9031586 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:39:41 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdelQ022852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:39:40 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNdc2s005839; Thu, 11 Feb 2016 23:39:38 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:39:37 -0800 Subject: [PATCH 03/32] xfstests: make _scratch_mkfs_blocksized usable From: "Darrick J. Wong" To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, Christoph Hellwig , fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 11 Feb 2016 15:39:36 -0800 Message-ID: <20160211233936.2202.96907.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The default mkfs.xfs options contain -b size=4096, so all tests using _scratch_mkfs_blocksized won't actually run unless those options are changed. As we're trying to specificly test 1k blocks we should always override the default option. v2: Move the function to common/rc Signed-off-by: Christoph Hellwig [darrick.wong@oracle.com: move function to common/rc] Signed-off-by: Darrick J. Wong --- common/rc | 24 ++++++++++++++++++++++++ common/reflink | 30 ------------------------------ 2 files changed, 24 insertions(+), 30 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/rc b/common/rc index b742785..84f794a 100644 --- a/common/rc +++ b/common/rc @@ -881,6 +881,30 @@ _scratch_mkfs_geom() _scratch_mkfs } +# Create fs of certain blocksize on scratch device +# _scratch_mkfs_blocksized blocksize +_scratch_mkfs_blocksized() +{ + blocksize=$1 + + re='^[0-9]+$' + if ! [[ $blocksize =~ $re ]] ; then + _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." + fi + + case $FSTYP in + xfs) + _scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize + ;; + ext2|ext3|ext4|ocfs2) + ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV + ;; + *) + _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" + ;; + esac +} + _scratch_resvblks() { case $FSTYP in diff --git a/common/reflink b/common/reflink index 8638aba..3d6a8c1 100644 --- a/common/reflink +++ b/common/reflink @@ -187,33 +187,3 @@ _dedupe_range() { "$XFS_IO_PROG" $xfs_io_args -f -c "dedupe $file1 $offset1 $offset2 $len" "$file2" } - -# Create fs of certain blocksize on scratch device -# _scratch_mkfs_blocksized blocksize -_scratch_mkfs_blocksized() -{ - blocksize=$1 - - re='^[0-9]+$' - if ! [[ $blocksize =~ $re ]] ; then - _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer." - fi - - case $FSTYP in - xfs) - # don't override MKFS_OPTIONS that set a block size. - echo $MKFS_OPTIONS |egrep -q "b?size=" - if [ $? -eq 0 ]; then - _scratch_mkfs_xfs - else - _scratch_mkfs_xfs -b size=$blocksize - fi - ;; - ext2|ext3|ext4|ocfs2) - ${MKFS_PROG}.$FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV - ;; - *) - _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_blocksized" - ;; - esac -}