Skip to content

btrfs: unify the read and writer locks for btrfs_subpage

Qu Wenruo linux-btrfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- Rename btrfs_subpage::locked to btrfs_subpage::nr_locked

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: unify to use writer locks for subpage lockingfs/btrfs/compression.c fs/btrfs/extent_io.c fs/btrfs/subpage.c +1 more+5 -830 replies
2/2btrfs: rename btrfs_folio_(set|start|end)_writer_lock()fs/btrfs/compression.c fs/btrfs/extent_io.c fs/btrfs/subpage.c +1 more+43 -390 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Sterba
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] btrfs: unify the read and writer locks for btrfs_subpage

[CHANGELOG]
v2:
- Rename btrfs_subpage::locked to btrfs_subpage::nr_locked

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     | 108 ++++++++++-------------------------------
 fs/btrfs/subpage.h     |  33 +++++--------
 4 files changed, 45 insertions(+), 119 deletions(-)
Signature · 1 line
2.46.2