clone_private_mount(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« 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:

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