summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2016-07-30 13:53:37 -0500
committerEric W. Biederman <ebiederm@xmission.com>2016-08-08 09:17:18 -0500
commitb032132c3c218f4a09e9499b3674299a752581c6 (patch)
tree053a27f83f9bf00638197f451f49117cfe110fea /include
parent13bcc6a2853435bb5dad368bcbaa9d2a5b9c0ac4 (diff)
downloadlinux-b032132c3c218f4a09e9499b3674299a752581c6.tar.gz
linux-b032132c3c218f4a09e9499b3674299a752581c6.tar.bz2
linux-b032132c3c218f4a09e9499b3674299a752581c6.zip
userns: Free user namespaces in process context
Add the necessary boiler plate to move freeing of user namespaces into work queue and thus into process context where things can sleep. This is a necessary precursor to per user namespace sysctls. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/user_namespace.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index 9217169c64cb..4e79b3c64dee 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -39,6 +39,7 @@ struct user_namespace {
struct key *persistent_keyring_register;
struct rw_semaphore persistent_keyring_register_sem;
#endif
+ struct work_struct work;
};
extern struct user_namespace init_user_ns;
@@ -54,12 +55,12 @@ static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
extern int create_user_ns(struct cred *new);
extern int unshare_userns(unsigned long unshare_flags, struct cred **new_cred);
-extern void free_user_ns(struct user_namespace *ns);
+extern void __put_user_ns(struct user_namespace *ns);
static inline void put_user_ns(struct user_namespace *ns)
{
if (ns && atomic_dec_and_test(&ns->count))
- free_user_ns(ns);
+ __put_user_ns(ns);
}
struct seq_operations;