]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - fs/namespace.c
vfs: opencode mntget() mnt_set_mountpoint()
[mirror_ubuntu-jammy-kernel.git] / fs / namespace.c
index 24e845671ad3fee1618b69eb585ed36d682a86e6..cd6389387d1fd9d1ec2cec5707ae87a1a651a053 100644 (file)
@@ -572,8 +572,9 @@ static void detach_mnt(struct mount *mnt, struct path *old_path)
 void mnt_set_mountpoint(struct mount *mnt, struct dentry *dentry,
                        struct mount *child_mnt)
 {
-       child_mnt->mnt_parent = real_mount(mntget(&mnt->mnt));
+       mnt_add_count(mnt, 1);  /* essentially, that's mntget */
        child_mnt->mnt_mountpoint = dget(dentry);
+       child_mnt->mnt_parent = mnt;
        spin_lock(&dentry->d_lock);
        dentry->d_flags |= DCACHE_MOUNTED;
        spin_unlock(&dentry->d_lock);