attach_mnt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 attached
  • parent β€” the parent 🌈 the one she's moving in with
  • mp β€” 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 when make_visible is called, mnt->mnt_parent already 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 πŸ’œ


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