aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c
index 367296ccafbe..371eaf092a31 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -263,12 +263,19 @@ static struct inode *sock_alloc_inode(struct super_block *sb)
263 return &ei->vfs_inode; 263 return &ei->vfs_inode;
264} 264}
265 265
266static void sock_destroy_inode(struct inode *inode) 266static void sock_i_callback(struct rcu_head *head)
267{ 267{
268 struct inode *inode = container_of(head, struct inode, i_rcu);
269 INIT_LIST_HEAD(&inode->i_dentry);
268 kmem_cache_free(sock_inode_cachep, 270 kmem_cache_free(sock_inode_cachep,
269 container_of(inode, struct socket_alloc, vfs_inode)); 271 container_of(inode, struct socket_alloc, vfs_inode));
270} 272}
271 273
274static void sock_destroy_inode(struct inode *inode)
275{
276 call_rcu(&inode->i_rcu, sock_i_callback);
277}
278
272static void init_once(void *foo) 279static void init_once(void *foo)
273{ 280{
274 struct socket_alloc *ei = (struct socket_alloc *)foo; 281 struct socket_alloc *ei = (struct socket_alloc *)foo;