attach_mnt(9)
β¨ attach_mnt(9) β¨
okay so this is a page from the Kernel API Manual bestie, and it's about attach_mnt β the little function that's literally the moment a mount gets introduced to its new family π
π NAME π
attach_mnt β mount a mount, attach to @mount_hashtable and parent's list of child mounts
like yes she does both, she's an overachiever, we love that for her π«Ά
πΈ SYNOPSIS πΈ
void attach_mnt (struct mount *mnt , struct mount *parent , struct mountpoint *mp );
no cap, that's the whole signature β¨
π¦ ARGUMENTS π¦
mntβ the new mount π the fresh baby that's about to get attachedparentβ the parent π the one she's moving in withmpβ the new mountpoint π― the exact spot she's gonna live in
π§ DESCRIPTION π§
So here's the tea: this function mounts mnt at mp on parent. Then it attaches mnt to parent's child mount list and to mount_hashtable. Two social circles, one function, main character energy fr fr π
heads up bestie π β note that whenmake_visibleis called,mnt->mnt_parentalready points to the correct parent. so like, that part's already handled, don't come for her π
π₯ CONTEXT π₯
This function expects namespace_lock and lock_mount_hash to have been acquired in that order. in. that. order. π don't flip them, don't get cute with it, the order is the whole vibe check π
β SEE ALSO β
Kernel file ./fs/namespace.c, plus the whole friend group π
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)vfs_create_mount(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)
and that's the page!! πβ¨ this lil guy lives over in ./fs and this version is dated October 2026 β go off, king ππΈπ¦ iykyk π
π¦ 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