]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: Convert gc_data_segment() to use a folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 18 Feb 2025 05:51:59 +0000 (05:51 +0000)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Mar 2025 17:02:26 +0000 (17:02 +0000)
Use f2fs_get_read_data_folio() instead of f2fs_get_read_data_page().
Saves a hidden call to compound_head() in f2fs_put_page().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c

index d0fffa2bd9f057a9cc88bd27f4f2fedaf46f4ea4..2b8f9239bede7ce7704a4a6b22763b0ffc67c971 100644 (file)
@@ -1542,7 +1542,6 @@ next_step:
        entry = sum;
 
        for (off = 0; off < usable_blks_in_seg; off++, entry++) {
-               struct page *data_page;
                struct inode *inode;
                struct node_info dni; /* dnode info for the data */
                unsigned int ofs_in_node, nofs;
@@ -1585,6 +1584,7 @@ next_step:
                ofs_in_node = le16_to_cpu(entry->ofs_in_node);
 
                if (phase == 3) {
+                       struct folio *data_folio;
                        int err;
 
                        inode = f2fs_iget(sb, dni.ino);
@@ -1635,15 +1635,15 @@ next_step:
                                continue;
                        }
 
-                       data_page = f2fs_get_read_data_page(inode, start_bidx,
+                       data_folio = f2fs_get_read_data_folio(inode, start_bidx,
                                                        REQ_RAHEAD, true, NULL);
                        f2fs_up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
-                       if (IS_ERR(data_page)) {
+                       if (IS_ERR(data_folio)) {
                                iput(inode);
                                continue;
                        }
 
-                       f2fs_put_page(data_page, 0);
+                       f2fs_folio_put(data_folio, false);
                        add_gc_inode(gc_list, inode);
                        continue;
                }