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

Configure Feed

Select the types of activity you want to include in your feed.

pid: 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
+1 -1
include/linux/pid_namespace.h
··· 62 62 static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) 63 63 { 64 64 if (ns != &init_pid_ns) 65 - refcount_inc(&ns->ns.count); 65 + ns_ref_inc(ns); 66 66 return ns; 67 67 } 68 68
+2 -2
kernel/pid_namespace.c
··· 169 169 parent = ns->parent; 170 170 destroy_pid_namespace(ns); 171 171 ns = parent; 172 - } while (ns != &init_pid_ns && refcount_dec_and_test(&ns->ns.count)); 172 + } while (ns != &init_pid_ns && ns_ref_put(ns)); 173 173 } 174 174 175 175 struct pid_namespace *copy_pid_ns(unsigned long flags, ··· 184 184 185 185 void put_pid_ns(struct pid_namespace *ns) 186 186 { 187 - if (ns && ns != &init_pid_ns && refcount_dec_and_test(&ns->ns.count)) 187 + if (ns && ns != &init_pid_ns && ns_ref_put(ns)) 188 188 schedule_work(&ns->work); 189 189 } 190 190 EXPORT_SYMBOL_GPL(put_pid_ns);