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 <boris@bur.io>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana
2025-05-29 16:59:07 +01:00
committed by David Sterba
parent 93612a92ba
commit 5f8882c854
2 changed files with 2 additions and 5 deletions

View File

@@ -6711,10 +6711,9 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
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);
}

View File

@@ -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);