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.

mnt: 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
fs/mount.h
··· 143 143 144 144 static inline void get_mnt_ns(struct mnt_namespace *ns) 145 145 { 146 - refcount_inc(&ns->ns.count); 146 + ns_ref_inc(ns); 147 147 } 148 148 149 149 extern seqlock_t mount_lock;
+2 -2
fs/namespace.c
··· 2110 2110 * the mount namespace and it might already be on its 2111 2111 * deathbed. 2112 2112 */ 2113 - if (!refcount_inc_not_zero(&mntns->ns.count)) 2113 + if (!ns_ref_get(mntns)) 2114 2114 continue; 2115 2115 2116 2116 return mntns; ··· 6084 6084 6085 6085 void put_mnt_ns(struct mnt_namespace *ns) 6086 6086 { 6087 - if (!refcount_dec_and_test(&ns->ns.count)) 6087 + if (!ns_ref_put(ns)) 6088 6088 return; 6089 6089 namespace_lock(); 6090 6090 emptied_ns = ns;