diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2014-02-20 09:30:51 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-03-21 06:23:19 -0700 |
commit | 86da12ff869823f4dae20488f3bedeae4a55086d (patch) | |
tree | 66560bfd39e7a55ef613182f1abc6be10a1f21d5 /btrfs-map-logical.c | |
parent | aab2f48c189bb89b71851edbb57e9074405a6262 (diff) |
Btrfs-progs: switch to arg_strtou64() part2
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'btrfs-map-logical.c')
-rw-r--r-- | btrfs-map-logical.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index 51179a31..a907e4d4 100644 --- a/btrfs-map-logical.c +++ b/btrfs-map-logical.c @@ -31,6 +31,7 @@ #include "transaction.h" #include "list.h" #include "version.h" +#include "utils.h" /* we write the mirror info to stdout unless they are dumping the data * to stdout @@ -38,7 +39,7 @@ static FILE *info_file; static struct extent_buffer * debug_read_block(struct btrfs_root *root, - u64 bytenr, u32 blocksize, int copy) + u64 bytenr, u32 blocksize, u64 copy) { int ret; struct extent_buffer *eb; @@ -120,7 +121,7 @@ int main(int ac, char **av) u64 logical = 0; int ret = 0; int option_index = 0; - int copy = 0; + u64 copy = 0; u64 bytes = 0; int out_fd = 0; @@ -132,28 +133,13 @@ int main(int ac, char **av) break; switch(c) { case 'l': - logical = atoll(optarg); - if (logical == 0) { - fprintf(stderr, - "invalid extent number\n"); - print_usage(); - } + logical = arg_strtou64(optarg); break; case 'c': - copy = atoi(optarg); - if (copy == 0) { - fprintf(stderr, - "invalid copy number\n"); - print_usage(); - } + copy = arg_strtou64(optarg); break; case 'b': - bytes = atoll(optarg); - if (bytes == 0) { - fprintf(stderr, - "invalid byte count\n"); - print_usage(); - } + bytes = arg_strtou64(optarg); break; case 'o': output_file = strdup(optarg); |