Skip to content

Commit 92be661

Browse files
fdmananakdave
authored andcommitted
btrfs: make btrfs_iget_path() return a btrfs inode instead
It's an internal function and btrfs_iget() is now returning a btrfs inode, so change btrfs_iget_path() to also return a btrfs inode instead of a VFS inode. Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent b204e5c commit 92be661

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

fs/btrfs/btrfs_inode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,8 @@ void btrfs_free_inode(struct inode *inode);
593593
int btrfs_drop_inode(struct inode *inode);
594594
int __init btrfs_init_cachep(void);
595595
void __cold btrfs_destroy_cachep(void);
596-
struct inode *btrfs_iget_path(u64 ino, struct btrfs_root *root,
597-
struct btrfs_path *path);
596+
struct btrfs_inode *btrfs_iget_path(u64 ino, struct btrfs_root *root,
597+
struct btrfs_path *path);
598598
struct btrfs_inode *btrfs_iget(u64 ino, struct btrfs_root *root);
599599
struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
600600
struct folio *folio, u64 start, u64 len);

fs/btrfs/free-space-cache.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static struct inode *__lookup_free_space_inode(struct btrfs_root *root,
8888
struct btrfs_disk_key disk_key;
8989
struct btrfs_free_space_header *header;
9090
struct extent_buffer *leaf;
91-
struct inode *inode = NULL;
91+
struct btrfs_inode *inode;
9292
unsigned nofs_flag;
9393
int ret;
9494

@@ -120,13 +120,13 @@ static struct inode *__lookup_free_space_inode(struct btrfs_root *root,
120120
btrfs_release_path(path);
121121
memalloc_nofs_restore(nofs_flag);
122122
if (IS_ERR(inode))
123-
return inode;
123+
return ERR_CAST(inode);
124124

125-
mapping_set_gfp_mask(inode->i_mapping,
126-
mapping_gfp_constraint(inode->i_mapping,
125+
mapping_set_gfp_mask(inode->vfs_inode.i_mapping,
126+
mapping_gfp_constraint(inode->vfs_inode.i_mapping,
127127
~(__GFP_FS | __GFP_HIGHMEM)));
128128

129-
return inode;
129+
return &inode->vfs_inode;
130130
}
131131

132132
struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group,

fs/btrfs/inode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5642,8 +5642,8 @@ static struct btrfs_inode *btrfs_iget_locked(u64 ino, struct btrfs_root *root)
56425642
* Get an inode object given its inode number and corresponding root. Path is
56435643
* preallocated to prevent recursing back to iget through allocator.
56445644
*/
5645-
struct inode *btrfs_iget_path(u64 ino, struct btrfs_root *root,
5646-
struct btrfs_path *path)
5645+
struct btrfs_inode *btrfs_iget_path(u64 ino, struct btrfs_root *root,
5646+
struct btrfs_path *path)
56475647
{
56485648
struct btrfs_inode *inode;
56495649
int ret;
@@ -5653,14 +5653,14 @@ struct inode *btrfs_iget_path(u64 ino, struct btrfs_root *root,
56535653
return ERR_PTR(-ENOMEM);
56545654

56555655
if (!(inode->vfs_inode.i_state & I_NEW))
5656-
return &inode->vfs_inode;
5656+
return inode;
56575657

56585658
ret = btrfs_read_locked_inode(inode, path);
56595659
if (ret)
56605660
return ERR_PTR(ret);
56615661

56625662
unlock_new_inode(&inode->vfs_inode);
5663-
return &inode->vfs_inode;
5663+
return inode;
56645664
}
56655665

56665666
/*

0 commit comments

Comments
 (0)