aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorZheng Yan <zheng.yan@oracle.com>2008-09-26 10:04:53 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-26 10:04:53 -0400
commite465768938f95388723b0fd3c50a0ae48173edb9 (patch)
tree0f624a9a98dedfafae902e12b384d27e1100cd3a /fs/btrfs/disk-io.c
parentBtrfs: allocator fixes for space balancing update (diff)
downloadlinux-dev-e465768938f95388723b0fd3c50a0ae48173edb9.tar.xz
linux-dev-e465768938f95388723b0fd3c50a0ae48173edb9.zip
Btrfs: Add shared reference cache
Btrfs has a cache of reference counts in leaves, allowing it to avoid reading tree leaves while deleting snapshots. To reduce contention with multiple subvolumes, this cache is private to each subvolume. This patch adds shared reference cache support. The new space balancing code plays with multiple subvols at the same time, So the old per-subvol reference cache is not well suited. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 71e81f3a765b..8969fee23318 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1406,6 +1406,8 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fs_info->btree_inode->i_mapping, GFP_NOFS);
fs_info->do_barriers = 1;
+ btrfs_leaf_ref_tree_init(&fs_info->shared_ref_tree);
+
BTRFS_I(fs_info->btree_inode)->root = tree_root;
memset(&BTRFS_I(fs_info->btree_inode)->location, 0,
sizeof(struct btrfs_key));