@@ -2812,13 +2812,12 @@ struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info,
2812
2812
}
2813
2813
#endif
2814
2814
2815
- static struct extent_buffer * grab_extent_buffer (
2816
- struct btrfs_fs_info * fs_info , struct page * page )
2815
+ static struct extent_buffer * grab_extent_buffer (struct btrfs_fs_info * fs_info ,
2816
+ struct folio * folio )
2817
2817
{
2818
- struct folio * folio = page_folio (page );
2819
2818
struct extent_buffer * exists ;
2820
2819
2821
- lockdep_assert_held (& page -> mapping -> i_private_lock );
2820
+ lockdep_assert_held (& folio -> mapping -> i_private_lock );
2822
2821
2823
2822
/*
2824
2823
* For subpage case, we completely rely on radix tree to ensure we
@@ -2833,7 +2832,7 @@ static struct extent_buffer *grab_extent_buffer(
2833
2832
return NULL ;
2834
2833
2835
2834
/*
2836
- * We could have already allocated an eb for this page and attached one
2835
+ * We could have already allocated an eb for this folio and attached one
2837
2836
* so lets see if we can get a ref on the existing eb, and if we can we
2838
2837
* know it's good and we can just return that one, else we know we can
2839
2838
* just overwrite folio private.
@@ -2842,7 +2841,7 @@ static struct extent_buffer *grab_extent_buffer(
2842
2841
if (atomic_inc_not_zero (& exists -> refs ))
2843
2842
return exists ;
2844
2843
2845
- WARN_ON (PageDirty ( page ));
2844
+ WARN_ON (folio_test_dirty ( folio ));
2846
2845
folio_detach_private (folio );
2847
2846
return NULL ;
2848
2847
}
@@ -2933,8 +2932,7 @@ static int attach_eb_folio_to_filemap(struct extent_buffer *eb, int i,
2933
2932
} else if (existing_folio ) {
2934
2933
struct extent_buffer * existing_eb ;
2935
2934
2936
- existing_eb = grab_extent_buffer (fs_info ,
2937
- folio_page (existing_folio , 0 ));
2935
+ existing_eb = grab_extent_buffer (fs_info , existing_folio );
2938
2936
if (existing_eb ) {
2939
2937
/* The extent buffer still exists, we can use it directly. */
2940
2938
* found_eb_ret = existing_eb ;
0 commit comments