aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2012-03-09 16:01:49 -0500
committerChris Mason <chris.mason@oracle.com>2012-03-26 16:51:08 -0400
commit3083ee2e18b701122a3b841db83448543a87a583 (patch)
tree0265021499da54e5b4667a041f8b82c6d1a8667e /fs/btrfs/extent-tree.c
parent115391d2315239164e400a8259b26392afccf3bd (diff)
Btrfs: introduce free_extent_buffer_stale
Because btrfs cow's we can end up with extent buffers that are no longer necessary just sitting around in memory. So instead of evicting these pages, we could end up evicting things we actually care about. Thus we have free_extent_buffer_stale for use when we are freeing tree blocks. This will make it so that the ref for the eb being in the radix tree is dropped as soon as possible and then is freed when the refcount hits 0 instead of waiting to be released by releasepage. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9b7e7682fda0..1b831ac4c079 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5018,10 +5018,6 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
5018 if (is_data) { 5018 if (is_data) {
5019 ret = btrfs_del_csums(trans, root, bytenr, num_bytes); 5019 ret = btrfs_del_csums(trans, root, bytenr, num_bytes);
5020 BUG_ON(ret); 5020 BUG_ON(ret);
5021 } else {
5022 invalidate_mapping_pages(info->btree_inode->i_mapping,
5023 bytenr >> PAGE_CACHE_SHIFT,
5024 (bytenr + num_bytes - 1) >> PAGE_CACHE_SHIFT);
5025 } 5021 }
5026 5022
5027 ret = update_block_group(trans, root, bytenr, num_bytes, 0); 5023 ret = update_block_group(trans, root, bytenr, num_bytes, 0);
@@ -6022,6 +6018,7 @@ struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans,
6022 btrfs_set_buffer_lockdep_class(root->root_key.objectid, buf, level); 6018 btrfs_set_buffer_lockdep_class(root->root_key.objectid, buf, level);
6023 btrfs_tree_lock(buf); 6019 btrfs_tree_lock(buf);
6024 clean_tree_block(trans, root, buf); 6020 clean_tree_block(trans, root, buf);
6021 clear_bit(EXTENT_BUFFER_STALE, &buf->bflags);
6025 6022
6026 btrfs_set_lock_blocking(buf); 6023 btrfs_set_lock_blocking(buf);
6027 btrfs_set_buffer_uptodate(buf); 6024 btrfs_set_buffer_uptodate(buf);