summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-04-12 17:27:28 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-01 17:29:46 -0400
commita8ca16ea7b0abb0a7e49492d1123b715f0ec62e8 (patch)
treefe201353c71385cab2f3cc0d7235c76121f51789 /fs
parent8d8b97ba499cb69fccb5fd9f2b439e3265fc3f27 (diff)
downloadlinux-a8ca16ea7b0abb0a7e49492d1123b715f0ec62e8.tar.bz2
proc: Supply a function to remove a proc entry by PDE
Supply a function (proc_remove()) to remove a proc entry (and any subtree rooted there) by proc_dir_entry pointer rather than by name and (optionally) root dir entry pointer. This allows us to eliminate all remaining pde->name accesses outside of procfs. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Grant Likely <grant.likely@linaro.or> cc: linux-acpi@vger.kernel.org cc: openipmi-developer@lists.sourceforge.net cc: devicetree-discuss@lists.ozlabs.org cc: linux-pci@vger.kernel.org cc: netdev@vger.kernel.org cc: netfilter-devel@vger.kernel.org cc: alsa-devel@alsa-project.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/generic.c7
-rw-r--r--fs/proc/vmcore.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 75e08d36b2f1..d9631d9b7aff 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -624,3 +624,10 @@ void *proc_get_parent_data(const struct inode *inode)
return de->parent->data;
}
EXPORT_SYMBOL_GPL(proc_get_parent_data);
+
+void proc_remove(struct proc_dir_entry *de)
+{
+ if (de)
+ remove_proc_subtree(de->name, de->parent);
+}
+EXPORT_SYMBOL(proc_remove);
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 38edddc25816..17f7e080d7ff 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -699,7 +699,7 @@ void vmcore_cleanup(void)
struct list_head *pos, *next;
if (proc_vmcore) {
- remove_proc_entry(proc_vmcore->name, proc_vmcore->parent);
+ proc_remove(proc_vmcore);
proc_vmcore = NULL;
}