aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-12 07:50:13 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-12 07:50:13 -0400
commit5af3981c1878b0657b9babd2ef7ec98c2008cf2c (patch)
tree084068ff090eab1a8235c6bdd9f49563a51675a6
parent84f54cfa78c81991e087309a9b379f25f1ffdb10 (diff)
Btrfs: printk fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/disk-io.c10
-rw-r--r--fs/btrfs/extent-tree.c5
-rw-r--r--fs/btrfs/file-item.c5
-rw-r--r--fs/btrfs/print-tree.c42
-rw-r--r--fs/btrfs/root-tree.c2
5 files changed, 29 insertions, 35 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 96bf3ef3a798..878101172546 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -20,8 +20,9 @@ static int check_tree_block(struct btrfs_root *root, struct buffer_head *buf)
20{ 20{
21 struct btrfs_node *node = btrfs_buffer_node(buf); 21 struct btrfs_node *node = btrfs_buffer_node(buf);
22 if (bh_blocknr(buf) != btrfs_header_blocknr(&node->header)) { 22 if (bh_blocknr(buf) != btrfs_header_blocknr(&node->header)) {
23 printk(KERN_CRIT "bh_blocknr(buf) is %Lu, header is %Lu\n", 23 printk(KERN_CRIT "bh_blocknr(buf) is %llu, header is %llu\n",
24 bh_blocknr(buf), btrfs_header_blocknr(&node->header)); 24 (unsigned long long)bh_blocknr(buf),
25 (unsigned long long)btrfs_header_blocknr(&node->header));
25 return 1; 26 return 1;
26 } 27 }
27 return 0; 28 return 0;
@@ -157,8 +158,9 @@ static int csum_tree_block(struct btrfs_root *root, struct buffer_head *bh,
157 return ret; 158 return ret;
158 if (verify) { 159 if (verify) {
159 if (memcmp(bh->b_data, result, BTRFS_CRC32_SIZE)) { 160 if (memcmp(bh->b_data, result, BTRFS_CRC32_SIZE)) {
160 printk("checksum verify failed on %Lu\n", 161 printk("btrfs: %s checksum verify failed on %llu\n",
161 bh_blocknr(bh)); 162 root->fs_info->sb->s_id,
163 (unsigned long long)bh_blocknr(bh));
162 return 1; 164 return 1;
163 } 165 }
164 } else { 166 } else {
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6949eebc9dc1..fe02fbfa6d59 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -584,8 +584,6 @@ static int update_block_group(struct btrfs_trans_handle *trans,
584 while(total) { 584 while(total) {
585 cache = btrfs_lookup_block_group(info, blocknr); 585 cache = btrfs_lookup_block_group(info, blocknr);
586 if (!cache) { 586 if (!cache) {
587 printk(KERN_CRIT "blocknr %Lu lookup failed\n",
588 blocknr);
589 return -1; 587 return -1;
590 } 588 }
591 block_in_group = blocknr - cache->key.objectid; 589 block_in_group = blocknr - cache->key.objectid;
@@ -795,9 +793,6 @@ static int __free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
795 793
796 ret = btrfs_search_slot(trans, extent_root, &key, path, -1, 1); 794 ret = btrfs_search_slot(trans, extent_root, &key, path, -1, 1);
797 if (ret) { 795 if (ret) {
798 printk("failed to find %Lu\n", key.objectid);
799 btrfs_print_tree(extent_root, extent_root->node);
800 printk("failed to find %Lu\n", key.objectid);
801 BUG(); 796 BUG();
802 } 797 }
803 ei = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]), path->slots[0], 798 ei = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]), path->slots[0],
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index fb8c214160c1..d5a98827e38a 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -28,10 +28,6 @@ int btrfs_insert_file_extent(struct btrfs_trans_handle *trans,
28 28
29 ret = btrfs_insert_empty_item(trans, root, path, &file_key, 29 ret = btrfs_insert_empty_item(trans, root, path, &file_key,
30 sizeof(*item)); 30 sizeof(*item));
31 if (ret) {
32printk("failed to insert %Lu %Lu ret %d\n", objectid, pos, ret);
33btrfs_print_leaf(root, btrfs_buffer_leaf(path->nodes[0]));
34 }
35 BUG_ON(ret); 31 BUG_ON(ret);
36 item = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]), path->slots[0], 32 item = btrfs_item_ptr(btrfs_buffer_leaf(path->nodes[0]), path->slots[0],
37 struct btrfs_file_extent_item); 33 struct btrfs_file_extent_item);
@@ -201,7 +197,6 @@ insert:
201 ret = btrfs_insert_empty_item(trans, root, path, &file_key, 197 ret = btrfs_insert_empty_item(trans, root, path, &file_key,
202 BTRFS_CRC32_SIZE); 198 BTRFS_CRC32_SIZE);
203 if (ret != 0) { 199 if (ret != 0) {
204 printk("at insert for %Lu %u %Lu ret is %d\n", file_key.objectid, file_key.flags, file_key.offset, ret);
205 WARN_ON(1); 200 WARN_ON(1);
206 goto fail; 201 goto fail;
207 } 202 }
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 28813411de66..21791f037561 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -15,31 +15,32 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
15 struct btrfs_block_group_item *bi; 15 struct btrfs_block_group_item *bi;
16 u32 type; 16 u32 type;
17 17
18 printk("leaf %Lu total ptrs %d free space %d\n", 18 printk("leaf %llu total ptrs %d free space %d\n",
19 btrfs_header_blocknr(&l->header), nr, 19 (unsigned long long)btrfs_header_blocknr(&l->header), nr,
20 btrfs_leaf_free_space(root, l)); 20 btrfs_leaf_free_space(root, l));
21 for (i = 0 ; i < nr ; i++) { 21 for (i = 0 ; i < nr ; i++) {
22 item = l->items + i; 22 item = l->items + i;
23 type = btrfs_disk_key_type(&item->key); 23 type = btrfs_disk_key_type(&item->key);
24 printk("\titem %d key (%Lu %x %Lu) itemoff %d itemsize %d\n", 24 printk("\titem %d key (%llu %x %llu) itemoff %d itemsize %d\n",
25 i, 25 i,
26 btrfs_disk_key_objectid(&item->key), 26 (unsigned long long)btrfs_disk_key_objectid(&item->key),
27 btrfs_disk_key_flags(&item->key), 27 btrfs_disk_key_flags(&item->key),
28 btrfs_disk_key_offset(&item->key), 28 (unsigned long long)btrfs_disk_key_offset(&item->key),
29 btrfs_item_offset(item), 29 btrfs_item_offset(item),
30 btrfs_item_size(item)); 30 btrfs_item_size(item));
31 switch (type) { 31 switch (type) {
32 case BTRFS_INODE_ITEM_KEY: 32 case BTRFS_INODE_ITEM_KEY:
33 ii = btrfs_item_ptr(l, i, struct btrfs_inode_item); 33 ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
34 printk("\t\tinode generation %Lu size %Lu mode %o\n", 34 printk("\t\tinode generation %llu size %llu mode %o\n",
35 btrfs_inode_generation(ii), 35 (unsigned long long)btrfs_inode_generation(ii),
36 btrfs_inode_size(ii), 36 (unsigned long long)btrfs_inode_size(ii),
37 btrfs_inode_mode(ii)); 37 btrfs_inode_mode(ii));
38 break; 38 break;
39 case BTRFS_DIR_ITEM_KEY: 39 case BTRFS_DIR_ITEM_KEY:
40 di = btrfs_item_ptr(l, i, struct btrfs_dir_item); 40 di = btrfs_item_ptr(l, i, struct btrfs_dir_item);
41 printk("\t\tdir oid %Lu flags %u type %u\n", 41 printk("\t\tdir oid %llu flags %u type %u\n",
42 btrfs_disk_key_objectid(&di->location), 42 (unsigned long long)btrfs_disk_key_objectid(
43 &di->location),
43 btrfs_dir_flags(di), 44 btrfs_dir_flags(di),
44 btrfs_dir_type(di)); 45 btrfs_dir_type(di));
45 printk("\t\tname %.*s\n", 46 printk("\t\tname %.*s\n",
@@ -47,8 +48,9 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
47 break; 48 break;
48 case BTRFS_ROOT_ITEM_KEY: 49 case BTRFS_ROOT_ITEM_KEY:
49 ri = btrfs_item_ptr(l, i, struct btrfs_root_item); 50 ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
50 printk("\t\troot data blocknr %Lu refs %u\n", 51 printk("\t\troot data blocknr %llu refs %u\n",
51 btrfs_root_blocknr(ri), btrfs_root_refs(ri)); 52 (unsigned long long)btrfs_root_blocknr(ri),
53 btrfs_root_refs(ri));
52 break; 54 break;
53 case BTRFS_EXTENT_ITEM_KEY: 55 case BTRFS_EXTENT_ITEM_KEY:
54 ei = btrfs_item_ptr(l, i, struct btrfs_extent_item); 56 ei = btrfs_item_ptr(l, i, struct btrfs_extent_item);
@@ -58,8 +60,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
58 case BTRFS_BLOCK_GROUP_ITEM_KEY: 60 case BTRFS_BLOCK_GROUP_ITEM_KEY:
59 bi = btrfs_item_ptr(l, i, 61 bi = btrfs_item_ptr(l, i,
60 struct btrfs_block_group_item); 62 struct btrfs_block_group_item);
61 printk("\t\tblock group used %Lu\n", 63 printk("\t\tblock group used %llu\n",
62 btrfs_block_group_used(bi)); 64 (unsigned long long)btrfs_block_group_used(bi));
63 break; 65 break;
64 case BTRFS_STRING_ITEM_KEY: 66 case BTRFS_STRING_ITEM_KEY:
65 printk("\t\titem data %.*s\n", btrfs_item_size(item), 67 printk("\t\titem data %.*s\n", btrfs_item_size(item),
@@ -83,17 +85,17 @@ void btrfs_print_tree(struct btrfs_root *root, struct buffer_head *t)
83 btrfs_print_leaf(root, (struct btrfs_leaf *)c); 85 btrfs_print_leaf(root, (struct btrfs_leaf *)c);
84 return; 86 return;
85 } 87 }
86 printk("node %Lu level %d total ptrs %d free spc %u\n", 88 printk("node %llu level %d total ptrs %d free spc %u\n",
87 btrfs_header_blocknr(&c->header), 89 (unsigned long long)btrfs_header_blocknr(&c->header),
88 btrfs_header_level(&c->header), nr, 90 btrfs_header_level(&c->header), nr,
89 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr); 91 (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
90 for (i = 0; i < nr; i++) { 92 for (i = 0; i < nr; i++) {
91 printk("\tkey %d (%Lu %u %Lu) block %Lu\n", 93 printk("\tkey %d (%llu %u %llu) block %llu\n",
92 i, 94 i,
93 c->ptrs[i].key.objectid, 95 (unsigned long long)c->ptrs[i].key.objectid,
94 c->ptrs[i].key.flags, 96 c->ptrs[i].key.flags,
95 c->ptrs[i].key.offset, 97 (unsigned long long)c->ptrs[i].key.offset,
96 btrfs_node_blockptr(c, i)); 98 (unsigned long long)btrfs_node_blockptr(c, i));
97 } 99 }
98 for (i = 0; i < nr; i++) { 100 for (i = 0; i < nr; i++) {
99 struct buffer_head *next_buf = read_tree_block(root, 101 struct buffer_head *next_buf = read_tree_block(root,
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 0564a73bb2e2..13c30284fd84 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -102,7 +102,7 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
102 ret = btrfs_del_item(trans, root, path); 102 ret = btrfs_del_item(trans, root, path);
103 } else { 103 } else {
104 btrfs_set_root_refs(ri, refs - 1); 104 btrfs_set_root_refs(ri, refs - 1);
105printk("ref now %u root %llu %Lu %u\n", refs -1, key->objectid, key->offset, key->flags); 105 WARN_ON(1);
106 mark_buffer_dirty(path->nodes[0]); 106 mark_buffer_dirty(path->nodes[0]);
107 } 107 }
108out: 108out: