Unverified Commit 96d997ea authored by Christian Brauner's avatar Christian Brauner
Browse files

user: port to ns_ref_*() helpers



Stop accessing ns.count directly.

Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent e0c173f1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ static inline struct user_namespace *to_user_ns(struct ns_common *ns)
static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
{
	if (ns)
		refcount_inc(&ns->ns.count);
		ns_ref_inc(ns);
	return ns;
}

@@ -186,7 +186,7 @@ extern void __put_user_ns(struct user_namespace *ns);

static inline void put_user_ns(struct user_namespace *ns)
{
	if (ns && refcount_dec_and_test(&ns->ns.count))
	if (ns && ns_ref_put(ns))
		__put_user_ns(ns);
}

+1 −1
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ static void free_user_ns(struct work_struct *work)
		kfree_rcu(ns, ns.ns_rcu);
		dec_user_namespaces(ucounts);
		ns = parent;
	} while (refcount_dec_and_test(&parent->ns.count));
	} while (ns_ref_put(parent));
}

void __put_user_ns(struct user_namespace *ns)