summaryrefslogtreecommitdiff
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-26 13:26:19 +0400
committerIngo Molnar <mingo@elte.hu>2008-07-26 13:26:19 +0400
commit88bef5a4074e0568cf54df410f41065c06694d8a (patch)
treebc4d59f57ce315bcb16dad5491ab9983ab122d8a /fs/proc/generic.c
parent054a3fd824705543322d787893de9f3755151517 (diff)
parent024e8ac04453b3525448c31ef39848cf675ba6db (diff)
downloadlinux-88bef5a4074e0568cf54df410f41065c06694d8a.tar.xz
Merge branch 'linus' into x86/urgent
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r--fs/proc/generic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 43e54e86cefd..bc0a0dd2d844 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -597,6 +597,7 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
ent->pde_users = 0;
spin_lock_init(&ent->pde_unload_lock);
ent->pde_unload_completion = NULL;
+ INIT_LIST_HEAD(&ent->pde_openers);
out:
return ent;
}
@@ -789,6 +790,19 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
spin_unlock(&de->pde_unload_lock);
continue_removing:
+ spin_lock(&de->pde_unload_lock);
+ while (!list_empty(&de->pde_openers)) {
+ struct pde_opener *pdeo;
+
+ pdeo = list_first_entry(&de->pde_openers, struct pde_opener, lh);
+ list_del(&pdeo->lh);
+ spin_unlock(&de->pde_unload_lock);
+ pdeo->release(pdeo->inode, pdeo->file);
+ kfree(pdeo);
+ spin_lock(&de->pde_unload_lock);
+ }
+ spin_unlock(&de->pde_unload_lock);
+
if (S_ISDIR(de->mode))
parent->nlink--;
de->nlink = 0;