Skip to content

Commit

Permalink
sockfs: switch to ->free_inode()
Browse files Browse the repository at this point in the history
we do have an RCU-delayed part there already (freeing the wq),
so it's not like the pipe situation; moreover, it might be
worth considering coallocating wq with the rest of struct sock_alloc.
->sk_wq in struct sock would remain a pointer as it is, but
the object it normally points to would be coallocated with
struct socket...

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Al Viro authored and davem330 committed Jul 9, 2019
1 parent 17ccf9e commit 6d7855c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ static struct inode *sock_alloc_inode(struct super_block *sb)
return &ei->vfs_inode;
}

static void sock_destroy_inode(struct inode *inode)
static void sock_free_inode(struct inode *inode)
{
struct socket_alloc *ei;

ei = container_of(inode, struct socket_alloc, vfs_inode);
kfree_rcu(ei->socket.wq, rcu);
kfree(ei->socket.wq);
kmem_cache_free(sock_inode_cachep, ei);
}

Expand All @@ -288,7 +288,7 @@ static void init_inodecache(void)

static const struct super_operations sockfs_ops = {
.alloc_inode = sock_alloc_inode,
.destroy_inode = sock_destroy_inode,
.free_inode = sock_free_inode,
.statfs = simple_statfs,
};

Expand Down

0 comments on commit 6d7855c

Please sign in to comment.