mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-08 18:35:20 +02:00
UPSTREAM: f2fs: convert f2fs_submit_page_read() 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: Ieaaef091c66c9a6ac86387397126d85a9b066a4d
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 1e5df24c17
)
This commit is contained in:
parent
fe2ff89b78
commit
4da60115e5
|
@ -1092,7 +1092,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
|
|||
}
|
||||
|
||||
/* This can handle encryption stuffs */
|
||||
static int f2fs_submit_page_read(struct inode *inode, struct page *page,
|
||||
static int f2fs_submit_page_read(struct inode *inode, struct folio *folio,
|
||||
block_t blkaddr, blk_opf_t op_flags,
|
||||
bool for_write)
|
||||
{
|
||||
|
@ -1100,14 +1100,14 @@ static int f2fs_submit_page_read(struct inode *inode, struct page *page,
|
|||
struct bio *bio;
|
||||
|
||||
bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
|
||||
page->index, for_write);
|
||||
folio->index, for_write);
|
||||
if (IS_ERR(bio))
|
||||
return PTR_ERR(bio);
|
||||
|
||||
/* wait for GCed page writeback via META_MAPPING */
|
||||
f2fs_wait_on_block_writeback(inode, blkaddr);
|
||||
|
||||
if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
|
||||
if (!bio_add_folio(bio, folio, PAGE_SIZE, 0)) {
|
||||
iostat_update_and_unbind_ctx(bio);
|
||||
if (bio->bi_private)
|
||||
mempool_free(bio->bi_private, bio_post_read_ctx_pool);
|
||||
|
@ -1275,7 +1275,7 @@ got_it:
|
|||
return page;
|
||||
}
|
||||
|
||||
err = f2fs_submit_page_read(inode, page, dn.data_blkaddr,
|
||||
err = f2fs_submit_page_read(inode, page_folio(page), dn.data_blkaddr,
|
||||
op_flags, for_write);
|
||||
if (err)
|
||||
goto put_err;
|
||||
|
@ -3690,8 +3690,8 @@ repeat:
|
|||
goto fail;
|
||||
}
|
||||
err = f2fs_submit_page_read(use_cow ?
|
||||
F2FS_I(inode)->cow_inode : inode, page,
|
||||
blkaddr, 0, true);
|
||||
F2FS_I(inode)->cow_inode : inode,
|
||||
page_folio(page), blkaddr, 0, true);
|
||||
if (err)
|
||||
goto fail;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user