All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Block <ablock84@googlemail.com>
To: linux-btrfs@vger.kernel.org
Cc: Alexander Block <ablock84@googlemail.com>
Subject: [RFC PATCH 3/6] Btrfs-progs: print inode transid and dir item data field in debug-tree
Date: Wed,  4 Jul 2012 15:39:31 +0200	[thread overview]
Message-ID: <1341409174-13619-4-git-send-email-ablock84@googlemail.com> (raw)
In-Reply-To: <1341409174-13619-1-git-send-email-ablock84@googlemail.com>

Add printing of inode transid and dir item data field.

Signed-off-by: Alexander Block <ablock84@googlemail.com>
---
 print-tree.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/print-tree.c b/print-tree.c
index fc134c0..1377732 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -48,6 +48,12 @@ static int print_dir_item(struct extent_buffer *eb, struct btrfs_item *item,
 		read_extent_buffer(eb, namebuf, (unsigned long)(di + 1), len);
 		printf("\t\tnamelen %u datalen %u name: %.*s\n",
 		       name_len, data_len, len, namebuf);
+		if (data_len) {
+			len = (data_len <= sizeof(namebuf))? data_len: sizeof(namebuf);
+			read_extent_buffer(eb, namebuf,
+				(unsigned long)(di + 1) + name_len, len);
+			printf("\t\tdata %.*s\n", len, namebuf);
+		}
 		len = sizeof(*di) + name_len + data_len;
 		di = (struct btrfs_dir_item *)((char *)di + len);
 		cur += len;
@@ -481,8 +487,9 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
 		switch (type) {
 		case BTRFS_INODE_ITEM_KEY:
 			ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
-			printf("\t\tinode generation %llu size %llu block group %llu mode %o links %u\n",
+			printf("\t\tinode generation %llu transid %llu size %llu block group %llu mode %o links %u\n",
 			       (unsigned long long)btrfs_inode_generation(l, ii),
+			       (unsigned long long)btrfs_inode_transid(l, ii),
 			       (unsigned long long)btrfs_inode_size(l, ii),
 			       (unsigned long long)btrfs_inode_block_group(l,ii),
 			       btrfs_inode_mode(l, ii),
-- 
1.7.10


  parent reply	other threads:[~2012-07-04 13:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 13:39 [RFC PATCH 0/6] Experimental btrfs send/receive (btrfs-progs) Alexander Block
2012-07-04 13:39 ` [RFC PATCH 1/6] Btrfs-progs: add BTRFS_IOC_SUBVOL_GET/SETFLAGS to ioctl.h Alexander Block
2012-07-04 13:39 ` [RFC PATCH 2/6] Btrfs-progs: update ioctl.h to support clone range ioctl Alexander Block
2012-07-04 13:39 ` Alexander Block [this message]
2012-07-04 13:39 ` [RFC PATCH 4/6] Btrfs-progs: update btrfs-progs for subvol uuid+times support Alexander Block
2012-07-04 13:39 ` [RFC PATCH 5/6] Btrfs-progs: update ioctl.h to support btrfs send ioctl Alexander Block
2012-07-04 13:39 ` [RFC PATCH 6/6] Btrfs-progs: add btrfs send/receive commands Alexander Block
2012-07-09 18:59   ` Alex Lyakas
2012-07-19 13:25     ` Alex Lyakas
2012-07-24 20:27       ` Alexander Block
2012-07-25  9:15         ` Alex Lyakas
2012-07-27 14:06   ` Arne Jansen
2012-07-04 14:53 ` [RFC PATCH 0/6] Experimental btrfs send/receive (btrfs-progs) Chris Mason
2012-07-23 12:29 ` Arne Jansen
2012-07-25 10:41   ` Alexander Block
2012-07-25 14:00     ` Hugo Mills
2012-07-25 15:17       ` Chris Mason
2012-07-25 16:56       ` Alexander Block
2012-07-25 17:10         ` Alex Lyakas
2012-07-25 17:14           ` Alexander Block

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=1341409174-13619-4-git-send-email-ablock84@googlemail.com \
    --to=ablock84@googlemail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.