aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/generic.c9
-rw-r--r--fs/proc/inode.c9
-rw-r--r--fs/proc/root.c1
3 files changed, 5 insertions, 14 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 5fccfe222a63..8d49838e5554 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -595,6 +595,7 @@ static struct proc_dir_entry *proc_create(struct proc_dir_entry **parent,
595 ent->namelen = len; 595 ent->namelen = len;
596 ent->mode = mode; 596 ent->mode = mode;
597 ent->nlink = nlink; 597 ent->nlink = nlink;
598 atomic_set(&ent->count, 1);
598 ent->pde_users = 0; 599 ent->pde_users = 0;
599 spin_lock_init(&ent->pde_unload_lock); 600 spin_lock_init(&ent->pde_unload_lock);
600 ent->pde_unload_completion = NULL; 601 ent->pde_unload_completion = NULL;
@@ -692,7 +693,6 @@ void free_proc_entry(struct proc_dir_entry *de)
692 693
693/* 694/*
694 * Remove a /proc entry and free it if it's not currently in use. 695 * Remove a /proc entry and free it if it's not currently in use.
695 * If it is in use, we set the 'deleted' flag.
696 */ 696 */
697void remove_proc_entry(const char *name, struct proc_dir_entry *parent) 697void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
698{ 698{
@@ -741,13 +741,8 @@ continue_removing:
741 parent->nlink--; 741 parent->nlink--;
742 de->nlink = 0; 742 de->nlink = 0;
743 WARN_ON(de->subdir); 743 WARN_ON(de->subdir);
744 if (!atomic_read(&de->count)) 744 if (atomic_dec_and_test(&de->count))
745 free_proc_entry(de); 745 free_proc_entry(de);
746 else {
747 de->deleted = 1;
748 printk("remove_proc_entry: %s/%s busy, count=%d\n",
749 parent->name, de->name, atomic_read(&de->count));
750 }
751 break; 746 break;
752 } 747 }
753 spin_unlock(&proc_subdir_lock); 748 spin_unlock(&proc_subdir_lock);
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index abe6a3f04368..1a551d92e1d8 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -43,13 +43,8 @@ void de_put(struct proc_dir_entry *de)
43 return; 43 return;
44 } 44 }
45 45
46 if (atomic_dec_and_test(&de->count)) { 46 if (atomic_dec_and_test(&de->count))
47 if (de->deleted) { 47 free_proc_entry(de);
48 printk("de_put: deferred delete of %s\n",
49 de->name);
50 free_proc_entry(de);
51 }
52 }
53 unlock_kernel(); 48 unlock_kernel();
54 } 49 }
55} 50}
diff --git a/fs/proc/root.c b/fs/proc/root.c
index ec9cb3b6c93b..81f99e691f99 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -207,6 +207,7 @@ struct proc_dir_entry proc_root = {
207 .name = "/proc", 207 .name = "/proc",
208 .mode = S_IFDIR | S_IRUGO | S_IXUGO, 208 .mode = S_IFDIR | S_IRUGO | S_IXUGO,
209 .nlink = 2, 209 .nlink = 2,
210 .count = ATOMIC_INIT(1),
210 .proc_iops = &proc_root_inode_operations, 211 .proc_iops = &proc_root_inode_operations,
211 .proc_fops = &proc_root_operations, 212 .proc_fops = &proc_root_operations,
212 .parent = &proc_root, 213 .parent = &proc_root,