Commit dd0a8df4 authored by Li Zetao's avatar Li Zetao Committed by David Sterba

btrfs: convert try_release_extent_state() to take a folio

The old page API is being gradually replaced and converted to use folio
to improve code readability and avoid repeated conversion between page
and folio. Moreover, use folio_pos() instead of page_offset(),
which is more consistent with folio usage.
Signed-off-by: default avatarLi Zetao <lizetao1@huawei.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 08dd8507
...@@ -2303,9 +2303,9 @@ int extent_invalidate_folio(struct extent_io_tree *tree, ...@@ -2303,9 +2303,9 @@ int extent_invalidate_folio(struct extent_io_tree *tree,
* to drop the page. * to drop the page.
*/ */
static bool try_release_extent_state(struct extent_io_tree *tree, static bool try_release_extent_state(struct extent_io_tree *tree,
struct page *page, gfp_t mask) struct folio *folio, gfp_t mask)
{ {
u64 start = page_offset(page); u64 start = folio_pos(folio);
u64 end = start + PAGE_SIZE - 1; u64 end = start + PAGE_SIZE - 1;
bool ret; bool ret;
...@@ -2414,7 +2414,7 @@ bool try_release_extent_mapping(struct page *page, gfp_t mask) ...@@ -2414,7 +2414,7 @@ bool try_release_extent_mapping(struct page *page, gfp_t mask)
cond_resched(); cond_resched();
} }
} }
return try_release_extent_state(io_tree, page, mask); return try_release_extent_state(io_tree, folio, mask);
} }
static void __free_extent_buffer(struct extent_buffer *eb) static void __free_extent_buffer(struct extent_buffer *eb)
......
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