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.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 3ddb6068177..176ce4cda68 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -65,11 +65,18 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
65 return inode; 65 return inode;
66} 66}
67 67
68static void proc_destroy_inode(struct inode *inode) 68static void proc_i_callback(struct rcu_head *head)
69{ 69{
70 struct inode *inode = container_of(head, struct inode, i_rcu);
71 INIT_LIST_HEAD(&inode->i_dentry);
70 kmem_cache_free(proc_inode_cachep, PROC_I(inode)); 72 kmem_cache_free(proc_inode_cachep, PROC_I(inode));
71} 73}
72 74
75static void proc_destroy_inode(struct inode *inode)
76{
77 call_rcu(&inode->i_rcu, proc_i_callback);
78}
79
73static void init_once(void *foo) 80static void init_once(void *foo)
74{ 81{
75 struct proc_inode *ei = (struct proc_inode *) foo; 82 struct proc_inode *ei = (struct proc_inode *) foo;
@@ -409,12 +416,11 @@ static const struct file_operations proc_reg_file_ops_no_compat = {
409}; 416};
410#endif 417#endif
411 418
412struct inode *proc_get_inode(struct super_block *sb, unsigned int ino, 419struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
413 struct proc_dir_entry *de)
414{ 420{
415 struct inode * inode; 421 struct inode * inode;
416 422
417 inode = iget_locked(sb, ino); 423 inode = iget_locked(sb, de->low_ino);
418 if (!inode) 424 if (!inode)
419 return NULL; 425 return NULL;
420 if (inode->i_state & I_NEW) { 426 if (inode->i_state & I_NEW) {
@@ -464,7 +470,7 @@ int proc_fill_super(struct super_block *s)
464 s->s_time_gran = 1; 470 s->s_time_gran = 1;
465 471
466 pde_get(&proc_root); 472 pde_get(&proc_root);
467 root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root); 473 root_inode = proc_get_inode(s, &proc_root);
468 if (!root_inode) 474 if (!root_inode)
469 goto out_no_root; 475 goto out_no_root;
470 root_inode->i_uid = 0; 476 root_inode->i_uid = 0;