From patchwork Tue Feb 9 01:12:04 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: 8256751 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 63D3D9F6DA for ; Tue, 9 Feb 2016 01:12:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95E3E2027D for ; Tue, 9 Feb 2016 01:12:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A8E8520272 for ; Tue, 9 Feb 2016 01:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932732AbcBIBMQ (ORCPT ); Mon, 8 Feb 2016 20:12:16 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:23251 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932359AbcBIBMP (ORCPT ); Mon, 8 Feb 2016 20:12:15 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u191C6MA014647 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Feb 2016 01:12:07 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u191C66P014127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 9 Feb 2016 01:12:06 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u191C64F023013; Tue, 9 Feb 2016 01:12:06 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Feb 2016 17:12:06 -0800 Subject: [PATCH 03/23] 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: Mon, 08 Feb 2016 17:12:04 -0800 Message-ID: <20160209011204.23099.75138.stgit@birch.djwong.org> In-Reply-To: <20160209011145.23099.95354.stgit@birch.djwong.org> References: <20160209011145.23099.95354.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: userv0021.oracle.com [156.151.31.71] 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.2 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 f08cb3a..863d4b3 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 -}