From 3c3c59f07725b97d1876d32a2e7945dbd387d30d Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 23 Aug 2016 17:46:25 +0200 Subject: [PATCH] btrfs-progs: convert: move convert_read_used_space Signed-off-by: David Sterba --- btrfs-convert.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c index b4278a9..50e45a1 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -920,6 +920,22 @@ out: } /* + * 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) -- 2.7.4