Commit b666a9cd authored by David Sterba's avatar David Sterba

btrfs: add barrier for waitqueue_active in clear_btree_io_tree

waitqueue_active should be preceded by a barrier, in this function we
don't need to call it all the time.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 730d9ec3
......@@ -82,6 +82,12 @@ void btrfs_put_transaction(struct btrfs_transaction *transaction)
static void clear_btree_io_tree(struct extent_io_tree *tree)
{
spin_lock(&tree->lock);
/*
* Do a single barrier for the waitqueue_active check here, the state
* of the waitqueue should not change once clear_btree_io_tree is
* called.
*/
smp_mb();
while (!RB_EMPTY_ROOT(&tree->state)) {
struct rb_node *node;
struct extent_state *state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment