btrfs: use per-buffer locking for extent_buffer reading
authorChristoph Hellwig <hch@lst.de>
Wed, 3 May 2023 15:24:40 +0000 (17:24 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:28 +0000 (13:59 +0200)
commitd7172f52e9933b6ec9305e7fe6e829e3939dba04
tree62101cc94eccc2825aa1c6ac82c6a5340e65dfa4
parent9e2aff90fc2ad2b94933762f5442fef9ee7a692e
btrfs: use per-buffer locking for extent_buffer reading

Instead of locking and unlocking every page or the extent, just add a
new EXTENT_BUFFER_READING bit that mirrors EXTENT_BUFFER_WRITEBACK
for synchronizing threads trying to read an extent_buffer and to wait
for I/O completion.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h