btrfs-progs: cast u64 to long long to avoid printf warnings

When building on ppc64 I hit a number of warnings in printf:

btrfs-map-logical.c:69: error: format ‘%Lu’ expects type ‘long long
unsigned int’, but argument 4 has type ‘u64’

Fix them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
This commit is contained in:
Anton Blanchard 2011-04-07 21:02:04 +10:00 committed by Chris Mason
parent fcdc0929c6
commit fa81a569ac
7 changed files with 14 additions and 9 deletions

View file

@ -249,7 +249,8 @@ static int resolve_root(struct root_lookup *rl, struct root_info *ri)
break; break;
} }
} }
printf("ID %llu top level %llu path %s\n", ri->root_id, top_id, printf("ID %llu top level %llu path %s\n",
(unsigned long long)ri->root_id, (unsigned long long)top_id,
full_path); full_path);
free(full_path); free(full_path);
return 0; return 0;

View file

@ -63,8 +63,8 @@ struct extent_buffer *debug_read_block(struct btrfs_root *root, u64 bytenr,
eb->dev_bytenr = multi->stripes[0].physical; eb->dev_bytenr = multi->stripes[0].physical;
fprintf(info_file, "mirror %d logical %Lu physical %Lu " fprintf(info_file, "mirror %d logical %Lu physical %Lu "
"device %s\n", mirror_num, bytenr, eb->dev_bytenr, "device %s\n", mirror_num, (unsigned long long)bytenr,
device->name); (unsigned long long)eb->dev_bytenr, device->name);
kfree(multi); kfree(multi);
if (!copy || mirror_num == copy) if (!copy || mirror_num == copy)

View file

@ -250,7 +250,7 @@ int main(int ac, char **av)
args.fd = fd; args.fd = fd;
ret = ioctl(snap_fd, command, &args); ret = ioctl(snap_fd, command, &args);
} else if (command == BTRFS_IOC_DEFAULT_SUBVOL) { } else if (command == BTRFS_IOC_DEFAULT_SUBVOL) {
printf("objectid is %llu\n", objectid); printf("objectid is %llu\n", (unsigned long long)objectid);
ret = ioctl(fd, command, &objectid); ret = ioctl(fd, command, &objectid);
} else } else
ret = ioctl(fd, command, &args); ret = ioctl(fd, command, &args);

View file

@ -125,7 +125,8 @@ int main(int ac, char **av)
root->nodesize, 0); root->nodesize, 0);
} }
if (!leaf) { if (!leaf) {
fprintf(stderr, "failed to read %llu\n", block_only); fprintf(stderr, "failed to read %llu\n",
(unsigned long long)block_only);
return 0; return 0;
} }
btrfs_print_tree(root, leaf, 0); btrfs_print_tree(root, leaf, 0);

View file

@ -675,7 +675,8 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
~BTRFS_FEATURE_INCOMPAT_SUPP; ~BTRFS_FEATURE_INCOMPAT_SUPP;
if (features) { if (features) {
printk("couldn't open because of unsupported " printk("couldn't open because of unsupported "
"option features (%Lx).\n", features); "option features (%Lx).\n",
(unsigned long long)features);
BUG_ON(1); BUG_ON(1);
} }
@ -689,7 +690,8 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr,
~BTRFS_FEATURE_COMPAT_RO_SUPP; ~BTRFS_FEATURE_COMPAT_RO_SUPP;
if (writes && features) { if (writes && features) {
printk("couldn't open RDWR because of unsupported " printk("couldn't open RDWR because of unsupported "
"option features (%Lx).\n", features); "option features (%Lx).\n",
(unsigned long long)features);
BUG_ON(1); BUG_ON(1);
} }

View file

@ -1448,7 +1448,8 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
goto out; goto out;
if (ret != 0) { if (ret != 0) {
btrfs_print_leaf(root, path->nodes[0]); btrfs_print_leaf(root, path->nodes[0]);
printk("failed to find block number %Lu\n", bytenr); printk("failed to find block number %Lu\n",
(unsigned long long)bytenr);
BUG(); BUG();
} }

View file

@ -496,7 +496,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
case BTRFS_DIR_LOG_ITEM_KEY: case BTRFS_DIR_LOG_ITEM_KEY:
dlog = btrfs_item_ptr(l, i, struct btrfs_dir_log_item); dlog = btrfs_item_ptr(l, i, struct btrfs_dir_log_item);
printf("\t\tdir log end %Lu\n", printf("\t\tdir log end %Lu\n",
btrfs_dir_log_end(l, dlog)); (unsigned long long)btrfs_dir_log_end(l, dlog));
break; break;
case BTRFS_ORPHAN_ITEM_KEY: case BTRFS_ORPHAN_ITEM_KEY:
printf("\t\torphan item\n"); printf("\t\torphan item\n");