Skip to content

Commit 6d9cc07

Browse files
fdmananakdave
authored andcommitted
btrfs: remove root argument from add_link()
The root argument for tree-log.c:add_link() always matches the root of the given directory and the given inode, so it can eliminated. Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 4467af8 commit 6d9cc07

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/btrfs/tree-log.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,10 +1413,11 @@ static int btrfs_inode_ref_exists(struct inode *inode, struct inode *dir,
14131413
return ret;
14141414
}
14151415

1416-
static int add_link(struct btrfs_trans_handle *trans, struct btrfs_root *root,
1416+
static int add_link(struct btrfs_trans_handle *trans,
14171417
struct inode *dir, struct inode *inode, const char *name,
14181418
int namelen, u64 ref_index)
14191419
{
1420+
struct btrfs_root *root = BTRFS_I(dir)->root;
14201421
struct btrfs_dir_item *dir_item;
14211422
struct btrfs_key key;
14221423
struct btrfs_path *path;
@@ -1612,7 +1613,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
16121613
goto out;
16131614

16141615
/* insert our name */
1615-
ret = add_link(trans, root, dir, inode, name, namelen,
1616+
ret = add_link(trans, dir, inode, name, namelen,
16161617
ref_index);
16171618
if (ret)
16181619
goto out;

0 commit comments

Comments
 (0)