aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-09-18 12:11:56 +0200
committerChristian Brauner <brauner@kernel.org>2025-09-19 16:22:38 +0200
commit2438b7d63ad866d6b2bb7b8d3455a6365d9b0fbe (patch)
tree90ed1f20c06287ea716296686d58b777078596a3 /include
parentipv4: use check_net() (diff)
downloadlinux-2438b7d63ad866d6b2bb7b8d3455a6365d9b0fbe.tar.gz
linux-2438b7d63ad866d6b2bb7b8d3455a6365d9b0fbe.zip
uts: port to ns_ref_*() helpers
Stop accessing ns.count directly. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/uts_namespace.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/uts_namespace.h b/include/linux/uts_namespace.h
index c2b619bb4e57..23b4f0e1b338 100644
--- a/include/linux/uts_namespace.h
+++ b/include/linux/uts_namespace.h
@@ -25,7 +25,7 @@ static inline struct uts_namespace *to_uts_ns(struct ns_common *ns)
static inline void get_uts_ns(struct uts_namespace *ns)
{
- refcount_inc(&ns->ns.count);
+ ns_ref_inc(ns);
}
extern struct uts_namespace *copy_utsname(unsigned long flags,
@@ -34,7 +34,7 @@ extern void free_uts_ns(struct uts_namespace *ns);
static inline void put_uts_ns(struct uts_namespace *ns)
{
- if (refcount_dec_and_test(&ns->ns.count))
+ if (ns_ref_put(ns))
free_uts_ns(ns);
}