mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-10 11:25:18 +02:00
UPSTREAM: f2fs: convert f2fs_compress_ctx_add_page() to use folio
onvert 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: I210373e222292c0b8a2dea3ffdf3702091f14d31
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 10de741a5d
)
This commit is contained in:
parent
ce066dfd49
commit
dea3620404
|
@ -160,17 +160,17 @@ void f2fs_destroy_compress_ctx(struct compress_ctx *cc, bool reuse)
|
||||||
cc->cluster_idx = NULL_CLUSTER;
|
cc->cluster_idx = NULL_CLUSTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct page *page)
|
void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct folio *folio)
|
||||||
{
|
{
|
||||||
unsigned int cluster_ofs;
|
unsigned int cluster_ofs;
|
||||||
|
|
||||||
if (!f2fs_cluster_can_merge_page(cc, page->index))
|
if (!f2fs_cluster_can_merge_page(cc, folio->index))
|
||||||
f2fs_bug_on(F2FS_I_SB(cc->inode), 1);
|
f2fs_bug_on(F2FS_I_SB(cc->inode), 1);
|
||||||
|
|
||||||
cluster_ofs = offset_in_cluster(cc, page->index);
|
cluster_ofs = offset_in_cluster(cc, folio->index);
|
||||||
cc->rpages[cluster_ofs] = page;
|
cc->rpages[cluster_ofs] = folio_page(folio, 0);
|
||||||
cc->nr_rpages++;
|
cc->nr_rpages++;
|
||||||
cc->cluster_idx = cluster_idx(cc, page->index);
|
cc->cluster_idx = cluster_idx(cc, folio->index);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_F2FS_FS_LZO
|
#ifdef CONFIG_F2FS_FS_LZO
|
||||||
|
@ -1113,7 +1113,7 @@ retry:
|
||||||
if (PageUptodate(page))
|
if (PageUptodate(page))
|
||||||
f2fs_put_page(page, 1);
|
f2fs_put_page(page, 1);
|
||||||
else
|
else
|
||||||
f2fs_compress_ctx_add_page(cc, page);
|
f2fs_compress_ctx_add_page(cc, page_folio(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!f2fs_cluster_is_empty(cc)) {
|
if (!f2fs_cluster_is_empty(cc)) {
|
||||||
|
@ -1143,7 +1143,7 @@ retry:
|
||||||
}
|
}
|
||||||
|
|
||||||
f2fs_wait_on_page_writeback(page, DATA, true, true);
|
f2fs_wait_on_page_writeback(page, DATA, true, true);
|
||||||
f2fs_compress_ctx_add_page(cc, page);
|
f2fs_compress_ctx_add_page(cc, page_folio(page));
|
||||||
|
|
||||||
if (!PageUptodate(page)) {
|
if (!PageUptodate(page)) {
|
||||||
release_and_retry:
|
release_and_retry:
|
||||||
|
|
|
@ -2451,7 +2451,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
|
||||||
if (ret)
|
if (ret)
|
||||||
goto set_error_page;
|
goto set_error_page;
|
||||||
|
|
||||||
f2fs_compress_ctx_add_page(&cc, &folio->page);
|
f2fs_compress_ctx_add_page(&cc, folio);
|
||||||
|
|
||||||
goto next_page;
|
goto next_page;
|
||||||
read_single_page:
|
read_single_page:
|
||||||
|
@ -3183,7 +3183,7 @@ continue_unlock:
|
||||||
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
||||||
if (f2fs_compressed_file(inode)) {
|
if (f2fs_compressed_file(inode)) {
|
||||||
folio_get(folio);
|
folio_get(folio);
|
||||||
f2fs_compress_ctx_add_page(&cc, &folio->page);
|
f2fs_compress_ctx_add_page(&cc, folio);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4321,7 +4321,7 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index);
|
||||||
bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages,
|
bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages,
|
||||||
int index, int nr_pages, bool uptodate);
|
int index, int nr_pages, bool uptodate);
|
||||||
bool f2fs_sanity_check_cluster(struct dnode_of_data *dn);
|
bool f2fs_sanity_check_cluster(struct dnode_of_data *dn);
|
||||||
void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct page *page);
|
void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct folio *folio);
|
||||||
int f2fs_write_multi_pages(struct compress_ctx *cc,
|
int f2fs_write_multi_pages(struct compress_ctx *cc,
|
||||||
int *submitted,
|
int *submitted,
|
||||||
struct writeback_control *wbc,
|
struct writeback_control *wbc,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user