|
@@ -22,6 +22,7 @@
|
|
#include <linux/ns_common.h>
|
|
#include <linux/ns_common.h>
|
|
#include <linux/nsproxy.h>
|
|
#include <linux/nsproxy.h>
|
|
#include <linux/user_namespace.h>
|
|
#include <linux/user_namespace.h>
|
|
|
|
+#include <linux/refcount.h>
|
|
|
|
|
|
#include <linux/cgroup-defs.h>
|
|
#include <linux/cgroup-defs.h>
|
|
|
|
|
|
@@ -640,7 +641,7 @@ static inline void cgroup_sk_free(struct sock_cgroup_data *skcd) {}
|
|
#endif /* CONFIG_CGROUP_DATA */
|
|
#endif /* CONFIG_CGROUP_DATA */
|
|
|
|
|
|
struct cgroup_namespace {
|
|
struct cgroup_namespace {
|
|
- atomic_t count;
|
|
|
|
|
|
+ refcount_t count;
|
|
struct ns_common ns;
|
|
struct ns_common ns;
|
|
struct user_namespace *user_ns;
|
|
struct user_namespace *user_ns;
|
|
struct ucounts *ucounts;
|
|
struct ucounts *ucounts;
|
|
@@ -675,12 +676,12 @@ copy_cgroup_ns(unsigned long flags, struct user_namespace *user_ns,
|
|
static inline void get_cgroup_ns(struct cgroup_namespace *ns)
|
|
static inline void get_cgroup_ns(struct cgroup_namespace *ns)
|
|
{
|
|
{
|
|
if (ns)
|
|
if (ns)
|
|
- atomic_inc(&ns->count);
|
|
|
|
|
|
+ refcount_inc(&ns->count);
|
|
}
|
|
}
|
|
|
|
|
|
static inline void put_cgroup_ns(struct cgroup_namespace *ns)
|
|
static inline void put_cgroup_ns(struct cgroup_namespace *ns)
|
|
{
|
|
{
|
|
- if (ns && atomic_dec_and_test(&ns->count))
|
|
|
|
|
|
+ if (ns && refcount_dec_and_test(&ns->count))
|
|
free_cgroup_ns(ns);
|
|
free_cgroup_ns(ns);
|
|
}
|
|
}
|
|
|
|
|