summaryrefslogtreecommitdiff
path: root/btrfs-convert.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2016-01-29 13:03:14 +0800
committerDavid Sterba <dsterba@suse.com>2016-06-07 18:15:19 +0200
commit330ca2d6dfe074fd14798ba7a60d6fda43ab932a (patch)
tree4b90f39c8946c56ec449fbb374d8bc686f1bfda4 /btrfs-convert.c
parent522ef705e38fdb9ae952344b454da392e60dc90d (diff)
btrfs-progs: utils: Introduce new function for convert
Introduce new function make_convert_btrfs() for convert. This new function will have the following features: 1) Allocate temporary sb/metadata/system chunk, avoiding old used data 2) More structured functions No more over 1000 lines function, better function split and code reuse This will finally replace current make_btrfs(), but now only used for convert. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-convert.c')
-rw-r--r--btrfs-convert.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c
index 89df815f..36ffba09 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -108,28 +108,6 @@ struct btrfs_convert_operations {
void (*close_fs)(struct btrfs_convert_context *cctx);
};
-struct btrfs_convert_context {
- u32 blocksize;
- u32 first_data_block;
- u32 block_count;
- u32 inodes_count;
- u32 free_inodes_count;
- u64 total_bytes;
- char *volume_name;
- const struct btrfs_convert_operations *convert_ops;
-
- /* The accurate used space of old filesystem */
- struct cache_tree used;
-
- /* Batched ranges which must be covered by data chunks */
- struct cache_tree data_chunks;
-
- /* Free space which is not covered by data_chunks */
- struct cache_tree free;
-
- void *fs_data;
-};
-
static void init_convert_context(struct btrfs_convert_context *cctx)
{
cache_tree_init(&cctx->used);
@@ -2834,7 +2812,7 @@ static int do_convert(const char *devname, int datacsum, int packing, int noxatt
mkfs_cfg.stripesize = blocksize;
mkfs_cfg.features = features;
- ret = make_btrfs(fd, &mkfs_cfg);
+ ret = make_btrfs(fd, &mkfs_cfg, NULL);
if (ret) {
fprintf(stderr, "unable to create initial ctree: %s\n",
strerror(-ret));