grab_super(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… grab_super(9) β€” the kernel API manual, but make it make sense πŸŽ€

okay so bestie, we're in section 9 of the kernel API manual today (yes, the kernel kernel), and the star of the show is grab_super. it's a little function living over in ./fs/super.c and honestly it's giving "bouncer at the club of mounted filesystems" energy. let's get into it πŸ’–


✨ NAME ✨

grab_super β€” acquire an active reference to a superblock. that's it, that's the whole vibe. it grabs. it supers. πŸ”₯


🌸 SYNOPSIS 🌸

bool grab_super (struct super_block *sb );

look at her. one argument, returns a bool, no notes. iconic. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • sb β€” the superblock you wanna acquire, bestie. that's the target. 🎯

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜• β€” grab_super acquires a temporary reference on a superblock, and then it tries to trade that temp reference for an active reference. like, it's holding a lil placeholder spot in line and hoping the bouncer lets it in for real. no cap.

where does this come up? in sget_fc, that's where. grab_super is used there to wait for a superblock to do one of two things:

  1. become SB_BORN (glow up complete ✨), or
  2. pass through sb->kill and get marked as SB_DEAD (rip bozo πŸ’€)

either way, it's waiting for the superblock to pick a lane. main character energy fr fr. 🧚


⭐ RETURN ⭐

  • returns true if an active reference could be acquired πŸŽ‰
  • returns false if not πŸ™ˆ

that's it. binary queen. bool supremacy. πŸ’œ


🌈 SEE ALSO 🌈

the whole friend group, gathered here in ./fs (kernel file ./fs/super.c, to be specific):

go read all of them, i'll wait. 🫢


lowkey a reminder that this whole page lives under ./fs in the kernel tree β€” that's the directory, bestie, not a suggestion.

and that's the page! πŸ’– this lil writeup came from ./fs, dated October 2026, and it's the grab_super(9) entry β€” go off, kernel docs, you ate. πŸ“βœ¨

πŸ“¦ where this page comes from