generic_set_sb_d_ops(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ generic_set_sb_d_ops ✨ (section 9, Kernel API Manual, bestie)

okay so real talk, this one is a tiny little helper function but it's lowkey carrying the whole mount-time vibe for filesystems that do fancy name stuff. it lives in the kernel API manual, section 9, and it's the girl who picks out your outfit for you πŸ’…


🌸 SYNOPSIS 🌸

void generic_set_sb_d_ops (struct super_block *sb );

that's it. that's the whole signature. no return value, she just does the thing 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • sb β€” the superblock that's getting configured. like, the actual superblock being set up. she's the main character here, everything happens to her πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: your filesystem supports casefolding and/or fscrypt πŸ‘€ (yes, both, the "and/or" is doing real work there). if that's you, you can call this helper at mount-time and it'll configure the default dentry_operations to the best set of dentry operations for whatever features you've got enabled. it's giving personal shopper. it's giving "i already know your size" ✨

but here's the timing thing, and the timing is everything:

the helper must be called after those features (casefolding / fscrypt) have been configured, but before the root dentry is created. not before the features, not after the root dentry. the window is that window. miss it and, well, you missed the window 😭

so: features configured βœ… β†’ call generic_set_sb_d_ops βœ… β†’ root dentry created βœ…. in that order, no cap, fr fr 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, assembled. these are all in the kernel file ./fs/libfs.c:

like genuinely go read the ci ones if you're here for the casefolding lore (generic_ci_d_compare(9), generic_ci_d_hash(9), generic_ci_match(9)) β€” they're the ones doing the actual comparison/hashing/matching work that this helper is out here choosing for you 🧚


and that's the page!! mwah πŸ’‹ this one's from ./fs, dated October 2026, and yeah the header up top says generic_set_sb_d_ops(9) and the footer says the same thing, because she's consistent like that. slay, go mount something πŸŽ€πŸ’œ

πŸ“¦ where this page comes from