linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] delete obsolete function btrfs_print_tree()
@ 2016-03-25 14:53 Holger Hoffstätte
  2016-04-04 13:56 ` David Sterba
  0 siblings, 1 reply; 6+ messages in thread
From: Holger Hoffstätte @ 2016-03-25 14:53 UTC (permalink / raw)
  To: linux-btrfs, Chris Mason, David Sterba; +Cc: Dan Carpenter


[-- 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 --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-04 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25 14:53 [PATCH] delete obsolete function btrfs_print_tree() Holger Hoffstätte
2016-04-04 13:56 ` 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

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).