2 * Copyright (C) 2013 Fujitsu. All rights reserved.
3 * Written by Miao Xie <miaox@cn.fujitsu.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public
7 * License v2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 021110-1307, USA.
20 #ifndef __CHUNK_CHECK_H__
21 #define __CHUNK_CHECK_H__
23 #if BTRFS_FLAT_INCLUDES
24 #include "kerncompat.h"
25 #include "extent-cache.h"
28 #include <btrfs/kerncompat.h>
29 #include <btrfs/extent-cache.h>
30 #include <btrfs/list.h>
31 #endif /* BTRFS_FLAT_INCLUDES */
33 struct block_group_record {
34 struct cache_extent cache;
35 /* Used to identify the orphan block groups */
36 struct list_head list;
45 struct block_group_tree {
46 struct cache_tree tree;
47 struct list_head block_groups;
50 struct device_record {
70 struct cache_extent cache;
80 struct stripe stripes[0];
83 struct device_extent_record {
84 struct cache_extent cache;
86 * Used to identify the orphan device extents (the device extents
87 * don't belong to a chunk or a device)
89 struct list_head chunk_list;
90 struct list_head device_list;
101 struct device_extent_tree {
102 struct cache_tree tree;
105 * When checking the chunk information, we move the device extents
106 * that has its chunk to the chunk's device extents list. After the
107 * check, if there are still some device extents in no_chunk_orphans,
108 * it means there are some device extents which don't belong to any
111 * The usage of no_device_orphans is the same as the first one, but it
112 * is for the device information check.
114 struct list_head no_chunk_orphans;
115 struct list_head no_device_orphans;