aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/proc/generic.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r--fs/proc/generic.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index dd29f0337661..f1637f17c37c 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -28,7 +28,7 @@
28 28
29DEFINE_SPINLOCK(proc_subdir_lock); 29DEFINE_SPINLOCK(proc_subdir_lock);
30 30
31static int proc_match(int len, const char *name, struct proc_dir_entry *de) 31static int proc_match(unsigned int len, const char *name, struct proc_dir_entry *de)
32{ 32{
33 if (de->namelen != len) 33 if (de->namelen != len)
34 return 0; 34 return 0;
@@ -303,7 +303,7 @@ static int __xlate_proc_name(const char *name, struct proc_dir_entry **ret,
303{ 303{
304 const char *cp = name, *next; 304 const char *cp = name, *next;
305 struct proc_dir_entry *de; 305 struct proc_dir_entry *de;
306 int len; 306 unsigned int len;
307 307
308 de = *ret; 308 de = *ret;
309 if (!de) 309 if (!de)
@@ -400,7 +400,7 @@ static const struct inode_operations proc_link_inode_operations = {
400 * smarter: we could keep a "volatile" flag in the 400 * smarter: we could keep a "volatile" flag in the
401 * inode to indicate which ones to keep. 401 * inode to indicate which ones to keep.
402 */ 402 */
403static int proc_delete_dentry(struct dentry * dentry) 403static int proc_delete_dentry(const struct dentry * dentry)
404{ 404{
405 return 1; 405 return 1;
406} 406}
@@ -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 }
@@ -439,7 +436,7 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir,
439out_unlock: 436out_unlock:
440 437
441 if (inode) { 438 if (inode) {
442 dentry->d_op = &proc_dentry_operations; 439 d_set_d_op(dentry, &proc_dentry_operations);
443 d_add(dentry, inode); 440 d_add(dentry, inode);
444 return NULL; 441 return NULL;
445 } 442 }
@@ -605,7 +602,7 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
605{ 602{
606 struct proc_dir_entry *ent = NULL; 603 struct proc_dir_entry *ent = NULL;
607 const char *fn = name; 604 const char *fn = name;
608 int len; 605 unsigned int len;
609 606
610 /* make sure name is valid */ 607 /* make sure name is valid */
611 if (!name || !strlen(name)) goto out; 608 if (!name || !strlen(name)) goto out;
@@ -677,6 +674,7 @@ struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode,
677 } 674 }
678 return ent; 675 return ent;
679} 676}
677EXPORT_SYMBOL(proc_mkdir_mode);
680 678
681struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, 679struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
682 struct proc_dir_entry *parent) 680 struct proc_dir_entry *parent)
@@ -768,12 +766,7 @@ EXPORT_SYMBOL(proc_create_data);
768 766
769static void free_proc_entry(struct proc_dir_entry *de) 767static void free_proc_entry(struct proc_dir_entry *de)
770{ 768{
771 unsigned int ino = de->low_ino; 769 release_inode_number(de->low_ino);
772
773 if (ino < PROC_DYNAMIC_FIRST)
774 return;
775
776 release_inode_number(ino);
777 770
778 if (S_ISLNK(de->mode)) 771 if (S_ISLNK(de->mode))
779 kfree(de->data); 772 kfree(de->data);
@@ -794,7 +787,7 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
794 struct proc_dir_entry **p; 787 struct proc_dir_entry **p;
795 struct proc_dir_entry *de = NULL; 788 struct proc_dir_entry *de = NULL;
796 const char *fn = name; 789 const char *fn = name;
797 int len; 790 unsigned int len;
798 791
799 spin_lock(&proc_subdir_lock); 792 spin_lock(&proc_subdir_lock);
800 if (__xlate_proc_name(name, &parent, &fn) != 0) { 793 if (__xlate_proc_name(name, &parent, &fn) != 0) {
@@ -834,12 +827,9 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
834 827
835 wait_for_completion(de->pde_unload_completion); 828 wait_for_completion(de->pde_unload_completion);
836 829
837 goto continue_removing; 830 spin_lock(&de->pde_unload_lock);
838 } 831 }
839 spin_unlock(&de->pde_unload_lock);
840 832
841continue_removing:
842 spin_lock(&de->pde_unload_lock);
843 while (!list_empty(&de->pde_openers)) { 833 while (!list_empty(&de->pde_openers)) {
844 struct pde_opener *pdeo; 834 struct pde_opener *pdeo;
845 835