btrfs: use the local tmp_inode variable in start_delalloc_inodes

start_delalloc_inodes has a struct inode * pointer available in the
main loop, use it instead of re-calculating it from the btrfs inode.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20251024080431.324236-5-hch@lst.de
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christoph Hellwig 2025-10-24 10:04:15 +02:00 committed by Christian Brauner
parent 890f141da0
commit 41e52c6447
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -8744,9 +8744,9 @@ static int start_delalloc_inodes(struct btrfs_root *root,
if (snapshot)
set_bit(BTRFS_INODE_SNAPSHOT_FLUSH, &inode->runtime_flags);
if (full_flush) {
work = btrfs_alloc_delalloc_work(&inode->vfs_inode);
work = btrfs_alloc_delalloc_work(tmp_inode);
if (!work) {
iput(&inode->vfs_inode);
iput(tmp_inode);
ret = -ENOMEM;
goto out;
}
@ -8754,7 +8754,7 @@ static int start_delalloc_inodes(struct btrfs_root *root,
btrfs_queue_work(root->fs_info->flush_workers,
&work->work);
} else {
ret = filemap_fdatawrite_wbc(inode->vfs_inode.i_mapping, wbc);
ret = filemap_fdatawrite_wbc(tmp_inode->i_mapping, wbc);
btrfs_add_delayed_iput(inode);
if (ret || wbc->nr_to_write <= 0)
goto out;