From f5561714b4f6b7ae597355e638580211772ef09e Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 4 Dec 2007 23:45:28 -0800 Subject: [PATCH] --- yaml --- r: 74613 b: refs/heads/master c: 5a622f2d0f86b316b07b55a4866ecb5518dd1cf7 h: refs/heads/master i: 74611: 254ed366bb1a4f007b1c5852b8c6bda2fcb88b81 v: v3 --- [refs] | 2 +- trunk/fs/proc/generic.c | 9 ++------- trunk/fs/proc/inode.c | 9 ++------- trunk/fs/proc/root.c | 1 + trunk/fs/reiserfs/procfs.c | 6 ------ trunk/include/linux/proc_fs.h | 1 - 6 files changed, 6 insertions(+), 22 deletions(-) diff --git a/[refs] b/[refs] index 6b2b5dd78ca8..f507c964f238 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d4beaf4ab5f89496f2bcf67db62ad95d99bfeff6 +refs/heads/master: 5a622f2d0f86b316b07b55a4866ecb5518dd1cf7 diff --git a/trunk/fs/proc/generic.c b/trunk/fs/proc/generic.c index 5fccfe222a63..8d49838e5554 100644 --- a/trunk/fs/proc/generic.c +++ b/trunk/fs/proc/generic.c @@ -595,6 +595,7 @@ static struct proc_dir_entry *proc_create(struct proc_dir_entry **parent, ent->namelen = len; ent->mode = mode; ent->nlink = nlink; + atomic_set(&ent->count, 1); ent->pde_users = 0; spin_lock_init(&ent->pde_unload_lock); ent->pde_unload_completion = NULL; @@ -692,7 +693,6 @@ void free_proc_entry(struct proc_dir_entry *de) /* * Remove a /proc entry and free it if it's not currently in use. - * If it is in use, we set the 'deleted' flag. */ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) { @@ -741,13 +741,8 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) parent->nlink--; de->nlink = 0; WARN_ON(de->subdir); - if (!atomic_read(&de->count)) + if (atomic_dec_and_test(&de->count)) free_proc_entry(de); - else { - de->deleted = 1; - printk("remove_proc_entry: %s/%s busy, count=%d\n", - parent->name, de->name, atomic_read(&de->count)); - } break; } spin_unlock(&proc_subdir_lock); diff --git a/trunk/fs/proc/inode.c b/trunk/fs/proc/inode.c index abe6a3f04368..1a551d92e1d8 100644 --- a/trunk/fs/proc/inode.c +++ b/trunk/fs/proc/inode.c @@ -43,13 +43,8 @@ void de_put(struct proc_dir_entry *de) return; } - if (atomic_dec_and_test(&de->count)) { - if (de->deleted) { - printk("de_put: deferred delete of %s\n", - de->name); - free_proc_entry(de); - } - } + if (atomic_dec_and_test(&de->count)) + free_proc_entry(de); unlock_kernel(); } } diff --git a/trunk/fs/proc/root.c b/trunk/fs/proc/root.c index ec9cb3b6c93b..81f99e691f99 100644 --- a/trunk/fs/proc/root.c +++ b/trunk/fs/proc/root.c @@ -207,6 +207,7 @@ struct proc_dir_entry proc_root = { .name = "/proc", .mode = S_IFDIR | S_IRUGO | S_IXUGO, .nlink = 2, + .count = ATOMIC_INIT(1), .proc_iops = &proc_root_inode_operations, .proc_fops = &proc_root_operations, .parent = &proc_root, diff --git a/trunk/fs/reiserfs/procfs.c b/trunk/fs/reiserfs/procfs.c index 9aa7a06e093f..001144621672 100644 --- a/trunk/fs/reiserfs/procfs.c +++ b/trunk/fs/reiserfs/procfs.c @@ -420,12 +420,6 @@ static void *r_start(struct seq_file *m, loff_t * pos) return NULL; up_write(&s->s_umount); - - if (de->deleted) { - deactivate_super(s); - return NULL; - } - return s; } diff --git a/trunk/include/linux/proc_fs.h b/trunk/include/linux/proc_fs.h index 523528d237b0..a5316829215b 100644 --- a/trunk/include/linux/proc_fs.h +++ b/trunk/include/linux/proc_fs.h @@ -77,7 +77,6 @@ struct proc_dir_entry { read_proc_t *read_proc; write_proc_t *write_proc; atomic_t count; /* use count */ - int deleted; /* delete flag */ int pde_users; /* number of callers into module in progress */ spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ struct completion *pde_unload_completion;