diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2011-01-12 20:00:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:16 -0500 |
commit | 6d1b6e4eff89475785f60fa00f65da780f869f36 (patch) | |
tree | 41608a81f14b824c97b8d8f0849aff04bcf1f537 /fs/proc/generic.c | |
parent | 9d6de12f70d2fb1487c4f482a21fed25fe74e0fd (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/generic.c')
-rw-r--r-- | fs/proc/generic.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index f766be29d2c7..d00c5af6f199 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -425,13 +425,10 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir, | |||
425 | if (de->namelen != dentry->d_name.len) | 425 | if (de->namelen != dentry->d_name.len) |
426 | continue; | 426 | continue; |
427 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { | 427 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { |
428 | unsigned int ino; | ||
429 | |||
430 | ino = de->low_ino; | ||
431 | pde_get(de); | 428 | pde_get(de); |
432 | spin_unlock(&proc_subdir_lock); | 429 | spin_unlock(&proc_subdir_lock); |
433 | error = -EINVAL; | 430 | error = -EINVAL; |
434 | inode = proc_get_inode(dir->i_sb, ino, de); | 431 | inode = proc_get_inode(dir->i_sb, de); |
435 | goto out_unlock; | 432 | goto out_unlock; |
436 | } | 433 | } |
437 | } | 434 | } |
@@ -768,12 +765,7 @@ EXPORT_SYMBOL(proc_create_data); | |||
768 | 765 | ||
769 | static void free_proc_entry(struct proc_dir_entry *de) | 766 | static void free_proc_entry(struct proc_dir_entry *de) |
770 | { | 767 | { |
771 | unsigned int ino = de->low_ino; | 768 | release_inode_number(de->low_ino); |
772 | |||
773 | if (ino < PROC_DYNAMIC_FIRST) | ||
774 | return; | ||
775 | |||
776 | release_inode_number(ino); | ||
777 | 769 | ||
778 | if (S_ISLNK(de->mode)) | 770 | if (S_ISLNK(de->mode)) |
779 | kfree(de->data); | 771 | kfree(de->data); |