generic_shutdown_super(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… generic_shutdown_super(9)

okay so this is a page from the Kernel API Manual (yes, the kernel has man pages, we love a documented king) and today we're learning about generic_shutdown_super β€” the common helper for ->kill_sb(). it's giving cleanup crew energy and honestly? iconic.


✨ SYNOPSIS ✨

void generic_shutdown_super (struct super_block *sb );

that's it. that's the whole vibe check. one function, one pointer, no drama.


πŸŽ€ ARGUMENTS πŸŽ€

  • sb β€” the superblock to kill. yeah, "kill" is the technical term bestie, the kernel is emo like that πŸ’€

🌸 DESCRIPTION 🌸

so generic_shutdown_super does all the fs-independent work on superblock shutdown. like, every filesystem has to tear stuff down, and this is the part where nobody has to reinvent the wheel β€” it's the shared chore list, fr fr.

the typical ->kill_sb flow goes like this, in order:

  1. pick all the fs-specific objects that need destruction out of the superblock
  2. call generic_shutdown_super
  3. release those aforementioned objects

that's the whole routine, and the ordering is not optional, it's just the way it goes πŸ’…

note note note: dentries and inodes _are_ taken care of. capital letters, italic, the whole thing. you do not need specific handling for them. don't touch. hands off. the kernel's got it 🫢

and then the serious part, the part where you must pay attention:

Upon calling this function, the filesystem may no longer alter or rearrange the set of dentries belonging to this super_block, nor may it change the attachments of dentries to inodes.

like, after this call, hands off the dentry collection and hands off the dentryβ†’inode attachments. no reshuffling, no re-hooking, none of it. it's a closed set now, okay? πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./fs/super.c β€” plus this whole squad of related functions, all of them, every single one, no cap:

go read them, bestie, they're all in the same neighbourhood 🧚


and that's the page! brought to you by ./fs, dated October 2026 β€” yeah, the future, we're ahead of schedule πŸ’œβœ¨

πŸ“¦ where this page comes from