generic_ci_match(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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