From patchwork Wed Jul 4 13:39:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Block X-Patchwork-Id: 1156171 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5262BDFF0F for ; Wed, 4 Jul 2012 13:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753008Ab2GDNkO (ORCPT ); Wed, 4 Jul 2012 09:40:14 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:41824 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752887Ab2GDNkK (ORCPT ); Wed, 4 Jul 2012 09:40:10 -0400 Received: by mail-bk0-f46.google.com with SMTP id j10so2633865bkw.19 for ; Wed, 04 Jul 2012 06:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=QbQifeKz595GADVG0PehFDiYGc/bPUf/k8TYd/9VFH8=; b=Hjh9hltbL8INC82v3Ong6jJelYZ0ip+WOazo8W0X9StKOTwMwBSmTMxkJ0qiBjFEJw Cq0nMHMadev5pps7ep8Qmf3FtDltI6DbpWo6lnfYQ501Srq19/W7tvgryP+x5q4Y87yd z+ODfqNH5yBNt+6O7pt2Sh8FU9TAtWtU9h+oBuquNIyN5HKiWQlmp8c8j1h3TQlxa/dP 9SCBR94tlrOaX2PS30pcoTii9P1HdBANbHMwG2hQ/BuBcHbccgQ45j9LoYZ96NBs7VGh HmmPSHtxzg5u8qDIhXNehPmXFizrH3S/Mxd9OppUSfmRp3WmchRPmNFZVihjPRFFDXcD Y3CQ== Received: by 10.204.152.4 with SMTP id e4mr6075146bkw.2.1341409210008; Wed, 04 Jul 2012 06:40:10 -0700 (PDT) Received: from localhost.localdomain (p4FEF4B20.dip.t-dialin.net. [79.239.75.32]) by mx.google.com with ESMTPS id h18sm19032244bkh.8.2012.07.04.06.40.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Jul 2012 06:40:09 -0700 (PDT) From: Alexander Block To: linux-btrfs@vger.kernel.org Cc: Alexander Block 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 Message-Id: <1341409174-13619-4-git-send-email-ablock84@googlemail.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1341409174-13619-1-git-send-email-ablock84@googlemail.com> References: <1341409174-13619-1-git-send-email-ablock84@googlemail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Add printing of inode transid and dir item data field. Signed-off-by: Alexander Block --- 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),