kernfs_root_from_sb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kernfs_root_from_sb(9) β€” like, the kernel API manual edition πŸŽ€

okay so bestie, welcome to section 9 of the Kernel API Manual, and today's main character is literally kernfs_root_from_sb πŸ¦‹ (yes the (9) is part of the name, it's giving "I have a section number and I'm proud of it").


✨ NAME ✨

kernfs_root_from_sb β€” determine the kernfs_root associated with a super_block 🌸

like it just... finds the root for you. no cap, that's the whole gig 🫢


🌈 SYNOPSIS 🌈

struct kernfs_root * kernfs_root_from_sb (struct super_block *sb );

that's it. one function, one arg, returns a pointer to a struct kernfs_root. iconic behavior honestly πŸ’…


πŸ“ ARGUMENTS πŸ“

  • sb β€” the super_block in question πŸ‘€ like, the one you're curious about. the subject of the vibe check, if you will.

⭐ RETURN ⭐

it hands you back the kernfs_root associated with sb πŸŽ€ β€” that's the whole point, that's the slay.

⚠️ but listen: if sb is not a kernfs one, NULL is returned. so fr fr, check that pointer before you dereference it, bestie πŸ˜­πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./fs/kernfs/mount.c β€” and honestly the whole squad:

go read them, iykyk πŸ“šβœ¨


🧚 sign-off 🧚

this page lives in ./fs/kernfs, and it's dated October 2026 πŸ’– so yeah, that's the source, that's the version, that's the date β€” go forth and find those roots, bestie. periodt. πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from