diff options
Diffstat (limited to 'cmds-device.c')
-rw-r--r-- | cmds-device.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cmds-device.c b/cmds-device.c index 1c886ad5..a939c56f 100644 --- a/cmds-device.c +++ b/cmds-device.c @@ -107,8 +107,9 @@ static int cmd_device_add(int argc, char **argv) continue; } - res = btrfs_prepare_device(devfd, argv[i], 1, &dev_block_count, - 0, discard); + res = btrfs_prepare_device(devfd, argv[i], &dev_block_count, 0, + PREP_DEVICE_ZERO_END | PREP_DEVICE_VERBOSE | + (discard ? PREP_DEVICE_DISCARD : 0)); close(devfd); if (res) { ret++; @@ -257,7 +258,6 @@ static int cmd_device_scan(int argc, char **argv) int all = 0; int ret = 0; - optind = 1; while (1) { int c; static const struct option long_options[] = { @@ -392,7 +392,6 @@ static int cmd_device_stats(int argc, char **argv) __u64 flags = 0; DIR *dirstream = NULL; - optind = 1; while ((c = getopt(argc, argv, "z")) != -1) { switch (c) { case 'z': |