Skip to content

Commit dd0a8df

Browse files
Li Zetaokdave
authored andcommitted
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 <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 08dd850 commit dd0a8df

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/btrfs/extent_io.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,9 +2303,9 @@ int extent_invalidate_folio(struct extent_io_tree *tree,
23032303
* to drop the page.
23042304
*/
23052305
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)
23072307
{
2308-
u64 start = page_offset(page);
2308+
u64 start = folio_pos(folio);
23092309
u64 end = start + PAGE_SIZE - 1;
23102310
bool ret;
23112311

@@ -2414,7 +2414,7 @@ bool try_release_extent_mapping(struct page *page, gfp_t mask)
24142414
cond_resched();
24152415
}
24162416
}
2417-
return try_release_extent_state(io_tree, page, mask);
2417+
return try_release_extent_state(io_tree, folio, mask);
24182418
}
24192419

24202420
static void __free_extent_buffer(struct extent_buffer *eb)

0 commit comments

Comments
 (0)