generic_set_sb_d_ops(9)
β¨ 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:
simple_offset_init(9)simple_offset_add(9)simple_offset_remove(9)simple_offset_rename(9)simple_offset_rename_exchange(9)simple_offset_destroy(9)offset_dir_llseek(9)offset_readdir(9)simple_rename_timestamp(9)simple_setattr(9)simple_write_end(9)simple_read_from_buffer(9)simple_write_to_buffer(9)memory_read_from_buffer(9)generic_encode_ino32_fh(9)generic_fh_to_dentry(9)generic_fh_to_parent(9)simple_fsync_noflush(9)simple_fsync(9)generic_check_addressable(9)simple_get_link(9)generic_ci_d_compare(9)generic_ci_d_hash(9)generic_ci_match(9)inode_maybe_inc_iversion(9)inode_query_iversion(9)simple_inode_init_ts(9)path_from_stashed(9)simple_start_creating(9)
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
- 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