summaryrefslogtreecommitdiff
path: root/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-12 08:08:04 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-12 08:08:04 -0400
commit38ef945266758856bf11e385eadaa0872b6d8b30 (patch)
treed33ea2dd8fb941806351f3567fa981f718f95d1b /print-tree.c
parentb53a236c3eea3ce01a0054c249cb0b974b9568c6 (diff)
downloadbtrfs-progs-38ef945266758856bf11e385eadaa0872b6d8b30.tar.gz
printf cleanups
Diffstat (limited to 'print-tree.c')
-rw-r--r--print-tree.c73
1 files changed, 37 insertions, 36 deletions
diff --git a/print-tree.c b/print-tree.c
index 5788c0e..e912803 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -13,10 +13,10 @@ static int print_dir_item(struct btrfs_item *item,
u32 len;
total = btrfs_item_size(item);
while(cur < total) {
- printf("\t\tdir index %Lu flags %u type %u\n",
- btrfs_disk_key_objectid(&di->location),
- btrfs_dir_flags(di),
- btrfs_dir_type(di));
+ printf("\t\tdir index %llu flags %u type %u\n",
+ (unsigned long long)btrfs_disk_key_objectid(&di->location),
+ btrfs_dir_flags(di),
+ btrfs_dir_type(di));
printf("\t\tname %.*s\n",
btrfs_dir_name_len(di),(char *)(di + 1));
len = sizeof(*di) + btrfs_dir_name_len(di);
@@ -39,29 +39,29 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
struct btrfs_block_group_item *bi;
u32 type;
- printf("leaf %Lu ptrs %d free space %d generation %Lu owner %Lu\n",
- btrfs_header_blocknr(&l->header), nr,
+ printf("leaf %llu ptrs %d free space %d generation %llu owner %llu\n",
+ (unsigned long long)btrfs_header_blocknr(&l->header), nr,
btrfs_leaf_free_space(root, l),
- btrfs_header_generation(&l->header),
- btrfs_header_owner(&l->header));
+ (unsigned long long)btrfs_header_generation(&l->header),
+ (unsigned long long)btrfs_header_owner(&l->header));
fflush(stdout);
for (i = 0 ; i < nr ; i++) {
item = l->items + i;
type = btrfs_disk_key_type(&item->key);
- printf("\titem %d key (%Lu %x %Lu) itemoff %d itemsize %d\n",
+ printf("\titem %d key (%llu %x %llu) itemoff %d itemsize %d\n",
i,
- btrfs_disk_key_objectid(&item->key),
+ (unsigned long long)btrfs_disk_key_objectid(&item->key),
btrfs_disk_key_flags(&item->key),
- btrfs_disk_key_offset(&item->key),
+ (unsigned long long)btrfs_disk_key_offset(&item->key),
btrfs_item_offset(item),
btrfs_item_size(item));
switch (type) {
case BTRFS_INODE_ITEM_KEY:
ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
- printf("\t\tinode generation %Lu size %Lu block group %Lu mode %o\n",
- btrfs_inode_generation(ii),
- btrfs_inode_size(ii),
- btrfs_inode_block_group(ii),
+ printf("\t\tinode generation %llu size %llu block group %llu mode %o\n",
+ (unsigned long long)btrfs_inode_generation(ii),
+ (unsigned long long)btrfs_inode_size(ii),
+ (unsigned long long)btrfs_inode_block_group(ii),
btrfs_inode_mode(ii));
break;
case BTRFS_DIR_ITEM_KEY:
@@ -74,16 +74,16 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
break;
case BTRFS_ROOT_ITEM_KEY:
ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
- printf("\t\troot data blocknr %Lu dirid %Lu refs %u\n",
- btrfs_root_blocknr(ri),
- btrfs_root_dirid(ri),
+ printf("\t\troot data blocknr %llu dirid %llu refs %u\n",
+ (unsigned long long)btrfs_root_blocknr(ri),
+ (unsigned long long)btrfs_root_dirid(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",
+ printf("\t\textent data refs %u owner %llu\n",
btrfs_extent_refs(ei),
- btrfs_extent_owner(ei));
+ (unsigned long long)btrfs_extent_owner(ei));
break;
case BTRFS_CSUM_ITEM_KEY:
ci = btrfs_item_ptr(l, i,
@@ -99,18 +99,19 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
btrfs_file_extent_inline_len(l->items + i));
break;
}
- printf("\t\textent data disk block %Lu nr %Lu\n",
- btrfs_file_extent_disk_blocknr(fi),
- btrfs_file_extent_disk_num_blocks(fi));
- printf("\t\textent data offset %Lu nr %Lu\n",
- btrfs_file_extent_offset(fi),
- btrfs_file_extent_num_blocks(fi));
+ printf("\t\textent data disk block %llu nr %llu\n",
+ (unsigned long long)btrfs_file_extent_disk_blocknr(fi),
+ (unsigned long long)btrfs_file_extent_disk_num_blocks(fi));
+ printf("\t\textent data offset %llu nr %llu\n",
+ (unsigned long long)btrfs_file_extent_offset(fi),
+ (unsigned long long)btrfs_file_extent_num_blocks(fi));
break;
case BTRFS_BLOCK_GROUP_ITEM_KEY:
bi = btrfs_item_ptr(l, i,
struct btrfs_block_group_item);
- printf("\t\tblock group used %Lu flags %x\n",
- btrfs_block_group_used(bi), bi->flags);
+ printf("\t\tblock group used %llu flags %x\n",
+ (unsigned long long)btrfs_block_group_used(bi),
+ bi->flags);
break;
case BTRFS_STRING_ITEM_KEY:
printf("\t\titem data %.*s\n", btrfs_item_size(item),
@@ -134,20 +135,20 @@ 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 ptrs %d free %u generation %Lu owner %Lu\n",
- t->blocknr,
+ printf("node %llu level %d ptrs %d free %u generation %llu owner %llu\n",
+ (unsigned long long)t->blocknr,
btrfs_header_level(&c->header), nr,
(u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr,
- btrfs_header_generation(&c->header),
- btrfs_header_owner(&c->header));
+ (unsigned long long)btrfs_header_generation(&c->header),
+ (unsigned long long)btrfs_header_owner(&c->header));
fflush(stdout);
for (i = 0; i < nr; i++) {
- printf("\tkey %d (%Lu %x %Lu) block %Lu\n",
+ printf("\tkey %d (%llu %x %llu) block %llu\n",
i,
- c->ptrs[i].key.objectid,
+ (unsigned long long)c->ptrs[i].key.objectid,
c->ptrs[i].key.flags,
- c->ptrs[i].key.offset,
- btrfs_node_blockptr(c, i));
+ (unsigned long long)c->ptrs[i].key.offset,
+ (unsigned long long)btrfs_node_blockptr(c, i));
fflush(stdout);
}
for (i = 0; i < nr; i++) {