diff mbox series

[f2fs-dev,02/11] f2fs: Use a folio in f2fs_compress_write_end()

Message ID 20241128045828.527559-3-willy@infradead.org (mailing list archive)
State Accepted
Commit ff6c82a934f7b5df8702579d921209c5ca336102
Headers show
Series f2fs folio patches | expand

Commit Message

Matthew Wilcox Nov. 28, 2024, 4:58 a.m. UTC
This removes an access of page->index.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/f2fs/compress.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index 9f8d0f4c8564..c91a2e4fe60c 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -1197,7 +1197,8 @@  bool f2fs_compress_write_end(struct inode *inode, void *fsdata,
 		.cluster_size = F2FS_I(inode)->i_cluster_size,
 		.rpages = fsdata,
 	};
-	bool first_index = (index == cc.rpages[0]->index);
+	struct folio *folio = page_folio(cc.rpages[0]);
+	bool first_index = (index == folio->index);
 
 	if (copied)
 		set_cluster_dirty(&cc);