summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik2010-09-21 20:21:34 +0200
committerChris Mason2010-10-29 15:26:36 +0200
commit88c2ba3b069f1e0f4694124d02985fa7620a19f1 (patch)
treee41859aca299e14e2658d75e2bf1ef2aea9ab077 /fs/btrfs/extent-tree.c
parentBtrfs: add support for mixed data+metadata block groups (diff)
downloadkernel-qcow2-linux-88c2ba3b069f1e0f4694124d02985fa7620a19f1.tar.gz
kernel-qcow2-linux-88c2ba3b069f1e0f4694124d02985fa7620a19f1.tar.xz
kernel-qcow2-linux-88c2ba3b069f1e0f4694124d02985fa7620a19f1.zip
Btrfs: Add a clear_cache mount option
If something goes wrong with the free space cache we need a way to make sure it's not loaded on mount and that it's cleared for everybody. When you pass the clear_cache option it will make it so all block groups are setup to be cleared, which keeps them from being loaded and then they will be truncated when the transaction is committed. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 137833e1fc26..1a94ee4c4fbb 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -8198,6 +8198,8 @@ int btrfs_read_block_groups(struct btrfs_root *root)
if (cache_gen != 0 &&
btrfs_super_generation(&root->fs_info->super_copy) != cache_gen)
need_clear = 1;
+ if (btrfs_test_opt(root, CLEAR_CACHE))
+ need_clear = 1;
while (1) {
ret = find_first_block_group(root, path, &key);