f2fs: convert f2fs_set_compressed_page() to use folio
authorChao Yu <chao@kernel.org>
Tue, 20 Aug 2024 14:55:02 +0000 (22:55 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 6 Sep 2024 23:04:48 +0000 (23:04 +0000)
Convert to use folio, so that we can get rid of 'page->index' to
prepare for removal of 'index' field in structure page [1].

[1] https://lore.kernel.org/all/Zp8fgUSIBGQ1TN0D@casper.infradead.org/

Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Li Zetao <lizetao1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/compress.c

index 630bb78655d52de63fc2bc554310787a55024235..e642c869db4aec326312b050f164008c4802ee4b 100644 (file)
@@ -90,11 +90,13 @@ bool f2fs_is_compressed_page(struct page *page)
 static void f2fs_set_compressed_page(struct page *page,
                struct inode *inode, pgoff_t index, void *data)
 {
-       attach_page_private(page, (void *)data);
+       struct folio *folio = page_folio(page);
+
+       folio_attach_private(folio, (void *)data);
 
        /* i_crypto_info and iv index */
-       page->index = index;
-       page->mapping = inode->i_mapping;
+       folio->index = index;
+       folio->mapping = inode->i_mapping;
 }
 
 static void f2fs_drop_rpages(struct compress_ctx *cc, int len, bool unlock)