Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74613
b: refs/heads/master
c: 5a622f2
h: refs/heads/master
i:
  74611: 254ed36
v: v3
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Dec 5, 2007
1 parent 097096a commit f556171
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4beaf4ab5f89496f2bcf67db62ad95d99bfeff6
refs/heads/master: 5a622f2d0f86b316b07b55a4866ecb5518dd1cf7
9 changes: 2 additions & 7 deletions trunk/fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 2 additions & 7 deletions trunk/fs/proc/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 0 additions & 6 deletions trunk/fs/reiserfs/procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/proc_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f556171

Please sign in to comment.