summaryrefslogtreecommitdiff
path: root/cmds-device.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2016-08-11 12:47:50 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2016-08-11 12:47:50 +0100
commit977f95bd164e17520fced5bd3ea1f01175a7f0ea (patch)
treecab3fd3533635deab3459b79f040621b006d33cc /cmds-device.c
parente056abdf97ee6899e41bd511eaa8d98aa2c45bb8 (diff)
parentffd998be34a1a3d208106d051e85058ff9ac9667 (diff)
New upstream release.
Diffstat (limited to 'cmds-device.c')
-rw-r--r--cmds-device.c7
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':