Skip to content

Commit cbc975b

Browse files
author
Matthew Wilcox (Oracle)
committed
f2fs: Convert f2fs_set_node_page_dirty to f2fs_dirty_node_folio
Removes a call to __set_page_dirty_nobuffers(). Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Tested-by: Damien Le Moal <[email protected]> Acked-by: Damien Le Moal <[email protected]> Tested-by: Mike Marshall <[email protected]> # orangefs Tested-by: David Howells <[email protected]> # afs
1 parent 4f5e34f commit cbc975b

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

fs/f2fs/node.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,23 +2132,24 @@ static int f2fs_write_node_pages(struct address_space *mapping,
21322132
return 0;
21332133
}
21342134

2135-
static int f2fs_set_node_page_dirty(struct page *page)
2135+
static bool f2fs_dirty_node_folio(struct address_space *mapping,
2136+
struct folio *folio)
21362137
{
2137-
trace_f2fs_set_page_dirty(page, NODE);
2138+
trace_f2fs_set_page_dirty(&folio->page, NODE);
21382139

2139-
if (!PageUptodate(page))
2140-
SetPageUptodate(page);
2140+
if (!folio_test_uptodate(folio))
2141+
folio_mark_uptodate(folio);
21412142
#ifdef CONFIG_F2FS_CHECK_FS
2142-
if (IS_INODE(page))
2143-
f2fs_inode_chksum_set(F2FS_P_SB(page), page);
2143+
if (IS_INODE(&folio->page))
2144+
f2fs_inode_chksum_set(F2FS_P_SB(&folio->page), &folio->page);
21442145
#endif
2145-
if (!PageDirty(page)) {
2146-
__set_page_dirty_nobuffers(page);
2147-
inc_page_count(F2FS_P_SB(page), F2FS_DIRTY_NODES);
2148-
set_page_private_reference(page);
2149-
return 1;
2146+
if (!folio_test_dirty(folio)) {
2147+
filemap_dirty_folio(mapping, folio);
2148+
inc_page_count(F2FS_P_SB(&folio->page), F2FS_DIRTY_NODES);
2149+
set_page_private_reference(&folio->page);
2150+
return true;
21502151
}
2151-
return 0;
2152+
return false;
21522153
}
21532154

21542155
/*
@@ -2157,7 +2158,7 @@ static int f2fs_set_node_page_dirty(struct page *page)
21572158
const struct address_space_operations f2fs_node_aops = {
21582159
.writepage = f2fs_write_node_page,
21592160
.writepages = f2fs_write_node_pages,
2160-
.set_page_dirty = f2fs_set_node_page_dirty,
2161+
.dirty_folio = f2fs_dirty_node_folio,
21612162
.invalidate_folio = f2fs_invalidate_folio,
21622163
.releasepage = f2fs_release_page,
21632164
#ifdef CONFIG_MIGRATION

0 commit comments

Comments
 (0)