f2fs: Use a folio in f2fs_read_inline_dir()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:12:04 +0000 (21:12 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Apr 2025 15:26:40 +0000 (15:26 +0000)
Remove two calls to compound_head().

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/inline.c

index 58f427e9d1f7e9f71af4c72ba167fc0deab98cd7..fda56c7e848e29f957f6a7ce94b31b3f98bce10a 100644 (file)
@@ -755,7 +755,7 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
                                struct fscrypt_str *fstr)
 {
        struct inode *inode = file_inode(file);
-       struct page *ipage = NULL;
+       struct folio *ifolio = NULL;
        struct f2fs_dentry_ptr d;
        void *inline_dentry = NULL;
        int err;
@@ -765,17 +765,17 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
        if (ctx->pos == d.max)
                return 0;
 
-       ipage = f2fs_get_inode_page(F2FS_I_SB(inode), inode->i_ino);
-       if (IS_ERR(ipage))
-               return PTR_ERR(ipage);
+       ifolio = f2fs_get_inode_folio(F2FS_I_SB(inode), inode->i_ino);
+       if (IS_ERR(ifolio))
+               return PTR_ERR(ifolio);
 
        /*
         * f2fs_readdir was protected by inode.i_rwsem, it is safe to access
         * ipage without page's lock held.
         */
-       unlock_page(ipage);
+       folio_unlock(ifolio);
 
-       inline_dentry = inline_data_addr(inode, ipage);
+       inline_dentry = inline_data_addr(inode, &ifolio->page);
 
        make_dentry_ptr_inline(inode, &d, inline_dentry);
 
@@ -783,7 +783,7 @@ int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
        if (!err)
                ctx->pos = d.max;
 
-       f2fs_put_page(ipage, 0);
+       f2fs_folio_put(ifolio, false);
        return err < 0 ? err : 0;
 }