Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipc: 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>

+3 -3
+2 -2
include/linux/ipc_namespace.h
··· 140 140 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) 141 141 { 142 142 if (ns) 143 - refcount_inc(&ns->ns.count); 143 + ns_ref_inc(ns); 144 144 return ns; 145 145 } 146 146 147 147 static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns) 148 148 { 149 149 if (ns) { 150 - if (refcount_inc_not_zero(&ns->ns.count)) 150 + if (ns_ref_get(ns)) 151 151 return ns; 152 152 } 153 153
+1 -1
ipc/namespace.c
··· 199 199 */ 200 200 void put_ipc_ns(struct ipc_namespace *ns) 201 201 { 202 - if (refcount_dec_and_lock(&ns->ns.count, &mq_lock)) { 202 + if (ns_ref_put_and_lock(ns, &mq_lock)) { 203 203 mq_clear_sbinfo(ns); 204 204 spin_unlock(&mq_lock); 205 205