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 --- utils.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'utils.h') diff --git a/utils.h b/utils.h index 98bfb34d..58121ced 100644 --- a/utils.h +++ b/utils.h @@ -147,12 +147,16 @@ struct btrfs_convert_context { void *fs_data; }; +#define PREP_DEVICE_ZERO_END (1U << 0) +#define PREP_DEVICE_DISCARD (1U << 1) +#define PREP_DEVICE_VERBOSE (1U << 2) + int make_btrfs(int fd, struct btrfs_mkfs_config *cfg, struct btrfs_convert_context *cctx); int btrfs_make_root_dir(struct btrfs_trans_handle *trans, struct btrfs_root *root, u64 objectid); -int btrfs_prepare_device(int fd, const char *file, int zero_end, - u64 *block_count_ret, u64 max_block_count, int discard); +int btrfs_prepare_device(int fd, const char *file, u64 *block_count_ret, + u64 max_block_count, unsigned opflags); int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, struct btrfs_root *root, int fd, char *path, u64 block_count, u32 io_width, u32 io_align, -- cgit v1.2.3