From patchwork Wed Oct 8 10:35:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 5051021 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 60B499F30B for ; Wed, 8 Oct 2014 02:36:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C1D920204 for ; Wed, 8 Oct 2014 02:36:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC4B5201F2 for ; Wed, 8 Oct 2014 02:36:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbaJHCgL (ORCPT ); Tue, 7 Oct 2014 22:36:11 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:64059 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbaJHCgK (ORCPT ); Tue, 7 Oct 2014 22:36:10 -0400 Received: by mail-pd0-f179.google.com with SMTP id r10so5994437pdi.24 for ; Tue, 07 Oct 2014 19:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gxpH6suwz3yRf8g9xsSfg37zbuLPC/rzkj1YmWZ30/E=; b=LXJEMsM+781ORzk3GMINzd7ayAqdLGNOfvJLbTCjVIIYAHEuWpMZSpbhBQQo/ZDjTE K3a07/WehGrsl5FwaqxzR/+qxwr6QIKLiCHxyA/N1Gpqe1kqq/C9Cd2490wCHE1K7KM3 jvxqU8lmS/qvOitkhHuD+4YQBnJoZ94qDKINDCUVOpu8rzmmU4dfVAzjG4faqXvHErDm 2XD3ly6gw1rglRjX0PFdZzDU2D0NcFCzDoeGBO5dpjsLwPk1onehKhChr+NP6iaRpECf gVk9WXyhgMK4STAdwVS6uCW/B9/BFm/T3wZAiPQLvYUi28FEQ41TmJ50mOUbiyPkyTmj NJhw== X-Received: by 10.70.53.73 with SMTP id z9mr142058pdo.154.1412735769807; Tue, 07 Oct 2014 19:36:09 -0700 (PDT) Received: from vm01.localdomain ([221.181.146.136]) by mx.google.com with ESMTPSA id iq3sm17070313pbb.71.2014.10.07.19.36.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Oct 2014 19:36:09 -0700 (PDT) From: Wang Shilong To: fstests@vger.kernel.org Cc: david@fromorbit.com, linux-btrfs@vger.kernel.org Subject: [PATCH 1/2] xfstests,btrfs/010: use _extent_count() helper Date: Wed, 8 Oct 2014 06:35:21 -0400 Message-Id: <1412764522-15754-1-git-send-email-wangshilong1991@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 cleanup to swith _extent_count(), this way we remove a dependence on filefrag. Signed-off-by: Wang Shilong --- tests/btrfs/010 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 tests/btrfs/010 diff --git a/tests/btrfs/010 b/tests/btrfs/010 old mode 100755 new mode 100644 index 371f1b8..6cfc561 --- a/tests/btrfs/010 +++ b/tests/btrfs/010 @@ -40,6 +40,7 @@ _cleanup() # get standard environment, filters and checks . ./common/rc . ./common/filter +. ./common/defrag # real QA test starts here @@ -47,7 +48,6 @@ _cleanup() _supported_fs btrfs _supported_os Linux _require_scratch -_require_command "/usr/sbin/filefrag" rm -f $seqres.full @@ -71,9 +71,9 @@ done $BTRFS_UTIL_PROG filesystem defrag $subvol/foobar && sync -num_extent_orig=`filefrag $subvol/foobar | awk -F ' ' '{print $2}'` -num_extent_snap1=`filefrag $SCRATCH_MNT/snap-1/foobar | awk -F ' ' '{print $2}'` -num_extent_snap2=`filefrag $SCRATCH_MNT/snap-2/foobar | awk -F ' ' '{print $2}'` +num_extent_orig=`_extent_count $subvol/foobar` +num_extent_snap1=`_extent_count $SCRATCH_MNT/snap-1/foobar` +num_extent_snap2=`_extent_count $SCRATCH_MNT/snap-2/foobar` echo "$num_extent_orig $num_extent_snap1 $num_extent_snap2" >> $seqres.full