diff options
-rw-r--r-- | fs/btrfs/Makefile | 2 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 4 | ||||
-rw-r--r-- | fs/btrfs/kerncompat.h | 2 | ||||
-rw-r--r-- | fs/btrfs/print-tree.c | 10 | ||||
-rw-r--r-- | fs/btrfs/random-test.c | 16 |
5 files changed, 17 insertions, 17 deletions
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile index 855e8f499e37..ea9b6665da34 100644 --- a/fs/btrfs/Makefile +++ b/fs/btrfs/Makefile | |||
@@ -17,6 +17,6 @@ tester: $(objects) random-test.o | |||
17 | $(objects) : $(headers) | 17 | $(objects) : $(headers) |
18 | 18 | ||
19 | clean : | 19 | clean : |
20 | rm ctree *.o | 20 | rm debug-tree tester *.o |
21 | 21 | ||
22 | 22 | ||
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 2b663ef84496..26321524c186 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -42,7 +42,7 @@ static int del_pending_extents(struct ctree_root *extent_root) | |||
42 | ret = search_slot(extent_root, &key, &path, 0); | 42 | ret = search_slot(extent_root, &key, &path, 0); |
43 | if (ret) { | 43 | if (ret) { |
44 | print_tree(extent_root, extent_root->node); | 44 | print_tree(extent_root, extent_root->node); |
45 | printf("unable to find %lu\n", key.objectid); | 45 | printf("unable to find %Lu\n", key.objectid); |
46 | BUG(); | 46 | BUG(); |
47 | // FIXME undo it and return sane | 47 | // FIXME undo it and return sane |
48 | return ret; | 48 | return ret; |
@@ -86,7 +86,7 @@ int free_extent(struct ctree_root *root, u64 blocknr, u64 num_blocks) | |||
86 | ret = search_slot(extent_root, &key, &path, 0); | 86 | ret = search_slot(extent_root, &key, &path, 0); |
87 | if (ret) { | 87 | if (ret) { |
88 | print_tree(extent_root, extent_root->node); | 88 | print_tree(extent_root, extent_root->node); |
89 | printf("failed to find %lu\n", key.objectid); | 89 | printf("failed to find %Lu\n", key.objectid); |
90 | BUG(); | 90 | BUG(); |
91 | } | 91 | } |
92 | ret = del_item(extent_root, &path); | 92 | ret = del_item(extent_root, &path); |
diff --git a/fs/btrfs/kerncompat.h b/fs/btrfs/kerncompat.h index 347ca06205c2..f5efc5f0fff0 100644 --- a/fs/btrfs/kerncompat.h +++ b/fs/btrfs/kerncompat.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #define BUG() abort() | 15 | #define BUG() abort() |
16 | 16 | ||
17 | typedef unsigned int u32; | 17 | typedef unsigned int u32; |
18 | typedef unsigned long u64; | 18 | typedef unsigned long long u64; |
19 | typedef unsigned char u8; | 19 | typedef unsigned char u8; |
20 | typedef unsigned short u16; | 20 | typedef unsigned short u16; |
21 | 21 | ||
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index 594d23b5b24c..1d591270f4c4 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c | |||
@@ -11,19 +11,19 @@ void print_leaf(struct leaf *l) | |||
11 | int nr = l->header.nritems; | 11 | int nr = l->header.nritems; |
12 | struct item *item; | 12 | struct item *item; |
13 | struct extent_item *ei; | 13 | struct extent_item *ei; |
14 | printf("leaf %lu total ptrs %d free space %d\n", l->header.blocknr, nr, | 14 | printf("leaf %Lu total ptrs %d free space %d\n", l->header.blocknr, nr, |
15 | leaf_free_space(l)); | 15 | leaf_free_space(l)); |
16 | fflush(stdout); | 16 | fflush(stdout); |
17 | for (i = 0 ; i < nr ; i++) { | 17 | for (i = 0 ; i < nr ; i++) { |
18 | item = l->items + i; | 18 | item = l->items + i; |
19 | printf("\titem %d key (%lu %u %lu) itemoff %d itemsize %d\n", | 19 | printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n", |
20 | i, | 20 | i, |
21 | item->key.objectid, item->key.flags, item->key.offset, | 21 | item->key.objectid, item->key.flags, item->key.offset, |
22 | item->offset, item->size); | 22 | item->offset, item->size); |
23 | fflush(stdout); | 23 | fflush(stdout); |
24 | printf("\t\titem data %.*s\n", item->size, l->data+item->offset); | 24 | printf("\t\titem data %.*s\n", item->size, l->data+item->offset); |
25 | ei = (struct extent_item *)(l->data + item->offset); | 25 | ei = (struct extent_item *)(l->data + item->offset); |
26 | printf("\t\textent data %u %lu\n", ei->refs, ei->owner); | 26 | printf("\t\textent data %u %Lu\n", ei->refs, ei->owner); |
27 | fflush(stdout); | 27 | fflush(stdout); |
28 | } | 28 | } |
29 | } | 29 | } |
@@ -43,12 +43,12 @@ void print_tree(struct ctree_root *root, struct tree_buffer *t) | |||
43 | print_leaf((struct leaf *)c); | 43 | print_leaf((struct leaf *)c); |
44 | return; | 44 | return; |
45 | } | 45 | } |
46 | printf("node %lu level %d total ptrs %d free spc %lu\n", t->blocknr, | 46 | printf("node %Lu level %d total ptrs %d free spc %lu\n", t->blocknr, |
47 | node_level(c->header.flags), c->header.nritems, | 47 | node_level(c->header.flags), c->header.nritems, |
48 | NODEPTRS_PER_BLOCK - c->header.nritems); | 48 | NODEPTRS_PER_BLOCK - c->header.nritems); |
49 | fflush(stdout); | 49 | fflush(stdout); |
50 | for (i = 0; i < nr; i++) { | 50 | for (i = 0; i < nr; i++) { |
51 | printf("\tkey %d (%lu %u %lu) block %lu\n", | 51 | printf("\tkey %d (%Lu %u %Lu) block %Lu\n", |
52 | i, | 52 | i, |
53 | c->keys[i].objectid, c->keys[i].flags, c->keys[i].offset, | 53 | c->keys[i].objectid, c->keys[i].flags, c->keys[i].offset, |
54 | c->blockptrs[i]); | 54 | c->blockptrs[i]); |
diff --git a/fs/btrfs/random-test.c b/fs/btrfs/random-test.c index 3c8c68d55d2f..111a248bd5c2 100644 --- a/fs/btrfs/random-test.c +++ b/fs/btrfs/random-test.c | |||
@@ -42,7 +42,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix) | |||
42 | char buf[128]; | 42 | char buf[128]; |
43 | init_path(&path); | 43 | init_path(&path); |
44 | ret = setup_key(radix, &key, 0); | 44 | ret = setup_key(radix, &key, 0); |
45 | sprintf(buf, "str-%lu\n", key.objectid); | 45 | sprintf(buf, "str-%Lu\n", key.objectid); |
46 | ret = insert_item(root, &key, buf, strlen(buf)); | 46 | ret = insert_item(root, &key, buf, strlen(buf)); |
47 | if (ret) | 47 | if (ret) |
48 | goto error; | 48 | goto error; |
@@ -54,7 +54,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix) | |||
54 | goto error; | 54 | goto error; |
55 | return ret; | 55 | return ret; |
56 | error: | 56 | error: |
57 | printf("failed to insert %lu\n", key.objectid); | 57 | printf("failed to insert %Lu\n", key.objectid); |
58 | return -1; | 58 | return -1; |
59 | } | 59 | } |
60 | 60 | ||
@@ -68,10 +68,10 @@ static int insert_dup(struct ctree_root *root, struct radix_tree_root *radix) | |||
68 | ret = setup_key(radix, &key, 1); | 68 | ret = setup_key(radix, &key, 1); |
69 | if (ret < 0) | 69 | if (ret < 0) |
70 | return 0; | 70 | return 0; |
71 | sprintf(buf, "str-%lu\n", key.objectid); | 71 | sprintf(buf, "str-%Lu\n", key.objectid); |
72 | ret = insert_item(root, &key, buf, strlen(buf)); | 72 | ret = insert_item(root, &key, buf, strlen(buf)); |
73 | if (ret != -EEXIST) { | 73 | if (ret != -EEXIST) { |
74 | printf("insert on %lu gave us %d\n", key.objectid, ret); | 74 | printf("insert on %Lu gave us %d\n", key.objectid, ret); |
75 | return 1; | 75 | return 1; |
76 | } | 76 | } |
77 | return 0; | 77 | return 0; |
@@ -99,7 +99,7 @@ static int del_one(struct ctree_root *root, struct radix_tree_root *radix) | |||
99 | goto error; | 99 | goto error; |
100 | return 0; | 100 | return 0; |
101 | error: | 101 | error: |
102 | printf("failed to delete %lu\n", key.objectid); | 102 | printf("failed to delete %Lu\n", key.objectid); |
103 | return -1; | 103 | return -1; |
104 | } | 104 | } |
105 | 105 | ||
@@ -118,7 +118,7 @@ static int lookup_item(struct ctree_root *root, struct radix_tree_root *radix) | |||
118 | goto error; | 118 | goto error; |
119 | return 0; | 119 | return 0; |
120 | error: | 120 | error: |
121 | printf("unable to find key %lu\n", key.objectid); | 121 | printf("unable to find key %Lu\n", key.objectid); |
122 | return -1; | 122 | return -1; |
123 | } | 123 | } |
124 | 124 | ||
@@ -137,7 +137,7 @@ static int lookup_enoent(struct ctree_root *root, struct radix_tree_root *radix) | |||
137 | goto error; | 137 | goto error; |
138 | return 0; | 138 | return 0; |
139 | error: | 139 | error: |
140 | printf("able to find key that should not exist %lu\n", key.objectid); | 140 | printf("able to find key that should not exist %Lu\n", key.objectid); |
141 | return -1; | 141 | return -1; |
142 | } | 142 | } |
143 | 143 | ||
@@ -148,7 +148,7 @@ static int fill_radix(struct ctree_root *root, struct radix_tree_root *radix) | |||
148 | { | 148 | { |
149 | struct ctree_path path; | 149 | struct ctree_path path; |
150 | struct key key; | 150 | struct key key; |
151 | u64 found; | 151 | unsigned long found; |
152 | int ret; | 152 | int ret; |
153 | int slot; | 153 | int slot; |
154 | int i; | 154 | int i; |