]> www.infradead.org Git - nvme.git/commit
btrfs: subpage: introduce helpers to handle subpage delalloc locking
authorQu Wenruo <wqu@suse.com>
Mon, 19 Feb 2024 02:43:24 +0000 (13:13 +1030)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:22 +0000 (15:33 +0200)
commitbca707e54276de828a8cad82b723192374e73e00
tree32156c6179ca140ca055148e66e358a5486b1589
parent21b5bef20ef89795882f0b1bf5517fb283c16461
btrfs: subpage: introduce helpers to handle subpage delalloc locking

Three new helpers are introduced for the incoming subpage delalloc locking
change.

- btrfs_folio_set_writer_lock()
  This is to mark specified range with subpage specific writer lock.
  After calling this, the subpage range can be proper unlocked by
  btrfs_folio_end_writer_lock()

- btrfs_subpage_find_writer_locked()
  This is to find the writer locked subpage range in a page.
  With the help of btrfs_folio_set_writer_lock(), it can allow us to
  record and find previously locked subpage range without extra memory
  allocation.

- btrfs_folio_end_all_writers()
  This is for the locked_page of __extent_writepage(), as there may be
  multiple subpage delalloc ranges locked.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/subpage.c
fs/btrfs/subpage.h