linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: unify the read and writer locks for btrfs_subpage
@ 2024-10-07 21:58 Qu Wenruo
  2024-10-07 21:58 ` [PATCH 1/2] btrfs: unify to use writer locks for subpage locking Qu Wenruo
  2024-10-07 21:58 ` [PATCH 2/2] btrfs: rename btrfs_folio_(set|start|end)_writer_lock() Qu Wenruo
  0 siblings, 2 replies; 5+ messages in thread
From: Qu Wenruo @ 2024-10-07 21:58 UTC (permalink / raw)
  To: linux-btrfs

When the handling of sector size < page size is introduced, there are
two types of locking, reader and writer lock.

The main reason for the reader lock is to handle metadata to make sure
the page::private is not released when there is still a metadata being
read.

However since commit d7172f52e993 ("btrfs: use per-buffer locking for
extent_buffer reading"), metadata read no longer relies on
btrfs_subpage::readers.

Making the writer lock as the only utilized subpage locking.

This patchset converts all the existing reader lock usage and rename the
writer lock into a generic lock.

This patchset relies on this patch "btrfs: fix the delalloc range
locking if sector size < page size", as it removes the last user of
btrfs_folio_start_writer_lock().

Qu Wenruo (2):
  btrfs: unify to use writer locks for subpage locking
  btrfs: rename btrfs_folio_(set|start|end)_writer_lock()

 fs/btrfs/compression.c |   3 +-
 fs/btrfs/extent_io.c   |  20 +++----
 fs/btrfs/subpage.c     | 126 ++++++++---------------------------------
 fs/btrfs/subpage.h     |  33 ++++-------
 4 files changed, 44 insertions(+), 138 deletions(-)

-- 
2.46.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-08 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 21:58 [PATCH 0/2] btrfs: unify the read and writer locks for btrfs_subpage Qu Wenruo
2024-10-07 21:58 ` [PATCH 1/2] btrfs: unify to use writer locks for subpage locking Qu Wenruo
2024-10-07 21:58 ` [PATCH 2/2] btrfs: rename btrfs_folio_(set|start|end)_writer_lock() Qu Wenruo
2024-10-08 17:09   ` David Sterba
2024-10-08 20:58     ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).