]> www.infradead.org Git - users/hch/misc.git/commitdiff
btrfs: use the local tmp_inode variable in start_delalloc_inodes
authorChristoph Hellwig <hch@lst.de>
Mon, 6 Oct 2025 08:34:53 +0000 (10:34 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 23 Oct 2025 06:47:24 +0000 (08:47 +0200)
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>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
fs/btrfs/inode.c

index 3b1b3a0553eea06229255ad0284d76074bdb958a..9edb78fc57fccc699dde6947616122958d18b6ea 100644 (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;