]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ovl: Create ovl_casefold() to support casefolded strncmp()
authorAndré Almeida <andrealmeid@igalia.com>
Fri, 22 Aug 2025 14:17:07 +0000 (11:17 -0300)
committerAmir Goldstein <amir73il@gmail.com>
Tue, 23 Sep 2025 10:29:35 +0000 (12:29 +0200)
commitee95c5fc86ddd10c354da554442582a2d12a1b90
tree301c8acfb0404d1f3769c2f824089f96b222a25a
parent5fbf73c7f13ddd5d30dde6760955e644ceffe2ee
ovl: Create ovl_casefold() to support casefolded strncmp()

To add overlayfs support casefold layers, create a new function
ovl_casefold(), to be able to do case-insensitive strncmp().

ovl_casefold() allocates a new buffer and stores the casefolded version
of the string on it. If the allocation or the casefold operation fails,
fallback to use the original string.

The case-insentive name is then used in the rb-tree search/insertion
operation. If the name is found in the rb-tree, the name can be
discarded and the buffer is freed. If the name isn't found, it's then
stored at struct ovl_cache_entry to be used later.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
fs/overlayfs/readdir.c