Commit dfc9e301 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

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: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1a48259d
...@@ -7187,13 +7187,12 @@ struct extent_map *btrfs_create_io_em(struct btrfs_inode *inode, u64 start, ...@@ -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 * for subpage spinlock. So this function is to spin and wait for subpage
* spinlock. * 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 btrfs_fs_info *fs_info = folio_to_fs_info(folio);
struct folio *folio = page_folio(page);
struct btrfs_subpage *subpage; struct btrfs_subpage *subpage;
if (!btrfs_is_subpage(fs_info, page->mapping)) if (!btrfs_is_subpage(fs_info, folio->mapping))
return; return;
ASSERT(folio_test_private(folio) && folio_get_private(folio)); ASSERT(folio_test_private(folio) && folio_get_private(folio));
...@@ -7223,7 +7222,7 @@ static int btrfs_launder_folio(struct folio *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) static bool __btrfs_release_folio(struct folio *folio, gfp_t gfp_flags)
{ {
if (try_release_extent_mapping(&folio->page, 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); clear_page_extent_mapped(&folio->page);
return true; return true;
} }
...@@ -7284,7 +7283,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset, ...@@ -7284,7 +7283,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
* do double ordered extent accounting on the same folio. * do double ordered extent accounting on the same folio.
*/ */
folio_wait_writeback(folio); folio_wait_writeback(folio);
wait_subpage_spinlock(&folio->page); wait_subpage_spinlock(folio);
/* /*
* For subpage case, we have call sites like * For subpage case, we have call sites like
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment