mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 14:41:22 -05:00
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>
This commit is contained in:
@@ -143,7 +143,7 @@ static inline void detach_mounts(struct dentry *dentry)
|
||||
|
||||
static inline void get_mnt_ns(struct mnt_namespace *ns)
|
||||
{
|
||||
refcount_inc(&ns->ns.count);
|
||||
ns_ref_inc(ns);
|
||||
}
|
||||
|
||||
extern seqlock_t mount_lock;
|
||||
|
||||
@@ -2110,7 +2110,7 @@ struct mnt_namespace *get_sequential_mnt_ns(struct mnt_namespace *mntns, bool pr
|
||||
* the mount namespace and it might already be on its
|
||||
* deathbed.
|
||||
*/
|
||||
if (!refcount_inc_not_zero(&mntns->ns.count))
|
||||
if (!ns_ref_get(mntns))
|
||||
continue;
|
||||
|
||||
return mntns;
|
||||
@@ -6084,7 +6084,7 @@ void __init mnt_init(void)
|
||||
|
||||
void put_mnt_ns(struct mnt_namespace *ns)
|
||||
{
|
||||
if (!refcount_dec_and_test(&ns->ns.count))
|
||||
if (!ns_ref_put(ns))
|
||||
return;
|
||||
namespace_lock();
|
||||
emptied_ns = ns;
|
||||
|
||||
Reference in New Issue
Block a user