diff options
author | Gabriel Krisman Bertazi <krisman@collabora.com> | 2024-06-06 10:33:49 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-06-07 17:00:44 +0200 |
commit | 6a79a4e187bdd17959ff3e811d5de65c066f89e6 (patch) | |
tree | 825f3134fd606ea5127356a84d46a7ef7a1f8df6 /include/linux/fs.h | |
parent | 632f4054b229513cdbd1e29a54ddd96fe67d00df (diff) |
libfs: Introduce case-insensitive string comparison helper
generic_ci_match can be used by case-insensitive filesystems to compare
strings under lookup with dirents in a case-insensitive way. This
function is currently reimplemented by each filesystem supporting
casefolding, so this reduces code duplication in filesystem-specific
code.
[eugen.hristev@collabora.com: rework to first test the exact match, cleanup
and add error message]
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Link: https://lore.kernel.org/r/20240606073353.47130-4-eugen.hristev@collabora.com
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 0283cf366c2a..2b1eeca426a0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3351,6 +3351,10 @@ extern int generic_file_fsync(struct file *, loff_t, loff_t, int); extern int generic_check_addressable(unsigned, u64); extern void generic_set_sb_d_ops(struct super_block *sb); +extern 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); static inline bool sb_has_encoding(const struct super_block *sb) { |