aboutsummaryrefslogtreecommitdiffstats
path: root/extent_io.h
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2013-07-03 21:25:17 +0800
committerChris Mason <chris.mason@fusionio.com>2013-07-03 14:06:55 -0400
commit30d5c8a49f088d76fb2806240393fc035ed75290 (patch)
treef5a1652ad936c259f1cbc653a61384b3b2a31c2a /extent_io.h
parent65534643f6e919c39f58bef31ebcffd48d8b1895 (diff)
downloadbtrfs-progs-30d5c8a49f088d76fb2806240393fc035ed75290.tar.gz
btrfs-progs-30d5c8a49f088d76fb2806240393fc035ed75290.tar.xz
btrfs-progs-30d5c8a49f088d76fb2806240393fc035ed75290.zip
Btrfs-progs: Add chunk recover function - using old chunk items
Add chunk-recover program to check or rebuild chunk tree when the system chunk array or chunk tree is broken. Due to the importance of the system chunk array and chunk tree, if one of them is broken, the whole btrfs will be broken even other data are OK. But we have some hint(fsid, checksum...) to salvage the old metadata. So this function will first scan the whole file system and collect the needed data(chunk/block group/dev extent), and check for the references between them. If the references are OK, the chunk tree can be rebuilt and luckily the file system will be mountable. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'extent_io.h')
-rw-r--r--extent_io.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/extent_io.h b/extent_io.h
index a0308a9..2f5ff02 100644
--- a/extent_io.h
+++ b/extent_io.h
@@ -41,6 +41,12 @@
#define EXTENT_CSUM (1 << 9)
#define EXTENT_IOBITS (EXTENT_LOCKED | EXTENT_WRITEBACK)
+#define BLOCK_GROUP_DATA EXTENT_WRITEBACK
+#define BLOCK_GROUP_METADATA EXTENT_UPTODATE
+#define BLOCK_GROUP_SYSTEM EXTENT_NEW
+
+#define BLOCK_GROUP_DIRTY EXTENT_DIRTY
+
struct btrfs_fs_info;
struct extent_io_tree {