2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public
4 * License v2 as published by the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 * General Public License for more details.
11 * You should have received a copy of the GNU General Public
12 * License along with this program; if not, write to the
13 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
14 * Boston, MA 021110-1307, USA.
18 * Defines and function declarations for users of the mkfs API, no internal
22 #ifndef __BTRFS_CONVERT_COMMON_H__
23 #define __BTRFS_CONVERT_COMMON_H__
25 #include "kerncompat.h"
26 #include "common-defs.h"
27 #include "extent-cache.h"
29 struct btrfs_mkfs_config;
31 struct btrfs_convert_context {
36 u64 free_inodes_count;
39 const struct btrfs_convert_operations *convert_ops;
41 /* The accurate used space of old filesystem */
42 struct cache_tree used_space;
44 /* Batched ranges which must be covered by data chunks */
45 struct cache_tree data_chunks;
47 /* Free space which is not covered by data_chunks */
48 struct cache_tree free_space;
53 int make_convert_btrfs(int fd, struct btrfs_mkfs_config *cfg,
54 struct btrfs_convert_context *cctx);