linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
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	[thread overview]
Message-ID: <1411014138-20124-2-git-send-email-quwenruo@cn.fujitsu.com> (raw)
In-Reply-To: <1411014138-20124-1-git-send-email-quwenruo@cn.fujitsu.com>

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 <quwenruo@cn.fujitsu.com>
---
 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") */
-- 
2.1.0


  reply	other threads:[~2014-09-18  4:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  4:22 [PATCH 1/3] btrfs-progs: Add nocow compressed write into prealloc support Qu Wenruo
2014-09-18  4:22 ` Qu Wenruo [this message]
2014-09-18  4:22 ` [PATCH 3/3] btrfs: Add btrfsck support for nocow compressed prealloc write Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411014138-20124-2-git-send-email-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).