@@ -5611,7 +5611,7 @@ static int btrfs_find_actor(struct inode *inode, void *opaque)
5611
5611
args -> root == BTRFS_I (inode )-> root ;
5612
5612
}
5613
5613
5614
- static struct inode * btrfs_iget_locked (u64 ino , struct btrfs_root * root )
5614
+ static struct btrfs_inode * btrfs_iget_locked (u64 ino , struct btrfs_root * root )
5615
5615
{
5616
5616
struct inode * inode ;
5617
5617
struct btrfs_iget_args args ;
@@ -5623,7 +5623,9 @@ static struct inode *btrfs_iget_locked(u64 ino, struct btrfs_root *root)
5623
5623
inode = iget5_locked_rcu (root -> fs_info -> sb , hashval , btrfs_find_actor ,
5624
5624
btrfs_init_locked_inode ,
5625
5625
(void * )& args );
5626
- return inode ;
5626
+ if (!inode )
5627
+ return NULL ;
5628
+ return BTRFS_I (inode );
5627
5629
}
5628
5630
5629
5631
/*
@@ -5633,51 +5635,51 @@ static struct inode *btrfs_iget_locked(u64 ino, struct btrfs_root *root)
5633
5635
struct inode * btrfs_iget_path (u64 ino , struct btrfs_root * root ,
5634
5636
struct btrfs_path * path )
5635
5637
{
5636
- struct inode * inode ;
5638
+ struct btrfs_inode * inode ;
5637
5639
int ret ;
5638
5640
5639
5641
inode = btrfs_iget_locked (ino , root );
5640
5642
if (!inode )
5641
5643
return ERR_PTR (- ENOMEM );
5642
5644
5643
- if (!(inode -> i_state & I_NEW ))
5644
- return inode ;
5645
+ if (!(inode -> vfs_inode . i_state & I_NEW ))
5646
+ return & inode -> vfs_inode ;
5645
5647
5646
- ret = btrfs_read_locked_inode (BTRFS_I ( inode ) , path );
5648
+ ret = btrfs_read_locked_inode (inode , path );
5647
5649
if (ret )
5648
5650
return ERR_PTR (ret );
5649
5651
5650
- unlock_new_inode (inode );
5651
- return inode ;
5652
+ unlock_new_inode (& inode -> vfs_inode );
5653
+ return & inode -> vfs_inode ;
5652
5654
}
5653
5655
5654
5656
/*
5655
5657
* Get an inode object given its inode number and corresponding root.
5656
5658
*/
5657
5659
struct inode * btrfs_iget (u64 ino , struct btrfs_root * root )
5658
5660
{
5659
- struct inode * inode ;
5661
+ struct btrfs_inode * inode ;
5660
5662
struct btrfs_path * path ;
5661
5663
int ret ;
5662
5664
5663
5665
inode = btrfs_iget_locked (ino , root );
5664
5666
if (!inode )
5665
5667
return ERR_PTR (- ENOMEM );
5666
5668
5667
- if (!(inode -> i_state & I_NEW ))
5668
- return inode ;
5669
+ if (!(inode -> vfs_inode . i_state & I_NEW ))
5670
+ return & inode -> vfs_inode ;
5669
5671
5670
5672
path = btrfs_alloc_path ();
5671
5673
if (!path )
5672
5674
return ERR_PTR (- ENOMEM );
5673
5675
5674
- ret = btrfs_read_locked_inode (BTRFS_I ( inode ) , path );
5676
+ ret = btrfs_read_locked_inode (inode , path );
5675
5677
btrfs_free_path (path );
5676
5678
if (ret )
5677
5679
return ERR_PTR (ret );
5678
5680
5679
- unlock_new_inode (inode );
5680
- return inode ;
5681
+ unlock_new_inode (& inode -> vfs_inode );
5682
+ return & inode -> vfs_inode ;
5681
5683
}
5682
5684
5683
5685
static struct inode * new_simple_dir (struct inode * dir ,
0 commit comments