aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r--fs/proc/inode.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 176ce4cda68a..74b48cfa1bb2 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -27,6 +27,8 @@
27static void proc_evict_inode(struct inode *inode) 27static void proc_evict_inode(struct inode *inode)
28{ 28{
29 struct proc_dir_entry *de; 29 struct proc_dir_entry *de;
30 struct ctl_table_header *head;
31 const struct proc_ns_operations *ns_ops;
30 32
31 truncate_inode_pages(&inode->i_data, 0); 33 truncate_inode_pages(&inode->i_data, 0);
32 end_writeback(inode); 34 end_writeback(inode);
@@ -38,12 +40,17 @@ static void proc_evict_inode(struct inode *inode)
38 de = PROC_I(inode)->pde; 40 de = PROC_I(inode)->pde;
39 if (de) 41 if (de)
40 pde_put(de); 42 pde_put(de);
41 if (PROC_I(inode)->sysctl) 43 head = PROC_I(inode)->sysctl;
42 sysctl_head_put(PROC_I(inode)->sysctl); 44 if (head) {
45 rcu_assign_pointer(PROC_I(inode)->sysctl, NULL);
46 sysctl_head_put(head);
47 }
48 /* Release any associated namespace */
49 ns_ops = PROC_I(inode)->ns_ops;
50 if (ns_ops && ns_ops->put)
51 ns_ops->put(PROC_I(inode)->ns);
43} 52}
44 53
45struct vfsmount *proc_mnt;
46
47static struct kmem_cache * proc_inode_cachep; 54static struct kmem_cache * proc_inode_cachep;
48 55
49static struct inode *proc_alloc_inode(struct super_block *sb) 56static struct inode *proc_alloc_inode(struct super_block *sb)
@@ -60,6 +67,8 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
60 ei->pde = NULL; 67 ei->pde = NULL;
61 ei->sysctl = NULL; 68 ei->sysctl = NULL;
62 ei->sysctl_entry = NULL; 69 ei->sysctl_entry = NULL;
70 ei->ns = NULL;
71 ei->ns_ops = NULL;
63 inode = &ei->vfs_inode; 72 inode = &ei->vfs_inode;
64 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 73 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
65 return inode; 74 return inode;