Skip to content

Commit

Permalink
Btrfs: u64 cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason authored and David Woodhouse committed Feb 26, 2007
1 parent c673024 commit 7cf7596
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ tester: $(objects) random-test.o
$(objects) : $(headers)

clean :
rm ctree *.o
rm debug-tree tester *.o


4 changes: 2 additions & 2 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int del_pending_extents(struct ctree_root *extent_root)
ret = search_slot(extent_root, &key, &path, 0);
if (ret) {
print_tree(extent_root, extent_root->node);
printf("unable to find %lu\n", key.objectid);
printf("unable to find %Lu\n", key.objectid);
BUG();
// FIXME undo it and return sane
return ret;
Expand Down Expand Up @@ -86,7 +86,7 @@ int free_extent(struct ctree_root *root, u64 blocknr, u64 num_blocks)
ret = search_slot(extent_root, &key, &path, 0);
if (ret) {
print_tree(extent_root, extent_root->node);
printf("failed to find %lu\n", key.objectid);
printf("failed to find %Lu\n", key.objectid);
BUG();
}
ret = del_item(extent_root, &path);
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/kerncompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define BUG() abort()

typedef unsigned int u32;
typedef unsigned long u64;
typedef unsigned long long u64;
typedef unsigned char u8;
typedef unsigned short u16;

Expand Down
10 changes: 5 additions & 5 deletions fs/btrfs/print-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ void print_leaf(struct leaf *l)
int nr = l->header.nritems;
struct item *item;
struct extent_item *ei;
printf("leaf %lu total ptrs %d free space %d\n", l->header.blocknr, nr,
printf("leaf %Lu total ptrs %d free space %d\n", l->header.blocknr, nr,
leaf_free_space(l));
fflush(stdout);
for (i = 0 ; i < nr ; i++) {
item = l->items + i;
printf("\titem %d key (%lu %u %lu) itemoff %d itemsize %d\n",
printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n",
i,
item->key.objectid, item->key.flags, item->key.offset,
item->offset, item->size);
fflush(stdout);
printf("\t\titem data %.*s\n", item->size, l->data+item->offset);
ei = (struct extent_item *)(l->data + item->offset);
printf("\t\textent data %u %lu\n", ei->refs, ei->owner);
printf("\t\textent data %u %Lu\n", ei->refs, ei->owner);
fflush(stdout);
}
}
Expand All @@ -43,12 +43,12 @@ void print_tree(struct ctree_root *root, struct tree_buffer *t)
print_leaf((struct leaf *)c);
return;
}
printf("node %lu level %d total ptrs %d free spc %lu\n", t->blocknr,
printf("node %Lu level %d total ptrs %d free spc %lu\n", t->blocknr,
node_level(c->header.flags), c->header.nritems,
NODEPTRS_PER_BLOCK - c->header.nritems);
fflush(stdout);
for (i = 0; i < nr; i++) {
printf("\tkey %d (%lu %u %lu) block %lu\n",
printf("\tkey %d (%Lu %u %Lu) block %Lu\n",
i,
c->keys[i].objectid, c->keys[i].flags, c->keys[i].offset,
c->blockptrs[i]);
Expand Down
16 changes: 8 additions & 8 deletions fs/btrfs/random-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix)
char buf[128];
init_path(&path);
ret = setup_key(radix, &key, 0);
sprintf(buf, "str-%lu\n", key.objectid);
sprintf(buf, "str-%Lu\n", key.objectid);
ret = insert_item(root, &key, buf, strlen(buf));
if (ret)
goto error;
Expand All @@ -54,7 +54,7 @@ static int ins_one(struct ctree_root *root, struct radix_tree_root *radix)
goto error;
return ret;
error:
printf("failed to insert %lu\n", key.objectid);
printf("failed to insert %Lu\n", key.objectid);
return -1;
}

Expand All @@ -68,10 +68,10 @@ static int insert_dup(struct ctree_root *root, struct radix_tree_root *radix)
ret = setup_key(radix, &key, 1);
if (ret < 0)
return 0;
sprintf(buf, "str-%lu\n", key.objectid);
sprintf(buf, "str-%Lu\n", key.objectid);
ret = insert_item(root, &key, buf, strlen(buf));
if (ret != -EEXIST) {
printf("insert on %lu gave us %d\n", key.objectid, ret);
printf("insert on %Lu gave us %d\n", key.objectid, ret);
return 1;
}
return 0;
Expand Down Expand Up @@ -99,7 +99,7 @@ static int del_one(struct ctree_root *root, struct radix_tree_root *radix)
goto error;
return 0;
error:
printf("failed to delete %lu\n", key.objectid);
printf("failed to delete %Lu\n", key.objectid);
return -1;
}

Expand All @@ -118,7 +118,7 @@ static int lookup_item(struct ctree_root *root, struct radix_tree_root *radix)
goto error;
return 0;
error:
printf("unable to find key %lu\n", key.objectid);
printf("unable to find key %Lu\n", key.objectid);
return -1;
}

Expand All @@ -137,7 +137,7 @@ static int lookup_enoent(struct ctree_root *root, struct radix_tree_root *radix)
goto error;
return 0;
error:
printf("able to find key that should not exist %lu\n", key.objectid);
printf("able to find key that should not exist %Lu\n", key.objectid);
return -1;
}

Expand All @@ -148,7 +148,7 @@ static int fill_radix(struct ctree_root *root, struct radix_tree_root *radix)
{
struct ctree_path path;
struct key key;
u64 found;
unsigned long found;
int ret;
int slot;
int i;
Expand Down

0 comments on commit 7cf7596

Please sign in to comment.