]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
hugetlb: make use of ->free_inode()
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Apr 2019 03:16:38 +0000 (23:16 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 May 2019 02:43:27 +0000 (22:43 -0400)
moving synchronous parts of ->destroy_inode() to ->evict_inode() is
not possible here - they are balancing the stuff done in ->alloc_inode(),
not the things acquired while using it or sanity checks.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/hugetlbfs/inode.c

index 9285dd4f4b1ce3ed2601daa62cb30de6d0eed92b..c74ef4426282ecf5d64bc0f63f3c5ed617a49e08 100644 (file)
@@ -1051,9 +1051,8 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
        return &p->vfs_inode;
 }
 
-static void hugetlbfs_i_callback(struct rcu_head *head)
+static void hugetlbfs_free_inode(struct inode *inode)
 {
-       struct inode *inode = container_of(head, struct inode, i_rcu);
        kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode));
 }
 
@@ -1061,7 +1060,6 @@ static void hugetlbfs_destroy_inode(struct inode *inode)
 {
        hugetlbfs_inc_free_inodes(HUGETLBFS_SB(inode->i_sb));
        mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy);
-       call_rcu(&inode->i_rcu, hugetlbfs_i_callback);
 }
 
 static const struct address_space_operations hugetlbfs_aops = {
@@ -1108,6 +1106,7 @@ static const struct inode_operations hugetlbfs_inode_operations = {
 
 static const struct super_operations hugetlbfs_ops = {
        .alloc_inode    = hugetlbfs_alloc_inode,
+       .free_inode     = hugetlbfs_free_inode,
        .destroy_inode  = hugetlbfs_destroy_inode,
        .evict_inode    = hugetlbfs_evict_inode,
        .statfs         = hugetlbfs_statfs,