]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: Use inode_has_buffers()
authorJan Kara <jack@suse.cz>
Thu, 26 Mar 2026 09:53:55 +0000 (10:53 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 26 Mar 2026 14:03:26 +0000 (15:03 +0100)
Instead of checking i_private_list directly use appropriate wrapper
inode_has_buffers(). Also delete stale comment.

Acked-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260326095354.16340-43-jack@suse.cz
Tested-by: syzbot@syzkaller.appspotmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/buffer.c
fs/ext4/inode.c

index 22b43642ba57496ce365b3aa6f1b61a256c8316b..1bc0f22f3cc25483aee9a1f728113197eaa3dae4 100644 (file)
@@ -524,6 +524,7 @@ int inode_has_buffers(struct inode *inode)
 {
        return !list_empty(&inode->i_data.i_private_list);
 }
+EXPORT_SYMBOL_GPL(inode_has_buffers);
 
 /*
  * osync is designed to support O_SYNC io.  It waits synchronously for
index 396dc3a5d16b4dc4d3e5c6541871a9bb896f6d7a..d18d94acddcc16971946a9cfecc69cc83f1dbdf2 100644 (file)
@@ -1420,9 +1420,6 @@ static int write_end_fn(handle_t *handle, struct inode *inode,
 /*
  * We need to pick up the new inode size which generic_commit_write gave us
  * `iocb` can be NULL - eg, when called from page_symlink().
- *
- * ext4 never places buffers on inode->i_mapping->i_private_list.  metadata
- * buffers are managed internally.
  */
 static int ext4_write_end(const struct kiocb *iocb,
                          struct address_space *mapping,
@@ -3437,7 +3434,7 @@ static bool ext4_inode_datasync_dirty(struct inode *inode)
        }
 
        /* Any metadata buffers to write? */
-       if (!list_empty(&inode->i_mapping->i_private_list))
+       if (inode_has_buffers(inode))
                return true;
        return inode_state_read_once(inode) & I_DIRTY_DATASYNC;
 }