aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/unicode.h
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2020-07-08 02:12:34 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2020-09-10 14:03:31 -0700
commit3d7bfea8b8378277a25b42b28fe5a2a5ca76a7cf (patch)
tree70947df66e566caf2bd0bc776c4ca85417fc7747 /include/linux/unicode.h
parentf2fs: compress: use more readable atomic_t type for {cic,dic}.ref (diff)
downloadlinux-dev-3d7bfea8b8378277a25b42b28fe5a2a5ca76a7cf.tar.xz
linux-dev-3d7bfea8b8378277a25b42b28fe5a2a5ca76a7cf.zip
unicode: Add utf8_casefold_hash
This adds a case insensitive hash function to allow taking the hash without needing to allocate a casefolded copy of the string. The existing d_hash implementations for casefolding allocate memory within rcu-walk, by avoiding it we can be more efficient and avoid worrying about a failed allocation. Signed-off-by: Daniel Rosenberg <drosen@google.com> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/linux/unicode.h')
-rw-r--r--include/linux/unicode.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/unicode.h b/include/linux/unicode.h
index 990aa97d8049..74484d44c755 100644
--- a/include/linux/unicode.h
+++ b/include/linux/unicode.h
@@ -27,6 +27,9 @@ int utf8_normalize(const struct unicode_map *um, const struct qstr *str,
int utf8_casefold(const struct unicode_map *um, const struct qstr *str,
unsigned char *dest, size_t dlen);
+int utf8_casefold_hash(const struct unicode_map *um, const void *salt,
+ struct qstr *str);
+
struct unicode_map *utf8_load(const char *version);
void utf8_unload(struct unicode_map *um);