Skip to content

Commit a909c17

Browse files
Matthew Wilcox (Oracle)Jaegeuk Kim
authored andcommitted
f2fs: Use a folio in f2fs_all_cluster_page_ready()
Remove references to page->index and use folio_test_uptodate() instead of PageUptodate(). Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 40384c8 commit a909c17

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fs/f2fs/compress.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index)
846846
bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages,
847847
int index, int nr_pages, bool uptodate)
848848
{
849-
unsigned long pgidx = pages[index]->index;
849+
unsigned long pgidx = page_folio(pages[index])->index;
850850
int i = uptodate ? 0 : 1;
851851

852852
/*
@@ -860,9 +860,11 @@ bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages,
860860
return false;
861861

862862
for (; i < cc->cluster_size; i++) {
863-
if (pages[index + i]->index != pgidx + i)
863+
struct folio *folio = page_folio(pages[index + i]);
864+
865+
if (folio->index != pgidx + i)
864866
return false;
865-
if (uptodate && !PageUptodate(pages[index + i]))
867+
if (uptodate && !folio_test_uptodate(folio))
866868
return false;
867869
}
868870

0 commit comments

Comments
 (0)