Skip to content

Commit 1e5df24

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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/[email protected]/ Cc: Matthew Wilcox <[email protected]> Signed-off-by: Chao Yu <[email protected]> Reviewed-by: Li Zetao <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 763a0dc commit 1e5df24

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/f2fs/data.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,22 +1086,22 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
10861086
}
10871087

10881088
/* This can handle encryption stuffs */
1089-
static int f2fs_submit_page_read(struct inode *inode, struct page *page,
1089+
static int f2fs_submit_page_read(struct inode *inode, struct folio *folio,
10901090
block_t blkaddr, blk_opf_t op_flags,
10911091
bool for_write)
10921092
{
10931093
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
10941094
struct bio *bio;
10951095

10961096
bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
1097-
page->index, for_write);
1097+
folio->index, for_write);
10981098
if (IS_ERR(bio))
10991099
return PTR_ERR(bio);
11001100

11011101
/* wait for GCed page writeback via META_MAPPING */
11021102
f2fs_wait_on_block_writeback(inode, blkaddr);
11031103

1104-
if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
1104+
if (!bio_add_folio(bio, folio, PAGE_SIZE, 0)) {
11051105
iostat_update_and_unbind_ctx(bio);
11061106
if (bio->bi_private)
11071107
mempool_free(bio->bi_private, bio_post_read_ctx_pool);
@@ -1269,7 +1269,7 @@ struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
12691269
return page;
12701270
}
12711271

1272-
err = f2fs_submit_page_read(inode, page, dn.data_blkaddr,
1272+
err = f2fs_submit_page_read(inode, page_folio(page), dn.data_blkaddr,
12731273
op_flags, for_write);
12741274
if (err)
12751275
goto put_err;
@@ -3668,8 +3668,8 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
36683668
goto fail;
36693669
}
36703670
err = f2fs_submit_page_read(use_cow ?
3671-
F2FS_I(inode)->cow_inode : inode, page,
3672-
blkaddr, 0, true);
3671+
F2FS_I(inode)->cow_inode : inode,
3672+
page_folio(page), blkaddr, 0, true);
36733673
if (err)
36743674
goto fail;
36753675

0 commit comments

Comments
 (0)