Commit 5f8882c8 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

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: default avatarBoris Burkov <boris@bur.io>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 93612a92
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);
	}
+1 −3
Original line number Diff line number Diff line
@@ -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);