Skip to content

Commit

Permalink
Btrfs: Don't wait on tree block writeback before freeing them anymore
Browse files Browse the repository at this point in the history
This isn't required anymore because we don't reallocate blocks that
have already been written in this transaction.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent e015640 commit 699122f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,6 @@ static int balance_level(struct btrfs_trans_handle *trans,
add_root_to_dirty_list(root);
path->nodes[level] = NULL;
clean_tree_block(trans, root, mid);
wait_on_tree_block_writeback(root, mid);
/* once for the path */
free_extent_buffer(mid);
ret = btrfs_free_extent(trans, root, mid->start, mid->len,
Expand Down Expand Up @@ -810,7 +809,6 @@ static int balance_level(struct btrfs_trans_handle *trans,
u32 blocksize = right->len;

clean_tree_block(trans, root, right);
wait_on_tree_block_writeback(root, right);
free_extent_buffer(right);
right = NULL;
wret = del_ptr(trans, root, path, level + 1, pslot +
Expand Down Expand Up @@ -854,7 +852,6 @@ static int balance_level(struct btrfs_trans_handle *trans,
u64 bytenr = mid->start;
u32 blocksize = mid->len;
clean_tree_block(trans, root, mid);
wait_on_tree_block_writeback(root, mid);
free_extent_buffer(mid);
mid = NULL;
wret = del_ptr(trans, root, path, level + 1, pslot);
Expand Down Expand Up @@ -2638,7 +2635,6 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
} else {
u64 root_gen = btrfs_header_generation(path->nodes[1]);
clean_tree_block(trans, root, leaf);
wait_on_tree_block_writeback(root, leaf);
wret = del_ptr(trans, root, path, 1, path->slots[1]);
if (wret)
ret = wret;
Expand Down Expand Up @@ -2690,7 +2686,6 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
path->nodes[1]);

clean_tree_block(trans, root, leaf);
wait_on_tree_block_writeback(root, leaf);

wret = del_ptr(trans, root, path, 1, slot);
if (wret)
Expand Down
1 change: 0 additions & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,6 @@ struct extent_buffer *__btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
}
btrfs_set_header_generation(buf, trans->transid);
clean_tree_block(trans, root, buf);
wait_on_tree_block_writeback(root, buf);
btrfs_set_buffer_uptodate(buf);

if (PageDirty(buf->first_page)) {
Expand Down
2 changes: 2 additions & 0 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,11 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)
struct btrfs_csum_item *item;
struct btrfs_path *path = NULL;
u32 csum;

if (btrfs_test_opt(root, NODATASUM) ||
btrfs_test_flag(inode, NODATASUM))
return 0;

mutex_lock(&root->fs_info->fs_mutex);
path = btrfs_alloc_path();
item = btrfs_lookup_csum(NULL, root, path, inode->i_ino, start, 0);
Expand Down

0 comments on commit 699122f

Please sign in to comment.