]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ipc: port to ns_ref_*() helpers
authorChristian Brauner <brauner@kernel.org>
Thu, 18 Sep 2025 10:11:49 +0000 (12:11 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 19 Sep 2025 14:22:37 +0000 (16:22 +0200)
Stop accessing ns.count directly.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/ipc_namespace.h
ipc/namespace.c

index 924e4754374fbabc65804699c52ecf4d090c5b23..21eff63f47dae10a004b2a96d46214a64c554464 100644 (file)
@@ -140,14 +140,14 @@ extern struct ipc_namespace *copy_ipcs(unsigned long flags,
 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
 {
        if (ns)
-               refcount_inc(&ns->ns.count);
+               ns_ref_inc(ns);
        return ns;
 }
 
 static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns)
 {
        if (ns) {
-               if (refcount_inc_not_zero(&ns->ns.count))
+               if (ns_ref_get(ns))
                        return ns;
        }
 
index 09d261a1a2aa4fc33bab3d3de62c32c6b60336ee..bd85d1c9d2c21394005df878ea5dc78294f2de8a 100644 (file)
@@ -199,7 +199,7 @@ static void free_ipc(struct work_struct *unused)
  */
 void put_ipc_ns(struct ipc_namespace *ns)
 {
-       if (refcount_dec_and_lock(&ns->ns.count, &mq_lock)) {
+       if (ns_ref_put_and_lock(ns, &mq_lock)) {
                mq_clear_sbinfo(ns);
                spin_unlock(&mq_lock);