generic_ci_match(9)
π generic_ci_match(9) β or, the Kernel API Manual's take on case-insensitive matching
Okay so bestie, we're in generic_ci_match(9) land, straight out of the Kernel API Manual, and this one is lowkey a little superstar helper. Let's get into it β¨
πΈ NAME πΈ
generic_ci_match β matches a name against a dirent, and it does it case-insensitively. It's a filesystem helper for comparison with directory entries, fr fr.
And the plot twist: generic_ci_d_compare should be the one you actually use in VFS' ->d_compare instead. So like, generic_ci_match is the backstage crew, generic_ci_d_compare is the main character. Iykyk π
β¨ SYNOPSIS β¨
int generic_ci_match (const struct inode *parent , const struct qstr
*name , const struct qstr *folded_name , const u8 *de_name , u32
de_name_len );
That's the whole vibe check right there π
π¦ ARGUMENTS π¦
parentβ the inode of the parent of the dirent under comparison. It's giving "who's your mom" energy πnameβ the name under lookup. The one we're hunting for π₯folded_nameβ an optional pre-folded name under lookup. Already did the work? Slay, we'll respect that π«Άde_nameβ the dirent name. The candidate on the runway πde_name_lenβ the dirent name length. Gotta know how much of it to look at, periodt π
π DESCRIPTION π
So the whole thing here is testing whether a case-insensitive directory entry matches the filename being searched. That's it, that's the job. Ngl it's a simple little queen.
And here's the cute detail: if folded_name is provided, it gets used instead of recalculating the casefold of name. No double work, no wasting CPU, we love an efficient icon π
β¨
β RETURN β
- >
0β the directory entry matches, we cheer π 0β no match, ok move along π- <
0β error, something went wrong, and honestly π
π SEE ALSO π
Bestie, buckle up, this list is long and honestly a whole friend group. All from 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_set_sb_d_ops(9)inode_maybe_inc_iversion(9)inode_query_iversion(9)simple_inode_init_ts(9)path_from_stashed(9)simple_start_creating(9)
Every single one, no skips, we don't do that here π
Okay that's the whole page! Go forth and match those dirents case-insensitively, queen π
And a lil sign-off before you close the tab: this one lives in ./fs, dated October 2026, and its whole name-tag is generic_ci_match(9). Byeeeee π¦πΈπ
π¦ 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