]> git.baikalelectronics.ru Git - kernel.git/commitdiff
f2fs: Get the superblock from the mapping instead of the page
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 29 Mar 2022 20:27:21 +0000 (16:27 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 1 Apr 2022 18:40:44 +0000 (14:40 -0400)
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>
fs/f2fs/checkpoint.c
fs/f2fs/node.c

index a8fc4fa511a80ebb6021c723b189b70c354077d6..f5366feea82dcfce0e33653e4001109b78755b7e 100644 (file)
@@ -456,7 +456,7 @@ static bool f2fs_dirty_meta_folio(struct address_space *mapping,
                folio_mark_uptodate(folio);
        if (!folio_test_dirty(folio)) {
                filemap_dirty_folio(mapping, folio);
-               inc_page_count(F2FS_P_SB(&folio->page), F2FS_DIRTY_META);
+               inc_page_count(F2FS_M_SB(mapping), F2FS_DIRTY_META);
                set_page_private_reference(&folio->page);
                return true;
        }
index 0b6e741e94a0f686fd269dbd99892f2f6c3f378b..c45d341dcf6e536fd1f5458621dcdb61cfa9f592 100644 (file)
@@ -2146,11 +2146,11 @@ static bool f2fs_dirty_node_folio(struct address_space *mapping,
                folio_mark_uptodate(folio);
 #ifdef CONFIG_F2FS_CHECK_FS
        if (IS_INODE(&folio->page))
-               f2fs_inode_chksum_set(F2FS_P_SB(&folio->page), &folio->page);
+               f2fs_inode_chksum_set(F2FS_M_SB(mapping), &folio->page);
 #endif
        if (!folio_test_dirty(folio)) {
                filemap_dirty_folio(mapping, folio);
-               inc_page_count(F2FS_P_SB(&folio->page), F2FS_DIRTY_NODES);
+               inc_page_count(F2FS_M_SB(mapping), F2FS_DIRTY_NODES);
                set_page_private_reference(&folio->page);
                return true;
        }