]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/user_namespace.h
Merge branch 'mips-next-3.10' of git://git.linux-mips.org/pub/scm/john/linux-john...
[karo-tx-linux.git] / include / linux / user_namespace.h
index b9bd2e6c73ccb51ec8f4fadec473d64bcb689fea..b6b215f13b453091ff2be0fae11b37a5a51c0c84 100644 (file)
@@ -21,11 +21,13 @@ struct user_namespace {
        struct uid_gid_map      uid_map;
        struct uid_gid_map      gid_map;
        struct uid_gid_map      projid_map;
-       struct kref             kref;
+       atomic_t                count;
        struct user_namespace   *parent;
        kuid_t                  owner;
        kgid_t                  group;
        unsigned int            proc_inum;
+       bool                    may_mount_sysfs;
+       bool                    may_mount_proc;
 };
 
 extern struct user_namespace init_user_ns;
@@ -35,18 +37,18 @@ extern struct user_namespace init_user_ns;
 static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
 {
        if (ns)
-               kref_get(&ns->kref);
+               atomic_inc(&ns->count);
        return 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 kref *kref);
+extern void free_user_ns(struct user_namespace *ns);
 
 static inline void put_user_ns(struct user_namespace *ns)
 {
-       if (ns)
-               kref_put(&ns->kref, free_user_ns);
+       if (ns && atomic_dec_and_test(&ns->count))
+               free_user_ns(ns);
 }
 
 struct seq_operations;
@@ -82,4 +84,6 @@ static inline void put_user_ns(struct user_namespace *ns)
 
 #endif
 
+void update_mnt_policy(struct user_namespace *userns);
+
 #endif /* _LINUX_USER_H */