From 811d6de7ef1da21fc5eeb760da087fd7366ea846 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 7 Dec 2022 17:28:11 -0500 Subject: [PATCH] btrfs: tree-log: change how we wait on writeback This is used in the tree-log code and is a holdover from previous iterations of extent buffer writeback. We can simply use wait_on_extent_buffer_writeback instead of filemap_fdatawait_range as it waits for the same bit EXTENT_BUFFER_WRITEBACK, and remove btrfs_wait_tree_block_writeback completely. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/tree-log.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 7bdc3159b30c58..a156712aa928c2 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -279,12 +279,6 @@ void btrfs_end_log_trans(struct btrfs_root *root) } } -static void btrfs_wait_tree_block_writeback(struct extent_buffer *buf) -{ - filemap_fdatawait_range(buf->pages[0]->mapping, - buf->start, buf->start + buf->len - 1); -} - /* * the walk control struct is used to pass state down the chain when * processing the log tree. The stage field tells us which part @@ -2625,7 +2619,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, btrfs_tree_lock(next); btrfs_clear_buffer_dirty(next); - btrfs_wait_tree_block_writeback(next); + wait_on_extent_buffer_writeback(next); btrfs_tree_unlock(next); if (trans) { @@ -2694,7 +2688,7 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans, btrfs_tree_lock(next); btrfs_clear_buffer_dirty(next); - btrfs_wait_tree_block_writeback(next); + wait_on_extent_buffer_writeback(next); btrfs_tree_unlock(next); if (trans) { @@ -2775,7 +2769,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans, btrfs_tree_lock(next); btrfs_clear_buffer_dirty(next); - btrfs_wait_tree_block_writeback(next); + wait_on_extent_buffer_writeback(next); btrfs_tree_unlock(next); if (trans) {