Commit e108c86b authored by David Sterba's avatar David Sterba

btrfs: switch btrfs_block_group::inode to struct btrfs_inode

The structure is internal so we should use struct btrfs_inode for that.
Reviewed-by: default avatarBoris Burkov <boris@bur.io>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8610ba7e
...@@ -4356,13 +4356,13 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info *info) ...@@ -4356,13 +4356,13 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info *info)
spin_lock(&block_group->lock); spin_lock(&block_group->lock);
if (test_and_clear_bit(BLOCK_GROUP_FLAG_IREF, if (test_and_clear_bit(BLOCK_GROUP_FLAG_IREF,
&block_group->runtime_flags)) { &block_group->runtime_flags)) {
struct inode *inode = block_group->inode; struct btrfs_inode *inode = block_group->inode;
block_group->inode = NULL; block_group->inode = NULL;
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);
ASSERT(block_group->io_ctl.inode == NULL); ASSERT(block_group->io_ctl.inode == NULL);
iput(inode); iput(&inode->vfs_inode);
} else { } else {
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);
} }
......
...@@ -115,7 +115,7 @@ struct btrfs_caching_control { ...@@ -115,7 +115,7 @@ struct btrfs_caching_control {
struct btrfs_block_group { struct btrfs_block_group {
struct btrfs_fs_info *fs_info; struct btrfs_fs_info *fs_info;
struct inode *inode; struct btrfs_inode *inode;
spinlock_t lock; spinlock_t lock;
u64 start; u64 start;
u64 length; u64 length;
......
...@@ -137,7 +137,7 @@ struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group, ...@@ -137,7 +137,7 @@ struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group,
spin_lock(&block_group->lock); spin_lock(&block_group->lock);
if (block_group->inode) if (block_group->inode)
inode = igrab(block_group->inode); inode = igrab(&block_group->inode->vfs_inode);
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);
if (inode) if (inode)
return inode; return inode;
...@@ -156,7 +156,7 @@ struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group, ...@@ -156,7 +156,7 @@ struct inode *lookup_free_space_inode(struct btrfs_block_group *block_group,
} }
if (!test_and_set_bit(BLOCK_GROUP_FLAG_IREF, &block_group->runtime_flags)) if (!test_and_set_bit(BLOCK_GROUP_FLAG_IREF, &block_group->runtime_flags))
block_group->inode = igrab(inode); block_group->inode = BTRFS_I(igrab(inode));
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);
return inode; return inode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment