From: "Holger Hoffstätte" <holger.hoffstaette@googlemail.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>,
Chris Mason <clm@fb.com>, David Sterba <dsterba@suse.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH] delete obsolete function btrfs_print_tree()
Date: Fri, 25 Mar 2016 15:53:17 +0100 [thread overview]
Message-ID: <56F550DD.1030200@googlemail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2224 bytes --]
Dan Carpenter's static checker recently found missing IS_ERR handling
in print-tree.c:btrfs_print_tree(). While looking into this I found that
this function is no longer called anywhere and was moved to btrfs-progs
long ago. It can simply be removed.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Holger Hoffstätte <holger.hoffstaette@googlemail.com>
---
fs/btrfs/print-tree.c | 38 --------------------------------------
fs/btrfs/print-tree.h | 1 -
2 files changed, 39 deletions(-)
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 147dc6c..dc28db8 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -328,41 +328,3 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
};
}
}
-
-void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c)
-{
- int i; u32 nr;
- struct btrfs_key key;
- int level;
-
- if (!c)
- return;
- nr = btrfs_header_nritems(c);
- level = btrfs_header_level(c);
- if (level == 0) {
- btrfs_print_leaf(root, c);
- return;
- }
- btrfs_info(root->fs_info, "node %llu level %d total ptrs %d free spc %u",
- btrfs_header_bytenr(c), level, nr,
- (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
- for (i = 0; i < nr; i++) {
- btrfs_node_key_to_cpu(c, &key, i);
- printk(KERN_INFO "\tkey %d (%llu %u %llu) block %llu\n",
- i, key.objectid, key.type, key.offset,
- btrfs_node_blockptr(c, i));
- }
- for (i = 0; i < nr; i++) {
- struct extent_buffer *next = read_tree_block(root,
- btrfs_node_blockptr(c, i),
- btrfs_node_ptr_generation(c, i));
- if (btrfs_is_leaf(next) &&
- level != 1)
- BUG();
- if (btrfs_header_level(next) !=
- level - 1)
- BUG();
- btrfs_print_tree(root, next);
- free_extent_buffer(next);
- }
-}
diff --git a/fs/btrfs/print-tree.h b/fs/btrfs/print-tree.h
index 7faddfa..9dd56b9 100644
--- a/fs/btrfs/print-tree.h
+++ b/fs/btrfs/print-tree.h
@@ -19,5 +19,4 @@
#ifndef __PRINT_TREE_
#define __PRINT_TREE_
void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l);
-void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *c);
#endif
--
2.7.4
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next reply other threads:[~2016-03-25 14:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-25 14:53 Holger Hoffstätte [this message]
2016-04-04 13:56 ` [PATCH] delete obsolete function btrfs_print_tree() David Sterba
2016-04-04 15:54 ` Holger Hoffstätte
2016-04-04 16:02 ` Filipe Manana
2016-04-04 16:20 ` Holger Hoffstätte
2016-04-04 20:10 ` Dan Carpenter
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=56F550DD.1030200@googlemail.com \
--to=holger.hoffstaette@googlemail.com \
--cc=clm@fb.com \
--cc=dan.carpenter@oracle.com \
--cc=dsterba@suse.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.