Commit 26602cab authored by Al Viro's avatar Al Viro

btrfs: use ->free_inode()

a lot of stuff remains in ->destroy_inode()
Acked-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 51b9fe48
...@@ -3267,6 +3267,7 @@ void btrfs_evict_inode(struct inode *inode); ...@@ -3267,6 +3267,7 @@ void btrfs_evict_inode(struct inode *inode);
int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc);
struct inode *btrfs_alloc_inode(struct super_block *sb); struct inode *btrfs_alloc_inode(struct super_block *sb);
void btrfs_destroy_inode(struct inode *inode); void btrfs_destroy_inode(struct inode *inode);
void btrfs_free_inode(struct inode *inode);
int btrfs_drop_inode(struct inode *inode); int btrfs_drop_inode(struct inode *inode);
int __init btrfs_init_cachep(void); int __init btrfs_init_cachep(void);
void __cold btrfs_destroy_cachep(void); void __cold btrfs_destroy_cachep(void);
......
...@@ -9206,9 +9206,8 @@ void btrfs_test_destroy_inode(struct inode *inode) ...@@ -9206,9 +9206,8 @@ void btrfs_test_destroy_inode(struct inode *inode)
} }
#endif #endif
static void btrfs_i_callback(struct rcu_head *head) void btrfs_free_inode(struct inode *inode)
{ {
struct inode *inode = container_of(head, struct inode, i_rcu);
kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
} }
...@@ -9234,7 +9233,7 @@ void btrfs_destroy_inode(struct inode *inode) ...@@ -9234,7 +9233,7 @@ void btrfs_destroy_inode(struct inode *inode)
* created. * created.
*/ */
if (!root) if (!root)
goto free; return;
while (1) { while (1) {
ordered = btrfs_lookup_first_ordered_extent(inode, (u64)-1); ordered = btrfs_lookup_first_ordered_extent(inode, (u64)-1);
...@@ -9252,8 +9251,6 @@ void btrfs_destroy_inode(struct inode *inode) ...@@ -9252,8 +9251,6 @@ void btrfs_destroy_inode(struct inode *inode)
btrfs_qgroup_check_reserved_leak(inode); btrfs_qgroup_check_reserved_leak(inode);
inode_tree_del(inode); inode_tree_del(inode);
btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0);
free:
call_rcu(&inode->i_rcu, btrfs_i_callback);
} }
int btrfs_drop_inode(struct inode *inode) int btrfs_drop_inode(struct inode *inode)
......
...@@ -2298,6 +2298,7 @@ static const struct super_operations btrfs_super_ops = { ...@@ -2298,6 +2298,7 @@ static const struct super_operations btrfs_super_ops = {
.show_devname = btrfs_show_devname, .show_devname = btrfs_show_devname,
.alloc_inode = btrfs_alloc_inode, .alloc_inode = btrfs_alloc_inode,
.destroy_inode = btrfs_destroy_inode, .destroy_inode = btrfs_destroy_inode,
.free_inode = btrfs_free_inode,
.statfs = btrfs_statfs, .statfs = btrfs_statfs,
.remount_fs = btrfs_remount, .remount_fs = btrfs_remount,
.freeze_fs = btrfs_freeze, .freeze_fs = btrfs_freeze,
......
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