summaryrefslogtreecommitdiff
path: root/extent_io.c
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2015-09-29 20:51:45 -0700
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:02:54 +0100
commite4797df6a9fac329fdb168f8fd6bf1925ead3c28 (patch)
treeb654c6f772fa2506638c8a3d3dae0a5bbe32d6a1 /extent_io.c
parentd8c537e71f3dce8a8d03dddfcbcac71ef2e2cdc4 (diff)
downloadbtrfs-progs-e4797df6a9fac329fdb168f8fd6bf1925ead3c28.tar.gz
btrfs-progs: check the free space tree in btrfsck
This reuses the existing code for checking the free space cache, we just need to load the free space tree. While we do that, we check a couple of invariants on the free space tree itself. This requires pulling in some code from the kernel to exclude the super stripes. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent_io.c')
-rw-r--r--extent_io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/extent_io.c b/extent_io.c
index 75496ce..88e9273 100644
--- a/extent_io.c
+++ b/extent_io.c
@@ -884,3 +884,9 @@ void memset_extent_buffer(struct extent_buffer *eb, char c,
{
memset(eb->data + start, c, len);
}
+
+int extent_buffer_test_bit(struct extent_buffer *eb, unsigned long start,
+ unsigned long nr)
+{
+ return test_bit(nr, (unsigned long *)(eb->data + start));
+}