mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 22:50:54 -04:00
btrfs: convert wait_subpage_spinlock() to only use a folio
Currently this already uses a folio for most things, update it to take a folio and update all the page usage with the corresponding folio usage. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
1a48259d9b
commit
dfc9e3017a
@@ -7187,13 +7187,12 @@ struct extent_map *btrfs_create_io_em(struct btrfs_inode *inode, u64 start,
|
||||
* for subpage spinlock. So this function is to spin and wait for subpage
|
||||
* spinlock.
|
||||
*/
|
||||
static void wait_subpage_spinlock(struct page *page)
|
||||
static void wait_subpage_spinlock(struct folio *folio)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = page_to_fs_info(page);
|
||||
struct folio *folio = page_folio(page);
|
||||
struct btrfs_fs_info *fs_info = folio_to_fs_info(folio);
|
||||
struct btrfs_subpage *subpage;
|
||||
|
||||
if (!btrfs_is_subpage(fs_info, page->mapping))
|
||||
if (!btrfs_is_subpage(fs_info, folio->mapping))
|
||||
return;
|
||||
|
||||
ASSERT(folio_test_private(folio) && folio_get_private(folio));
|
||||
@@ -7223,7 +7222,7 @@ static int btrfs_launder_folio(struct folio *folio)
|
||||
static bool __btrfs_release_folio(struct folio *folio, gfp_t gfp_flags)
|
||||
{
|
||||
if (try_release_extent_mapping(&folio->page, gfp_flags)) {
|
||||
wait_subpage_spinlock(&folio->page);
|
||||
wait_subpage_spinlock(folio);
|
||||
clear_page_extent_mapped(&folio->page);
|
||||
return true;
|
||||
}
|
||||
@@ -7284,7 +7283,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
|
||||
* do double ordered extent accounting on the same folio.
|
||||
*/
|
||||
folio_wait_writeback(folio);
|
||||
wait_subpage_spinlock(&folio->page);
|
||||
wait_subpage_spinlock(folio);
|
||||
|
||||
/*
|
||||
* For subpage case, we have call sites like
|
||||
|
||||
Reference in New Issue
Block a user