generic_shutdown_super(9)
π 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:
- pick all the fs-specific objects that need destruction out of the superblock
- call
generic_shutdown_super - 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:
super_lock(9)alloc_super(9)deactivate_locked_super(9)deactivate_super(9)grab_super(9)retire_super(9)sget_fc(9)iterate_supers_type(9)reconfigure_super(9)emergency_thaw_all(9)get_anon_bdev(9)sget_dev(9)fs_bdev_freeze(9)fs_bdev_thaw(9)fs_bdev_file_open_by_dev(9)fs_bdev_file_open_by_path(9)fs_bdev_unregister(9)fs_bdev_file_release(9)get_tree_bdev_flags(9)get_tree_bdev(9)vfs_get_tree(9)sb_wait_write(9)freeze_super(9)thaw_super(9)
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
- 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