From patchwork Thu Sep 18 04:22:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 4928891 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6B41FBEEA5 for ; Thu, 18 Sep 2014 04:22:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94736201EC for ; Thu, 18 Sep 2014 04:22:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5199201CE for ; Thu, 18 Sep 2014 04:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751388AbaIREWX (ORCPT ); Thu, 18 Sep 2014 00:22:23 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:45385 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751188AbaIREWV (ORCPT ); Thu, 18 Sep 2014 00:22:21 -0400 X-IronPort-AV: E=Sophos;i="5.04,544,1406563200"; d="scan'208";a="36113078" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 18 Sep 2014 12:19:20 +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 s8I4MQKk012944 for ; Thu, 18 Sep 2014 12:22:26 +0800 Received: from adam-work.lan (10.167.226.33) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 18 Sep 2014 12:22:19 +0800 From: Qu Wenruo To: Subject: [PATCH 2/3] btrfs-progs: Add data_offset and data_len output for print_file_extent_item Date: Thu, 18 Sep 2014 12:22:17 +0800 Message-ID: <1411014138-20124-2-git-send-email-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411014138-20124-1-git-send-email-quwenruo@cn.fujitsu.com> References: <1411014138-20124-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=-7.6 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 Add data_offset and data_len output for print_file_extent_item in print-tree.c WARNING: because the original output has word 'data' before 'offset', to avoid confusion, remove the work 'data' before 'offset' and 'disk bytenr'. Signed-off-by: Qu Wenruo --- print-tree.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/print-tree.c b/print-tree.c index 7df5798..9b416bd 100644 --- a/print-tree.c +++ b/print-tree.c @@ -277,23 +277,29 @@ static void print_file_extent_item(struct extent_buffer *eb, return; } if (extent_type == BTRFS_FILE_EXTENT_PREALLOC) { - printf("\t\tprealloc data disk byte %llu nr %llu\n", + printf("\t\tprealloc disk byte %llu nr %llu\n", (unsigned long long)btrfs_file_extent_disk_bytenr(eb, fi), (unsigned long long)btrfs_file_extent_disk_num_bytes(eb, fi)); - printf("\t\tprealloc data offset %llu nr %llu\n", + printf("\t\tprealloc offset %llu nr %llu\n", (unsigned long long)btrfs_file_extent_offset(eb, fi), (unsigned long long)btrfs_file_extent_num_bytes(eb, fi)); return; } - printf("\t\textent data disk byte %llu nr %llu\n", + printf("\t\textent disk byte %llu nr %llu\n", (unsigned long long)btrfs_file_extent_disk_bytenr(eb, fi), (unsigned long long)btrfs_file_extent_disk_num_bytes(eb, fi)); - printf("\t\textent data offset %llu nr %llu ram %llu\n", + printf("\t\textent offset %llu nr %llu ram %llu\n", (unsigned long long)btrfs_file_extent_offset(eb, fi), (unsigned long long)btrfs_file_extent_num_bytes(eb, fi), (unsigned long long)btrfs_file_extent_ram_bytes(eb, fi)); printf("\t\textent compression %d\n", btrfs_file_extent_compression(eb, fi)); + if (btrfs_item_size_nr(eb, slot) > sizeof(*fi)) + printf("\t\tdata offset %llu nr %llu\n", + (unsigned long long) + btrfs_ondemand_file_extent_data_offset(eb, slot, fi), + (unsigned long long) + btrfs_ondemand_file_extent_data_len(eb, slot, fi)); } /* Caller should ensure sizeof(*ret) >= 16("DATA|TREE_BLOCK") */