From patchwork Thu May 18 03:38:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9732425 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 B9F966020B for ; Thu, 18 May 2017 03:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B38C28800 for ; Thu, 18 May 2017 03:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9052E28802; Thu, 18 May 2017 03:39:40 +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=ham 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 4A0DB28800 for ; Thu, 18 May 2017 03:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932229AbdERDjh (ORCPT ); Wed, 17 May 2017 23:39:37 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:43366 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932209AbdERDj3 (ORCPT ); Wed, 17 May 2017 23:39:29 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="18996780" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 18 May 2017 11:39:22 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 8F82A47C6105; Thu, 18 May 2017 11:39:17 +0800 (CST) Received: from localhost.localdomain (10.167.226.34) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 18 May 2017 11:39:16 +0800 From: Qu Wenruo To: , Subject: [PATCH 28/32] btrfs-progs: Refactor sectorsize users in cmds-inspect-dump-tree.c Date: Thu, 18 May 2017 11:38:53 +0800 Message-ID: <20170518033857.15002-29-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170518033857.15002-1-quwenruo@cn.fujitsu.com> References: <20170518033857.15002-1-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.34] X-yoursite-MailScanner-ID: 8F82A47C6105.AF490 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@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 Signed-off-by: Qu Wenruo --- cmds-inspect-dump-tree.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c index 5a5ca536..869ad6ba 100644 --- a/cmds-inspect-dump-tree.c +++ b/cmds-inspect-dump-tree.c @@ -49,7 +49,7 @@ static void print_extents(struct btrfs_root *root, struct extent_buffer *eb) return; } - size = root->nodesize; + size = root->fs_info->nodesize; nr = btrfs_header_nritems(eb); for (i = 0; i < nr; i++) { next = read_tree_block(root, btrfs_node_blockptr(eb, i), @@ -313,7 +313,7 @@ int cmd_inspect_dump_tree(int argc, char **argv) if (block_only) { leaf = read_tree_block(root, block_only, - root->nodesize, 0); + info->nodesize, 0); if (extent_buffer_uptodate(leaf) && btrfs_header_level(leaf) != 0) { @@ -324,7 +324,7 @@ int cmd_inspect_dump_tree(int argc, char **argv) if (!leaf) { leaf = read_tree_block(root, block_only, - root->nodesize, 0); + info->nodesize, 0); } if (!extent_buffer_uptodate(leaf)) { error("failed to read %llu", @@ -441,8 +441,7 @@ again: read_extent_buffer(leaf, &ri, offset, sizeof(ri)); buf = read_tree_block(tree_root_scan, btrfs_root_bytenr(&ri), - tree_root_scan->nodesize, - 0); + info->nodesize, 0); if (!extent_buffer_uptodate(buf)) goto next; if (tree_id && found_key.objectid != tree_id) {