static int attach_recursive_mnt(struct vfsmount *source_mnt, struct nameidata *nd, struct nameidata *parent_nd)

struct vfsmount *dest_mnt = nd->mnt; struct dentry *dest_dentry = nd->dentry;

mnt_set_mountpoint(dest_mnt, dest_dentry, source_mnt); commit_tree(source_mnt);

nameidata is a structure used to group together a vfsmnt instance and a dentry instance. In this case, the structure holds the dentry instance of the mount point and the vfsmnt instance of the filesystem in which the directory was previously located, that is, before the new mount was performed.

mnt_set_mountpoint ensures that both the mnt_parent and the mnt_mountpoint element of the new vfsmnt instance child_mount are set to point to the old elements:

Continue reading here: Fsnamespacec

Was this article helpful?

0 0