path: root/utils.h
diff options
authorDavid Sterba <>2016-07-28 01:47:40 +0200
committerDavid Sterba <>2016-07-28 14:08:30 +0200
commit5407ee85fcaba91c9a0207ffad97a9b8b1c45c8c (patch)
tree8b9e427c1995e4dbea858746dbe5a7a33875953d /utils.h
parent9c92c4eb92c41860819a5c9e25972451541f1b02 (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 <>
Diffstat (limited to 'utils.h')
1 files changed, 6 insertions, 2 deletions
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,