btrfs-progs: convert: move convert_read_used_space

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2016-08-23 17:46:25 +02:00
parent 52df1d80a3
commit 3c3c59f077
1 changed files with 16 additions and 16 deletions

View File

@ -919,6 +919,22 @@ out:
return ret;
}
/*
* Read used space, and since we have the used space,
* calcuate data_chunks and free for later mkfs
*/
static int convert_read_used_space(struct btrfs_convert_context *cctx)
{
int ret;
ret = cctx->convert_ops->read_used_space(cctx);
if (ret)
return ret;
ret = calculate_available_space(cctx);
return ret;
}
/*
* Open Ext2fs in readonly mode, read block allocation bitmap and
* inode bitmap into memory.
@ -2257,22 +2273,6 @@ static int convert_open_fs(const char *devname,
return -1;
}
/*
* Read used space, and since we have the used space,
* calcuate data_chunks and free for later mkfs
*/
static int convert_read_used_space(struct btrfs_convert_context *cctx)
{
int ret;
ret = cctx->convert_ops->read_used_space(cctx);
if (ret)
return ret;
ret = calculate_available_space(cctx);
return ret;
}
static int do_convert(const char *devname, int datacsum, int packing,
int noxattr, u32 nodesize, int copylabel, const char *fslabel,
int progress, u64 features)