]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: use inode already stored in local variable at btrfs_rmdir()
authorFilipe Manana <fdmanana@suse.com>
Fri, 20 Jun 2025 15:50:31 +0000 (16:50 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:58:04 +0000 (23:58 +0200)
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>
fs/btrfs/inode.c

index 12141348236d5b58fe181a4b261c7185d917184c..f8e4651fe60bdd0b05c3d0fb4af4541dcb9fa22b 100644 (file)
@@ -4759,8 +4759,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: