diff options
author | David Sterba <dsterba@suse.com> | 2016-07-28 01:47:40 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-28 14:08:30 +0200 |
commit | 5407ee85fcaba91c9a0207ffad97a9b8b1c45c8c (patch) | |
tree | 8b9e427c1995e4dbea858746dbe5a7a33875953d /cmds-device.c | |
parent | 9c92c4eb92c41860819a5c9e25972451541f1b02 (diff) |
btrfs-progs: refactor and extend btrfs_prepare_device arguments
The message about discard is printed unconditionally and does not
conform to the --quite option eg. in mkfs. Consolidate the operation
flags into one argument and add support for verbosity.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-device.c')
-rw-r--r-- | cmds-device.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmds-device.c b/cmds-device.c index 59695feb..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++; |