summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-10-03 20:07:49 +0200
committerJosef Bacik <josef@redhat.com>2011-10-19 21:12:51 +0200
commit73bc187680f94bed498f8a669103cad290e41180 (patch)
treee4e8c9a6baa656dbeb470032956657b294610c61 /fs/btrfs/transaction.c
parentBtrfs: only inherit btrfs specific flags when creating files (diff)
downloadlinux-73bc187680f94bed498f8a669103cad290e41180.tar.xz
linux-73bc187680f94bed498f8a669103cad290e41180.zip
Btrfs: introduce mount option no_space_cache
Some users have requested this and I've found I needed a way to disable cache loading without actually clearing the cache, so introduce the no_space_cache option. Before we check the super blocks cache generation field and if it was populated we always turned space caching on. Now we check this and set the space cache option on, and then parse the mount options so that if we want it off it get's turned off. Then we check the mount option all the places we do the caching work instead of checking the super's cache generation. This makes things more consistent and lets us turn space caching off. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 45655793a2c5..1e1a4816ccb0 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1003,7 +1003,7 @@ static void update_super_roots(struct btrfs_root *root)
super->root = root_item->bytenr;
super->generation = root_item->generation;
super->root_level = root_item->level;
- if (super->cache_generation != 0 || btrfs_test_opt(root, SPACE_CACHE))
+ if (btrfs_test_opt(root, SPACE_CACHE))
super->cache_generation = root_item->generation;
}