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>
This commit is contained in:
Josef Bacik
2010-09-21 14:21:34 -04:00
committed by Chris Mason
parent 67377734fd
commit 88c2ba3b06
4 changed files with 8 additions and 3 deletions

View File

@@ -242,8 +242,6 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
*/
spin_lock(&block_group->lock);
if (block_group->disk_cache_state != BTRFS_DC_WRITTEN) {
printk(KERN_ERR "not reading block group %llu, dcs is %d\n", block_group->key.objectid,
block_group->disk_cache_state);
spin_unlock(&block_group->lock);
return 0;
}