mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
btrfs: free cached state outside critical section in wait_extent_bit()
There's no need to free the cached extent state record while holding the io tree's spinlock, it's just making the critical section longer than it needs to be. So just do it after unlocking the io tree. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
87f5c3139e
commit
0611e2ad02
|
|
@ -877,13 +877,13 @@ static void wait_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
|
|||
}
|
||||
}
|
||||
out:
|
||||
spin_unlock(&tree->lock);
|
||||
/* This state is no longer useful, clear it and free it up. */
|
||||
if (cached_state && *cached_state) {
|
||||
state = *cached_state;
|
||||
*cached_state = NULL;
|
||||
btrfs_free_extent_state(state);
|
||||
}
|
||||
spin_unlock(&tree->lock);
|
||||
}
|
||||
|
||||
static void cache_state_if_flags(struct extent_state *state,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user