aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2010-09-21 14:21:34 -0400
committerChris Mason <chris.mason@oracle.com>2010-10-29 09:26:36 -0400
commit88c2ba3b069f1e0f4694124d02985fa7620a19f1 (patch)
treee41859aca299e14e2658d75e2bf1ef2aea9ab077 /fs/btrfs/extent-tree.c
parent67377734fd24c32cbdfeb697c2e2bd7fed519e75 (diff)
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)
8198 if (cache_gen != 0 && 8198 if (cache_gen != 0 &&
8199 btrfs_super_generation(&root->fs_info->super_copy) != cache_gen) 8199 btrfs_super_generation(&root->fs_info->super_copy) != cache_gen)
8200 need_clear = 1; 8200 need_clear = 1;
8201 if (btrfs_test_opt(root, CLEAR_CACHE))
8202 need_clear = 1;
8201 8203
8202 while (1) { 8204 while (1) {
8203 ret = find_first_block_group(root, path, &key); 8205 ret = find_first_block_group(root, path, &key);