]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: use inode already stored in local variable at btrfs_rmdir()
authorFilipe Manana <fdmanana@suse.com>
Sun, 17 May 2026 13:52:02 +0000 (09:52 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 May 2026 11:03:34 +0000 (13:03 +0200)
[ Upstream commit 9f82a4ed34d870b5719f9b95f7da4f74d3325a6f ]

There's no need to call d_inode(dentry) when calling btrfs_unlink_inode()
since we have already stored that in a local inode variable. So just use
the local variable to make the code less verbose.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 999757231c49 ("btrfs: fix missing last_unlink_trans update when removing a directory")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/inode.c

index 00cd932791c8d0afb7d37eaa11dde15d639299a6..fd2806f12e83befb43afdc5d38acbb2617ccb5cc 100644 (file)
@@ -4681,8 +4681,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
                goto out;
 
        /* now the directory is empty */
-       ret = btrfs_unlink_inode(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)),
-                                &fname.disk_name);
+       ret = btrfs_unlink_inode(trans, BTRFS_I(dir), BTRFS_I(inode), &fname.disk_name);
        if (!ret)
                btrfs_i_size_write(BTRFS_I(inode), 0);
 out: