aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/inode.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2011-01-12 20:00:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:16 -0500
commit6d1b6e4eff89475785f60fa00f65da780f869f36 (patch)
tree41608a81f14b824c97b8d8f0849aff04bcf1f537 /fs/proc/inode.c
parent9d6de12f70d2fb1487c4f482a21fed25fe74e0fd (diff)
proc: ->low_ino cleanup
- ->low_ino is write-once field -- reading it under locks is unnecessary. - /proc/$PID stuff never reaches pde_put()/free_proc_entry() -- PROC_DYNAMIC_FIRST check never triggers. - in proc_get_inode(), inode number always matches proc dir entry, so save one parameter. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r--fs/proc/inode.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 6bcb926b101b..176ce4cda68a 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -416,12 +416,11 @@ static const struct file_operations proc_reg_file_ops_no_compat = {
416}; 416};
417#endif 417#endif
418 418
419struct 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)
420 struct proc_dir_entry *de)
421{ 420{
422 struct inode * inode; 421 struct inode * inode;
423 422
424 inode = iget_locked(sb, ino); 423 inode = iget_locked(sb, de->low_ino);
425 if (!inode) 424 if (!inode)
426 return NULL; 425 return NULL;
427 if (inode->i_state & I_NEW) { 426 if (inode->i_state & I_NEW) {
@@ -471,7 +470,7 @@ int proc_fill_super(struct super_block *s)
471 s->s_time_gran = 1; 470 s->s_time_gran = 1;
472 471
473 pde_get(&proc_root); 472 pde_get(&proc_root);
474 root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root); 473 root_inode = proc_get_inode(s, &proc_root);
475 if (!root_inode) 474 if (!root_inode)
476 goto out_no_root; 475 goto out_no_root;
477 root_inode->i_uid = 0; 476 root_inode->i_uid = 0;