Skip to content

Commit 4deccfb

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: convert __write_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 2ac0aa3 commit 4deccfb

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

fs/f2fs/node.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,6 +1608,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16081608
enum iostat_type io_type, unsigned int *seq_id)
16091609
{
16101610
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
1611+
struct folio *folio = page_folio(page);
16111612
nid_t nid;
16121613
struct node_info ni;
16131614
struct f2fs_io_info fio = {
@@ -1624,15 +1625,15 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16241625
};
16251626
unsigned int seq;
16261627

1627-
trace_f2fs_writepage(page_folio(page), NODE);
1628+
trace_f2fs_writepage(folio, NODE);
16281629

16291630
if (unlikely(f2fs_cp_error(sbi))) {
16301631
/* keep node pages in remount-ro mode */
16311632
if (F2FS_OPTION(sbi).errors == MOUNT_ERRORS_READONLY)
16321633
goto redirty_out;
1633-
ClearPageUptodate(page);
1634+
folio_clear_uptodate(folio);
16341635
dec_page_count(sbi, F2FS_DIRTY_NODES);
1635-
unlock_page(page);
1636+
folio_unlock(folio);
16361637
return 0;
16371638
}
16381639

@@ -1646,7 +1647,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16461647

16471648
/* get old block addr of this node page */
16481649
nid = nid_of_node(page);
1649-
f2fs_bug_on(sbi, page->index != nid);
1650+
f2fs_bug_on(sbi, folio->index != nid);
16501651

16511652
if (f2fs_get_node_info(sbi, nid, &ni, !do_balance))
16521653
goto redirty_out;
@@ -1660,10 +1661,10 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16601661

16611662
/* This page is already truncated */
16621663
if (unlikely(ni.blk_addr == NULL_ADDR)) {
1663-
ClearPageUptodate(page);
1664+
folio_clear_uptodate(folio);
16641665
dec_page_count(sbi, F2FS_DIRTY_NODES);
16651666
f2fs_up_read(&sbi->node_write);
1666-
unlock_page(page);
1667+
folio_unlock(folio);
16671668
return 0;
16681669
}
16691670

@@ -1684,7 +1685,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16841685
*seq_id = seq;
16851686
}
16861687

1687-
set_page_writeback(page);
1688+
folio_start_writeback(folio);
16881689

16891690
fio.old_blkaddr = ni.blk_addr;
16901691
f2fs_do_write_node_page(nid, &fio);
@@ -1697,7 +1698,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16971698
submitted = NULL;
16981699
}
16991700

1700-
unlock_page(page);
1701+
folio_unlock(folio);
17011702

17021703
if (unlikely(f2fs_cp_error(sbi))) {
17031704
f2fs_submit_merged_write(sbi, NODE);
@@ -1711,7 +1712,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
17111712
return 0;
17121713

17131714
redirty_out:
1714-
redirty_page_for_writepage(wbc, page);
1715+
folio_redirty_for_writepage(wbc, folio);
17151716
return AOP_WRITEPAGE_ACTIVATE;
17161717
}
17171718

0 commit comments

Comments
 (0)