Skip to content

Commit 14d063e

Browse files
fdmananakdave
authored andcommitted
btrfs: pass a btrfs_inode to fixup_inode_link_count()
fixup_inode_link_count() mostly wants to use a btrfs_inode, plus it's an internal function so it should take btrfs_inode instead of a VFS inode. Change the argument type to btrfs_inode, avoiding several BTRFS_I() calls too. Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent b4c50cb commit 14d063e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

fs/btrfs/tree-log.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,43 +1610,43 @@ static int count_inode_refs(struct btrfs_inode *inode, struct btrfs_path *path)
16101610
* will free the inode.
16111611
*/
16121612
static noinline int fixup_inode_link_count(struct btrfs_trans_handle *trans,
1613-
struct inode *inode)
1613+
struct btrfs_inode *inode)
16141614
{
1615-
struct btrfs_root *root = BTRFS_I(inode)->root;
1615+
struct btrfs_root *root = inode->root;
16161616
struct btrfs_path *path;
16171617
int ret;
16181618
u64 nlink = 0;
1619-
u64 ino = btrfs_ino(BTRFS_I(inode));
1619+
const u64 ino = btrfs_ino(inode);
16201620

16211621
path = btrfs_alloc_path();
16221622
if (!path)
16231623
return -ENOMEM;
16241624

1625-
ret = count_inode_refs(BTRFS_I(inode), path);
1625+
ret = count_inode_refs(inode, path);
16261626
if (ret < 0)
16271627
goto out;
16281628

16291629
nlink = ret;
16301630

1631-
ret = count_inode_extrefs(BTRFS_I(inode), path);
1631+
ret = count_inode_extrefs(inode, path);
16321632
if (ret < 0)
16331633
goto out;
16341634

16351635
nlink += ret;
16361636

16371637
ret = 0;
16381638

1639-
if (nlink != inode->i_nlink) {
1640-
set_nlink(inode, nlink);
1641-
ret = btrfs_update_inode(trans, BTRFS_I(inode));
1639+
if (nlink != inode->vfs_inode.i_nlink) {
1640+
set_nlink(&inode->vfs_inode, nlink);
1641+
ret = btrfs_update_inode(trans, inode);
16421642
if (ret)
16431643
goto out;
16441644
}
1645-
if (S_ISDIR(inode->i_mode))
1646-
BTRFS_I(inode)->index_cnt = (u64)-1;
1645+
if (S_ISDIR(inode->vfs_inode.i_mode))
1646+
inode->index_cnt = (u64)-1;
16471647

1648-
if (inode->i_nlink == 0) {
1649-
if (S_ISDIR(inode->i_mode)) {
1648+
if (inode->vfs_inode.i_nlink == 0) {
1649+
if (S_ISDIR(inode->vfs_inode.i_mode)) {
16501650
ret = replay_dir_deletes(trans, root, NULL, path,
16511651
ino, 1);
16521652
if (ret)
@@ -1702,7 +1702,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans,
17021702
break;
17031703
}
17041704

1705-
ret = fixup_inode_link_count(trans, &inode->vfs_inode);
1705+
ret = fixup_inode_link_count(trans, inode);
17061706
iput(&inode->vfs_inode);
17071707
if (ret)
17081708
break;

0 commit comments

Comments
 (0)