From 5407ee85fcaba91c9a0207ffad97a9b8b1c45c8c Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 28 Jul 2016 01:47:40 +0200 Subject: 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 --- cmds-device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cmds-device.c') 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++; -- cgit v1.2.3