UPSTREAM: f2fs: convert f2fs_set_compressed_page() to use folio

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>
Change-Id: If26f6a07aeac58483fb27840dfde3e4d8780be46
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Li Zetao <lizetao1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 1efc78310c)
This commit is contained in:
Chao Yu 2024-08-20 22:55:02 +08:00 committed by Matthias Männich
parent bd5de9c701
commit 1d834ca736

View File

@ -90,11 +90,13 @@ bool f2fs_is_compressed_page(struct page *page)
static void f2fs_set_compressed_page(struct page *page, static void f2fs_set_compressed_page(struct page *page,
struct inode *inode, pgoff_t index, void *data) 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 */ /* i_crypto_info and iv index */
page->index = index; folio->index = index;
page->mapping = inode->i_mapping; folio->mapping = inode->i_mapping;
} }
static void f2fs_drop_rpages(struct compress_ctx *cc, int len, bool unlock) static void f2fs_drop_rpages(struct compress_ctx *cc, int len, bool unlock)