f2fs: Pass a folio to f2fs_has_enough_room()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 31 Mar 2025 20:12:22 +0000 (21:12 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 28 Apr 2025 15:26:43 +0000 (15:26 +0000)
The only caller already has a folio so pass it in.

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/dir.c
fs/f2fs/f2fs.h
fs/f2fs/inline.c

index 10e7742c5e0b5cdd23e6d98692cdec42d7d704e7..284f4ef11e25508b226cb5086c1db93e0abd9e0e 100644 (file)
@@ -622,14 +622,14 @@ next:
        goto next;
 }
 
-bool f2fs_has_enough_room(struct inode *dir, struct page *ipage,
+bool f2fs_has_enough_room(struct inode *dir, struct folio *ifolio,
                          const struct f2fs_filename *fname)
 {
        struct f2fs_dentry_ptr d;
        unsigned int bit_pos;
        int slots = GET_DENTRY_SLOTS(fname->disk_name.len);
 
-       make_dentry_ptr_inline(dir, &d, inline_data_addr(dir, ipage));
+       make_dentry_ptr_inline(dir, &d, inline_data_addr(dir, &ifolio->page));
 
        bit_pos = f2fs_room_for_filename(d.bitmap, slots, d.max);
 
index 43216254a0561c5cb4f945aabbf2d8eac7ebd012..9c3b6b84f0f53606bf48bd02c38d5817ba82c585 100644 (file)
@@ -3668,7 +3668,7 @@ ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr,
                        struct page **page);
 void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
                        struct page *page, struct inode *inode);
-bool f2fs_has_enough_room(struct inode *dir, struct page *ipage,
+bool f2fs_has_enough_room(struct inode *dir, struct folio *ifolio,
                          const struct f2fs_filename *fname);
 void f2fs_update_dentry(nid_t ino, umode_t mode, struct f2fs_dentry_ptr *d,
                        const struct fscrypt_str *name, f2fs_hash_t name_hash,
index d27205a789af88611fe21caa17b7bd5e08071ee4..919d30034fe0c230ea1550016ec0ea47637642aa 100644 (file)
@@ -615,7 +615,7 @@ int f2fs_try_convert_inline_dir(struct inode *dir, struct dentry *dentry)
                goto out_fname;
        }
 
-       if (f2fs_has_enough_room(dir, &ifolio->page, &fname)) {
+       if (f2fs_has_enough_room(dir, ifolio, &fname)) {
                f2fs_folio_put(ifolio, true);
                goto out_fname;
        }