summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-11-01 00:45:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-12-04 14:34:36 -0500
commit6344c433a452b1a05d03a61a6a85d89f793bb7b8 (patch)
treed7fb4505dc394206c1b98bb02dfc58cce16dfe7c /kernel
parent64964528b24ea390824f0e5ce9d34b8d39b28cde (diff)
downloadlinux-6344c433a452b1a05d03a61a6a85d89f793bb7b8.tar.gz
linux-6344c433a452b1a05d03a61a6a85d89f793bb7b8.tar.bz2
linux-6344c433a452b1a05d03a61a6a85d89f793bb7b8.zip
new helpers: ns_alloc_inum/ns_free_inum
take struct ns_common *, for now simply wrappers around proc_{alloc,free}_inum() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/pid_namespace.c4
-rw-r--r--kernel/user_namespace.c4
-rw-r--r--kernel/utsname.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 79aabce49a85..5aa9158a84d5 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -105,7 +105,7 @@ static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns
if (ns->pid_cachep == NULL)
goto out_free_map;
- err = proc_alloc_inum(&ns->ns.inum);
+ err = ns_alloc_inum(&ns->ns);
if (err)
goto out_free_map;
@@ -142,7 +142,7 @@ static void destroy_pid_namespace(struct pid_namespace *ns)
{
int i;
- proc_free_inum(ns->ns.inum);
+ ns_free_inum(&ns->ns);
for (i = 0; i < PIDMAP_ENTRIES; i++)
kfree(ns->pidmap[i].page);
put_user_ns(ns->user_ns);
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 29cd5ccfc37a..6bf8177768e5 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -86,7 +86,7 @@ int create_user_ns(struct cred *new)
if (!ns)
return -ENOMEM;
- ret = proc_alloc_inum(&ns->ns.inum);
+ ret = ns_alloc_inum(&ns->ns);
if (ret) {
kmem_cache_free(user_ns_cachep, ns);
return ret;
@@ -136,7 +136,7 @@ void free_user_ns(struct user_namespace *ns)
#ifdef CONFIG_PERSISTENT_KEYRINGS
key_put(ns->persistent_keyring_register);
#endif
- proc_free_inum(ns->ns.inum);
+ ns_free_inum(&ns->ns);
kmem_cache_free(user_ns_cachep, ns);
ns = parent;
} while (atomic_dec_and_test(&parent->count));
diff --git a/kernel/utsname.c b/kernel/utsname.c
index 20697befe466..c2a2b321d88a 100644
--- a/kernel/utsname.c
+++ b/kernel/utsname.c
@@ -42,7 +42,7 @@ static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns,
if (!ns)
return ERR_PTR(-ENOMEM);
- err = proc_alloc_inum(&ns->ns.inum);
+ err = ns_alloc_inum(&ns->ns);
if (err) {
kfree(ns);
return ERR_PTR(err);
@@ -84,7 +84,7 @@ void free_uts_ns(struct kref *kref)
ns = container_of(kref, struct uts_namespace, kref);
put_user_ns(ns->user_ns);
- proc_free_inum(ns->ns.inum);
+ ns_free_inum(&ns->ns);
kfree(ns);
}