summaryrefslogtreecommitdiff
path: root/btrfs-map-logical.c
diff options
context:
space:
mode:
Diffstat (limited to 'btrfs-map-logical.c')
-rw-r--r--btrfs-map-logical.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c
index 0161b5c6..fd0286d5 100644
--- a/btrfs-map-logical.c
+++ b/btrfs-map-logical.c
@@ -81,7 +81,7 @@ again:
}
logical = key.objectid;
if (key.type == BTRFS_METADATA_ITEM_KEY)
- len = fs_info->tree_root->leafsize;
+ len = fs_info->tree_root->nodesize;
else
len = key.offset;
@@ -201,7 +201,7 @@ static void print_usage(void)
exit(1);
}
-int main(int ac, char **av)
+int main(int argc, char **argv)
{
struct cache_tree root_cache;
struct btrfs_root *root;
@@ -227,7 +227,7 @@ int main(int ac, char **av)
{ NULL, 0, NULL, 0}
};
- c = getopt_long(ac, av, "l:c:o:b:", long_options, NULL);
+ c = getopt_long(argc, argv, "l:c:o:b:", long_options, NULL);
if (c < 0)
break;
switch(c) {
@@ -247,14 +247,13 @@ int main(int ac, char **av)
print_usage();
}
}
- set_argv0(av);
- ac = ac - optind;
- if (check_argc_min(ac, 1))
+ set_argv0(argv);
+ if (check_argc_min(argc - optind, 1))
print_usage();
if (logical == 0)
print_usage();
- dev = av[optind];
+ dev = argv[optind];
radix_tree_init();
cache_tree_init(&root_cache);