summaryrefslogtreecommitdiff
path: root/fs/btrfs/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-21 18:12:56 +0300
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-21 18:12:56 +0300
commit2e635a278354a1a7951e16cfea4c247d6d0e7c99 (patch)
tree4b94d54ddcd7cb184681260738b68caef4edee81 /fs/btrfs/print-tree.c
parent1261ec42b3d3a3ad878bd172144940e3ac710749 (diff)
downloadlinux-2e635a278354a1a7951e16cfea4c247d6d0e7c99.tar.xz
Btrfs: initial move to kernel module land
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/print-tree.c')
-rw-r--r--fs/btrfs/print-tree.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index f53b99da12f3..aa2d3fac8804 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -1,7 +1,4 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "kerncompat.h"
-#include "radix-tree.h"
+#include <linux/module.h>
#include "ctree.h"
#include "disk-io.h"
@@ -17,14 +14,14 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
struct btrfs_inode_item *ii;
u32 type;
- printf("leaf %Lu total ptrs %d free space %d\n",
+ printk("leaf %Lu total ptrs %d free space %d\n",
btrfs_header_blocknr(&l->header), nr,
btrfs_leaf_free_space(root, l));
fflush(stdout);
for (i = 0 ; i < nr ; i++) {
item = l->items + i;
type = btrfs_disk_key_type(&item->key);
- printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n",
+ printk("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n",
i,
btrfs_disk_key_objectid(&item->key),
btrfs_disk_key_flags(&item->key),
@@ -34,38 +31,39 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
switch (type) {
case BTRFS_INODE_ITEM_KEY:
ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
- printf("\t\tinode generation %Lu size %Lu\n",
+ printk("\t\tinode generation %Lu size %Lu mode %o\n",
btrfs_inode_generation(ii),
- btrfs_inode_size(ii));
+ btrfs_inode_size(ii),
+ btrfs_inode_mode(ii));
break;
case BTRFS_DIR_ITEM_KEY:
di = btrfs_item_ptr(l, i, struct btrfs_dir_item);
- printf("\t\tdir oid %Lu flags %u type %u\n",
+ printk("\t\tdir oid %Lu flags %u type %u\n",
btrfs_dir_objectid(di),
btrfs_dir_flags(di),
btrfs_dir_type(di));
- printf("\t\tname %.*s\n",
+ printk("\t\tname %.*s\n",
btrfs_dir_name_len(di),(char *)(di + 1));
break;
case BTRFS_ROOT_ITEM_KEY:
ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
- printf("\t\troot data blocknr %Lu refs %u\n",
+ printk("\t\troot data blocknr %Lu refs %u\n",
btrfs_root_blocknr(ri), btrfs_root_refs(ri));
break;
case BTRFS_EXTENT_ITEM_KEY:
ei = btrfs_item_ptr(l, i, struct btrfs_extent_item);
- printf("\t\textent data refs %u owner %Lu\n",
+ printk("\t\textent data refs %u owner %Lu\n",
btrfs_extent_refs(ei), btrfs_extent_owner(ei));
break;
case BTRFS_INODE_MAP_ITEM_KEY:
mi = btrfs_item_ptr(l, i, struct btrfs_inode_map_item);
- printf("\t\tinode map key %Lu %u %Lu\n",
+ printk("\t\tinode map key %Lu %u %Lu\n",
btrfs_disk_key_objectid(&mi->key),
btrfs_disk_key_flags(&mi->key),
btrfs_disk_key_offset(&mi->key));
break;
case BTRFS_STRING_ITEM_KEY:
- printf("\t\titem data %.*s\n", btrfs_item_size(item),
+ printk("\t\titem data %.*s\n", btrfs_item_size(item),
btrfs_leaf_data(l) + btrfs_item_offset(item));
break;
};
@@ -86,12 +84,12 @@ void btrfs_print_tree(struct btrfs_root *root, struct btrfs_buffer *t)
btrfs_print_leaf(root, (struct btrfs_leaf *)c);
return;
}
- printf("node %Lu level %d total ptrs %d free spc %u\n", t->blocknr,
+ printk("node %Lu level %d total ptrs %d free spc %u\n", t->blocknr,
btrfs_header_level(&c->header), nr,
(u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
fflush(stdout);
for (i = 0; i < nr; i++) {
- printf("\tkey %d (%Lu %u %Lu) block %Lu\n",
+ printk("\tkey %d (%Lu %u %Lu) block %Lu\n",
i,
c->ptrs[i].key.objectid,
c->ptrs[i].key.flags,