btrfs-progs: convert: move convert_read_used_space
authorDavid Sterba <dsterba@suse.com>
Tue, 23 Aug 2016 15:46:25 +0000 (17:46 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 24 Aug 2016 12:37:36 +0000 (14:37 +0200)
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-convert.c

index b4278a9..50e45a1 100644 (file)
@@ -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)