summaryrefslogtreecommitdiff
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-05-02 04:12:41 -0700
committerDavid S. Miller <davem@davemloft.net>2008-05-02 04:12:41 -0700
commit78e92b99ec4eb73755abd4e357b0b211eadafd88 (patch)
tree8db0049da6d0ce0a968b11fae12f3f91664881dd /fs/proc/generic.c
parent8b169240e266d7fc58d9b9077d18d50a548d9732 (diff)
netns: assign PDE->data before gluing entry into /proc tree
In this unfortunate case, proc_mkdir_mode wrapper can't be used anymore and this is no way to reuse proc_create_data due to nlinks assignment. So, copy the code from proc_mkdir and assign PDE->data at the appropriate moment. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r--fs/proc/generic.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 9d53b39a9cf8..43e54e86cefd 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -641,6 +641,23 @@ struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode,
return ent;
}
+struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
+ struct proc_dir_entry *parent)
+{
+ struct proc_dir_entry *ent;
+
+ ent = __proc_create(&parent, name, S_IFDIR | S_IRUGO | S_IXUGO, 2);
+ if (ent) {
+ ent->data = net;
+ if (proc_register(parent, ent) < 0) {
+ kfree(ent);
+ ent = NULL;
+ }
+ }
+ return ent;
+}
+EXPORT_SYMBOL_GPL(proc_net_mkdir);
+
struct proc_dir_entry *proc_mkdir(const char *name,
struct proc_dir_entry *parent)
{