vfs_create_mount(9)
π
vfs_create_mount β the vfs_create_mount(9) glow-up π
okay so bestie, welcome to the Kernel API Manual β¨ this one's short and sweet and honestly kind of a vibe.
πΈ NAME πΈ
vfs_create_mount β literally just: create a mount for a configured superblock. that's her whole job. no cap π
β¨ SYNOPSIS β¨
struct vfsmount * vfs_create_mount (struct fs_context *fc );
like yes, she returns a struct vfsmount * and she takes exactly one thing. lowkey elegant.
π¦ ARGUMENTS π¦
fcβ the configuration context, with the superblock already attached to it. that's it. that's the whole arg. she's not asking for much, she's asking for thefs_contextπ«Ά
π DESCRIPTION π
ok so what she does: she creates a mount pointing at a superblock that is already configured. already done. already slayed. she does not configure it for you, she is not doing that labor π
and if it's necessary β if, okay, depends on your situation β the caller should invoke vfs_get_tree before calling this. so like, get your tree first bestie. vfs_get_tree then vfs_create_mount. order matters, iykyk π
β οΈ and this is the important bit so listen up: this does not attach the mount to anything. she creates the mount, she does NOT hang it anywhere. it's just floating there. main character energy, but unhoused. if you thought this function was gonna do the attaching for you β no. she said not my job π you gotta attach it yourself.
π₯ SEE ALSO π₯
the kernel file ./fs/namespace.c is where all of this lives, and she's got a whole friend group in there, fr fr:
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)path_is_mountpoint(9)may_umount_tree(9)may_umount(9)clone_private_mount(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)
twenty-one whole besties. go say hi π
and that's the page!! signing off from ./fs π§ dated October 2026 β mwah, love u, go attach your mounts properly ππ
π¦ 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