Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Li Zetao <lizetao1@huawei.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Li Zetao and committed by
David Sterba
dd0a8df4 08dd8507

+3 -3
+3 -3
fs/btrfs/extent_io.c
··· 2303 2303 * to drop the page. 2304 2304 */ 2305 2305 static bool try_release_extent_state(struct extent_io_tree *tree, 2306 - struct page *page, gfp_t mask) 2306 + struct folio *folio, gfp_t mask) 2307 2307 { 2308 - u64 start = page_offset(page); 2308 + u64 start = folio_pos(folio); 2309 2309 u64 end = start + PAGE_SIZE - 1; 2310 2310 bool ret; 2311 2311 ··· 2414 2414 cond_resched(); 2415 2415 } 2416 2416 } 2417 - return try_release_extent_state(io_tree, page, mask); 2417 + return try_release_extent_state(io_tree, folio, mask); 2418 2418 } 2419 2419 2420 2420 static void __free_extent_buffer(struct extent_buffer *eb)