diff options
| -rw-r--r-- | fs/proc/generic.c | 9 | ||||
| -rw-r--r-- | fs/proc/inode.c | 9 | ||||
| -rw-r--r-- | fs/proc/root.c | 1 | ||||
| -rw-r--r-- | fs/reiserfs/procfs.c | 6 | ||||
| -rw-r--r-- | include/linux/proc_fs.h | 1 |
5 files changed, 5 insertions, 21 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); |
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, |
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index 9aa7a06e093f..001144621672 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c | |||
| @@ -420,12 +420,6 @@ static void *r_start(struct seq_file *m, loff_t * pos) | |||
| 420 | return NULL; | 420 | return NULL; |
| 421 | 421 | ||
| 422 | up_write(&s->s_umount); | 422 | up_write(&s->s_umount); |
| 423 | |||
| 424 | if (de->deleted) { | ||
| 425 | deactivate_super(s); | ||
| 426 | return NULL; | ||
| 427 | } | ||
| 428 | |||
| 429 | return s; | 423 | return s; |
| 430 | } | 424 | } |
| 431 | 425 | ||
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 523528d237b0..a5316829215b 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -77,7 +77,6 @@ struct proc_dir_entry { | |||
| 77 | read_proc_t *read_proc; | 77 | read_proc_t *read_proc; |
| 78 | write_proc_t *write_proc; | 78 | write_proc_t *write_proc; |
| 79 | atomic_t count; /* use count */ | 79 | atomic_t count; /* use count */ |
| 80 | int deleted; /* delete flag */ | ||
| 81 | int pde_users; /* number of callers into module in progress */ | 80 | int pde_users; /* number of callers into module in progress */ |
| 82 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | 81 | spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ |
| 83 | struct completion *pde_unload_completion; | 82 | struct completion *pde_unload_completion; |
