btrfs-progs: check/lowmem: Fix false alert of data extent backref lost for snapshot
[platform/upstream/btrfs-progs.git] / convert / common.h
1 /*
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.
5  *
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.
10  *
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.
15  */
16
17 /*
18  * Defines and function declarations for users of the mkfs API, no internal
19  * defintions.
20  */
21
22 #ifndef __BTRFS_CONVERT_COMMON_H__
23 #define __BTRFS_CONVERT_COMMON_H__
24
25 #include "kerncompat.h"
26 #include "common-defs.h"
27 #include "extent-cache.h"
28
29 struct btrfs_mkfs_config;
30
31 struct btrfs_convert_context {
32         u32 blocksize;
33         u64 first_data_block;
34         u64 block_count;
35         u64 inodes_count;
36         u64 free_inodes_count;
37         u64 total_bytes;
38         char *volume_name;
39         const struct btrfs_convert_operations *convert_ops;
40
41         /* The accurate used space of old filesystem */
42         struct cache_tree used_space;
43
44         /* Batched ranges which must be covered by data chunks */
45         struct cache_tree data_chunks;
46
47         /* Free space which is not covered by data_chunks */
48         struct cache_tree free_space;
49
50         void *fs_data;
51 };
52
53 int make_convert_btrfs(int fd, struct btrfs_mkfs_config *cfg,
54                               struct btrfs_convert_context *cctx);
55
56 #endif