Skip to content

Commit 2eaa98e

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: convert read_node_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/[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 4deccfb commit 2eaa98e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/f2fs/node.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,7 @@ struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs)
13691369
*/
13701370
static int read_node_page(struct page *page, blk_opf_t op_flags)
13711371
{
1372+
struct folio *folio = page_folio(page);
13721373
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
13731374
struct node_info ni;
13741375
struct f2fs_io_info fio = {
@@ -1381,21 +1382,21 @@ static int read_node_page(struct page *page, blk_opf_t op_flags)
13811382
};
13821383
int err;
13831384

1384-
if (PageUptodate(page)) {
1385+
if (folio_test_uptodate(folio)) {
13851386
if (!f2fs_inode_chksum_verify(sbi, page)) {
1386-
ClearPageUptodate(page);
1387+
folio_clear_uptodate(folio);
13871388
return -EFSBADCRC;
13881389
}
13891390
return LOCKED_PAGE;
13901391
}
13911392

1392-
err = f2fs_get_node_info(sbi, page->index, &ni, false);
1393+
err = f2fs_get_node_info(sbi, folio->index, &ni, false);
13931394
if (err)
13941395
return err;
13951396

13961397
/* NEW_ADDR can be seen, after cp_error drops some dirty node pages */
13971398
if (unlikely(ni.blk_addr == NULL_ADDR || ni.blk_addr == NEW_ADDR)) {
1398-
ClearPageUptodate(page);
1399+
folio_clear_uptodate(folio);
13991400
return -ENOENT;
14001401
}
14011402

0 commit comments

Comments
 (0)