__lookup_mnt(9)
β¨ NAME β¨
Okay so bestie, this is __lookup_mnt from the Kernel API Manual β it's literally a mount hash lookup and it's giving main-character energy π.
π SYNOPSIS π
struct mount * __lookup_mnt (struct vfsmount *mnt , struct dentry *dentry );
πΈ ARGUMENTS πΈ
mntβ the parent mount, aka the one we're checking on π«Άdentryβ dentry of the mountpoint, aka where the mount is posted up π
π DESCRIPTION π
So if mnt has a child mount c mounted on dentry, you find it and return it. That's the whole vibe. β¨
But if mnt is unmounted and a child that was unmounted with it left its cover behind at dentry, return the stand-in for it instead: knullfs for a directory, its regular file for anything else. Not me learning about leftover covers ππ
β οΈ Locking check, bestie β this is non-negotiable: the caller must either hold the spinlock component ofmount_lockor holdrcu_read_lock, sample the seqcount component before the call and recheck it afterwards. No cap, do not skip this ππ₯
π¦ RETURN π¦
The child of mnt mounted on dentry, a stand-in or NULL. Periodt π
π 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), attach_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). Go read them, they ate ππ
Made with π in ./fs, October 2026 edition. Stay mounted, bestie π§π«Ά
π¦ 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