Commit 2ac0aa31 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: convert f2fs_write_data_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>
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Reviewed-by: default avatarLi Zetao <lizetao1@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent bcf4d2dd
...@@ -2945,22 +2945,23 @@ int f2fs_write_single_data_page(struct folio *folio, int *submitted, ...@@ -2945,22 +2945,23 @@ int f2fs_write_single_data_page(struct folio *folio, int *submitted,
static int f2fs_write_data_page(struct page *page, static int f2fs_write_data_page(struct page *page,
struct writeback_control *wbc) struct writeback_control *wbc)
{ {
struct folio *folio = page_folio(page);
#ifdef CONFIG_F2FS_FS_COMPRESSION #ifdef CONFIG_F2FS_FS_COMPRESSION
struct inode *inode = page->mapping->host; struct inode *inode = folio->mapping->host;
if (unlikely(f2fs_cp_error(F2FS_I_SB(inode)))) if (unlikely(f2fs_cp_error(F2FS_I_SB(inode))))
goto out; goto out;
if (f2fs_compressed_file(inode)) { if (f2fs_compressed_file(inode)) {
if (f2fs_is_compressed_cluster(inode, page->index)) { if (f2fs_is_compressed_cluster(inode, folio->index)) {
redirty_page_for_writepage(wbc, page); folio_redirty_for_writepage(wbc, folio);
return AOP_WRITEPAGE_ACTIVATE; return AOP_WRITEPAGE_ACTIVATE;
} }
} }
out: out:
#endif #endif
return f2fs_write_single_data_page(page_folio(page), NULL, NULL, NULL, return f2fs_write_single_data_page(folio, NULL, NULL, NULL,
wbc, FS_DATA_IO, 0, true); wbc, FS_DATA_IO, 0, true);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment