Skip to content

Commit 718ef7c

Browse files
fdmananakdave
authored andcommitted
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> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent add226d commit 718ef7c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

fs/btrfs/inode.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6711,10 +6711,9 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
67116711
if (ret2)
67126712
btrfs_abort_transaction(trans, ret2);
67136713
} else if (add_backref) {
6714-
u64 local_index;
67156714
int ret2;
67166715

6717-
ret2 = btrfs_del_inode_ref(trans, root, name, ino, parent_ino, &local_index);
6716+
ret2 = btrfs_del_inode_ref(trans, root, name, ino, parent_ino, NULL);
67186717
if (ret2)
67196718
btrfs_abort_transaction(trans, ret2);
67206719
}

fs/btrfs/tree-log.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,7 +3502,6 @@ void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
35023502
struct btrfs_inode *inode, u64 dirid)
35033503
{
35043504
struct btrfs_root *log;
3505-
u64 index;
35063505
int ret;
35073506

35083507
ret = inode_logged(trans, inode, NULL);
@@ -3520,8 +3519,7 @@ void btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
35203519
log = root->log_root;
35213520
mutex_lock(&inode->log_mutex);
35223521

3523-
ret = btrfs_del_inode_ref(trans, log, name, btrfs_ino(inode),
3524-
dirid, &index);
3522+
ret = btrfs_del_inode_ref(trans, log, name, btrfs_ino(inode), dirid, NULL);
35253523
mutex_unlock(&inode->log_mutex);
35263524
if (ret < 0 && ret != -ENOENT)
35273525
btrfs_set_log_full_commit(trans);

0 commit comments

Comments
 (0)