aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-05-02 15:53:43 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-05-02 15:53:43 -0400
commit35b7e476107e3d54f03384e0f2fa3dfd68933353 (patch)
tree51a7e7cffad309b0aa0d3d054d7ecc5b8be72298 /fs/btrfs/extent-tree.c
parent090d18753c7fb73f7d846c3a89a50cd35136d144 (diff)
Btrfs: fix page cache memory leak
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2837fddf7b1c..0e20d1c42fca 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -322,18 +322,10 @@ static int update_block_group(struct btrfs_trans_handle *trans,
322 return 0; 322 return 0;
323} 323}
324 324
325static int try_remove_page(struct address_space *mapping, unsigned long index)
326{
327 int ret;
328 ret = invalidate_mapping_pages(mapping, index, index);
329 return ret;
330}
331
332int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct 325int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
333 btrfs_root *root) 326 btrfs_root *root)
334{ 327{
335 unsigned long gang[8]; 328 unsigned long gang[8];
336 struct inode *btree_inode = root->fs_info->btree_inode;
337 u64 first = 0; 329 u64 first = 0;
338 int ret; 330 int ret;
339 int i; 331 int i;
@@ -348,9 +340,6 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
348 first = gang[0]; 340 first = gang[0];
349 for (i = 0; i < ret; i++) { 341 for (i = 0; i < ret; i++) {
350 clear_radix_bit(pinned_radix, gang[i]); 342 clear_radix_bit(pinned_radix, gang[i]);
351 try_remove_page(btree_inode->i_mapping,
352 gang[i] << (PAGE_CACHE_SHIFT -
353 btree_inode->i_blkbits));
354 } 343 }
355 } 344 }
356 return 0; 345 return 0;
@@ -983,6 +972,7 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
983 break; 972 break;
984 if (wret < 0) 973 if (wret < 0)
985 ret = wret; 974 ret = wret;
975 btrfs_btree_balance_dirty(root);
986 } 976 }
987 for (i = 0; i <= orig_level; i++) { 977 for (i = 0; i <= orig_level; i++) {
988 if (path->nodes[i]) { 978 if (path->nodes[i]) {