diff options
author | David Sterba <dsterba@suse.com> | 2015-07-01 17:49:21 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-07-01 17:49:21 +0200 |
commit | df4de2c089a4213ffad4681d90bd333db8d2192a (patch) | |
tree | 36de0797d18d2ec59cdeb9c15af5ba3d97b26bf5 /mkfs.c | |
parent | f7a18e4cab7bd11aeb14943234cba7af9359989a (diff) |
btrfs-progs: move make_btrfs arguments to a struct
No functional change, just introduce the structure and switch current
users.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r-- | mkfs.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1187,7 +1187,6 @@ int main(int ac, char **av) int discard = 1; int ssd = 0; int force_overwrite = 0; - char *source_dir = NULL; int source_dir_set = 0; u64 num_of_meta_chunks = 0; @@ -1198,6 +1197,7 @@ int main(int ac, char **av) char fs_uuid[BTRFS_UUID_UNPARSED_SIZE] = { 0 }; u64 features = BTRFS_MKFS_DEFAULT_FEATURES; struct mkfs_allocation allocation = { 0 }; + struct btrfs_mkfs_config mkfs_cfg; while(1) { int c; @@ -1507,8 +1507,16 @@ int main(int ac, char **av) features |= BTRFS_FEATURE_INCOMPAT_RAID56; } - ret = make_btrfs(fd, file, label, fs_uuid, blocks, dev_block_count, - nodesize, sectorsize, stripesize, features); + mkfs_cfg.label = label; + mkfs_cfg.fs_uuid = fs_uuid; + memcpy(mkfs_cfg.blocks, blocks, sizeof(blocks)); + mkfs_cfg.num_bytes = dev_block_count; + mkfs_cfg.nodesize = nodesize; + mkfs_cfg.sectorsize = sectorsize; + mkfs_cfg.stripesize = stripesize; + mkfs_cfg.features = features; + + ret = make_btrfs(fd, file, &mkfs_cfg); if (ret) { fprintf(stderr, "error during mkfs: %s\n", strerror(-ret)); exit(1); |