diff options
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r-- | fs/proc/generic.c | 9 |
1 files changed, 2 insertions, 7 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 | */ |
697 | void remove_proc_entry(const char *name, struct proc_dir_entry *parent) | 697 | void 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); |