summaryrefslogtreecommitdiff
path: root/cmds-device.c
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2016-08-11 12:45:00 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2016-08-11 12:45:00 +0100
commitffd998be34a1a3d208106d051e85058ff9ac9667 (patch)
tree3f93a4a7362dcbdbadf5086e9404dc58ea22200a /cmds-device.c
parent3d69435ee3292b4b1db2d61c4784789d75883821 (diff)
Imported Upstream version 4.7
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':