Skip to content

Commit 29c8779

Browse files
author
Matthew Wilcox (Oracle)
committed
f2fs: Get the superblock from the mapping instead of the page
It's slightly more efficient to go directly from the mapping to the superblock than to go from the page. Now that these routines have the mapping passed to them, there's no reason not to use it. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 0fb5b2e commit 29c8779

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

fs/f2fs/checkpoint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static bool f2fs_dirty_meta_folio(struct address_space *mapping,
456456
folio_mark_uptodate(folio);
457457
if (!folio_test_dirty(folio)) {
458458
filemap_dirty_folio(mapping, folio);
459-
inc_page_count(F2FS_P_SB(&folio->page), F2FS_DIRTY_META);
459+
inc_page_count(F2FS_M_SB(mapping), F2FS_DIRTY_META);
460460
set_page_private_reference(&folio->page);
461461
return true;
462462
}

fs/f2fs/node.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,11 +2146,11 @@ static bool f2fs_dirty_node_folio(struct address_space *mapping,
21462146
folio_mark_uptodate(folio);
21472147
#ifdef CONFIG_F2FS_CHECK_FS
21482148
if (IS_INODE(&folio->page))
2149-
f2fs_inode_chksum_set(F2FS_P_SB(&folio->page), &folio->page);
2149+
f2fs_inode_chksum_set(F2FS_M_SB(mapping), &folio->page);
21502150
#endif
21512151
if (!folio_test_dirty(folio)) {
21522152
filemap_dirty_folio(mapping, folio);
2153-
inc_page_count(F2FS_P_SB(&folio->page), F2FS_DIRTY_NODES);
2153+
inc_page_count(F2FS_M_SB(mapping), F2FS_DIRTY_NODES);
21542154
set_page_private_reference(&folio->page);
21552155
return true;
21562156
}

0 commit comments

Comments
 (0)