From patchwork Thu Jul 23 09:18:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 6851881 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 B69AA9F1D4 for ; Thu, 23 Jul 2015 09:18:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D070720651 for ; Thu, 23 Jul 2015 09:18:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D56C220772 for ; Thu, 23 Jul 2015 09:18:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836AbbGWJSZ (ORCPT ); Thu, 23 Jul 2015 05:18:25 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:29728 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752208AbbGWJSX (ORCPT ); Thu, 23 Jul 2015 05:18:23 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="98767475" Received: from bogon (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 23 Jul 2015 17:21:52 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t6N9GOwP025116; Thu, 23 Jul 2015 17:16:24 +0800 Received: from localhost.localdomain (10.167.226.33) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 23 Jul 2015 17:18:12 +0800 From: Qu Wenruo To: CC: Subject: [PATCH 1/4] btrfs: print-tree: print stripe len of a chunk Date: Thu, 23 Jul 2015 17:18:07 +0800 Message-ID: <1437643090-13920-2-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1437643090-13920-1-git-send-email-quwenruo@cn.fujitsu.com> References: <1437643090-13920-1-git-send-email-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.33] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Although it is fixed to BTRFS_STRIPE_LEN(64K) now, it's still used in a lot of codes, just output it for user who want to trace the source of stripe_len in btrfs_map_bio() codes. Reported-by: Chris Murphy Reported-by: Zhao Lei Signed-off-by: Zhao Lei Signed-off-by: Qu Wenruo --- print-tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/print-tree.c b/print-tree.c index a72a979..dc1d276 100644 --- a/print-tree.c +++ b/print-tree.c @@ -224,9 +224,11 @@ void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk) char chunk_flags_str[32] = {0}; bg_flags_to_str(btrfs_chunk_type(eb, chunk), chunk_flags_str); - printf("\t\tchunk length %llu owner %llu type %s num_stripes %d\n", + printf("\t\tchunk length %llu owner %llu stripe_len %llu\n", (unsigned long long)btrfs_chunk_length(eb, chunk), (unsigned long long)btrfs_chunk_owner(eb, chunk), + (unsigned long long)btrfs_chunk_stripe_len(eb, chunk)); + printf("\t\ttype %s num_stripes %d\n", chunk_flags_str, num_stripes); for (i = 0 ; i < num_stripes ; i++) { printf("\t\t\tstripe %d devid %llu offset %llu\n", i,