From: Filipe Manana Date: Thu, 29 May 2025 15:59:07 +0000 (+0100) Subject: btrfs: pass NULL index to btrfs_del_inode_ref() where not needed X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5f8882c8540efc501e2836afbc0eb06a84bf2ff2;p=users%2Fjedix%2Flinux-maple.git btrfs: pass NULL index to btrfs_del_inode_ref() where not needed There are two callers of btrfs_del_inode_ref() that declare a local index variable and then pass a pointer for it to btrfs_del_inode_ref(), but then don't use that index at all. Since btrfs_del_inode_ref() accepts a NULL index pointer, pass NULL instead and stop declaring those useless index variables. Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 0f2cbaf8320d..474cb40a42f7 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6711,10 +6711,9 @@ fail_dir_item: if (ret2) btrfs_abort_transaction(trans, ret2); } else if (add_backref) { - u64 local_index; int ret2; - ret2 = btrfs_del_inode_ref(trans, root, name, ino, parent_ino, &local_index); + ret2 = btrfs_del_inode_ref(trans, root, name, ino, parent_ino, NULL); if (ret2) btrfs_abort_transaction(trans, ret2); } diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index e9f3dc569bfc..2c647836ce49 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3502,7 +3502,6 @@ void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, struct btrfs_inode *inode, u64 dirid) { struct btrfs_root *log; - u64 index; int ret; ret = inode_logged(trans, inode, NULL); @@ -3520,8 +3519,7 @@ void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, log = root->log_root; mutex_lock(&inode->log_mutex); - ret = btrfs_del_inode_ref(trans, log, name, btrfs_ino(inode), - dirid, &index); + ret = btrfs_del_inode_ref(trans, log, name, btrfs_ino(inode), dirid, NULL); mutex_unlock(&inode->log_mutex); if (ret < 0 && ret != -ENOENT) btrfs_set_log_full_commit(trans);