clone_private_mount(9)
π« clone_private_mount(9) β your very own private mount clone, no cap
hii bestie, welcome to the Kernel API Manual page for clone_private_mount. Yeah, the number in the parens is 9 β that's the section, we're in kernel-internals territory, buckle up π
πΈ NAME πΈ
clone_private_mount β literally creates a private clone of a path. That's the whole vibe. A little copy of your mount, off on its own, living its best solo life β¨
π¦ SYNOPSIS π¦
struct vfsmount * clone_private_mount (const struct path *path );
Yes the weird spacing is copy-pasted from the original, do not come for me π
π ARGUMENTS π
pathβ the path you want to clone. Like, the thing itself. Your main character path π
π₯ DESCRIPTION π₯
Okay so here's the tea: this function creates a brand new vfsmount, and that new mount is the clone of path. Slay. π
The new mount is not attached anywhere in the namespace β it's free-floating, unbothered, moisturised, in its lane π§. And it's private, meaning changes to the originating mount won't be propagated into this one. Not me making a whole separate mount so the original can't text it back π They're independent now, periodt.
β οΈ Important caveat bestie: this assumes the caller has called or done the equivalent of may_mount. The function is trusting you on that. Don't make it regret trusting you π
π And when you're done with it, release with mntput. Every clone needs a goodbye eventually. Don't leak it, the kernel will notice and it will be embarrassing π
π SEE ALSO π
Kernel file ./fs/namespace.c β and a whole friend group of mount-related functions, all in (9) land:
mnt_get_write_access(9)mnt_want_write(9)mnt_get_write_access_file(9)mnt_want_write_file(9)mnt_put_write_access(9)mnt_drop_write(9)mnt_hold_writers(9)mnt_unhold_writers(9)__lookup_mnt(9)lookup_mnt(9)attach_mnt(9)vfs_create_mount(9)path_is_mountpoint(9)may_umount_tree(9)may_umount(9)attach_recursive_mnt(9)do_lock_mount(9)path_overmounted(9)can_move_mount_beneath(9)mnt_set_expiry(9)mnt_allow_writers(9)
That's 21 of them fr fr, go read them all, iykyk π
okay that's the whole page bestie, love u, go clone a mount responsibly β¨
sourced from ./fs, dated October 2026, and yes, this is clone_private_mount(9) signing off π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms