summaryrefslogtreecommitdiff
path: root/fs/ntfs3/upcase.c
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-09-23 12:42:18 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-09-30 17:39:47 +0300
commita3a956c78efaa202b1d75190136671cf6e87bfbe (patch)
tree25c4675e1c2f118d3bfa89a3495ecf9335594895 /fs/ntfs3/upcase.c
parentae6b47b5653e986e1dcaeb1ca7d13a04aeefdcfe (diff)
fs/ntfs3: Add option "nocase"
This commit adds mount option and additional functions. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/upcase.c')
-rw-r--r--fs/ntfs3/upcase.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ntfs3/upcase.c b/fs/ntfs3/upcase.c
index b5e8256fd710..7681eefacb4b 100644
--- a/fs/ntfs3/upcase.c
+++ b/fs/ntfs3/upcase.c
@@ -102,3 +102,15 @@ case_insentive:
diff2 = l1 - l2;
return diff2 ? diff2 : diff1;
}
+
+/* Helper function for ntfs_d_hash. */
+unsigned long ntfs_names_hash(const u16 *name, size_t len, const u16 *upcase,
+ unsigned long hash)
+{
+ while (len--) {
+ unsigned int c = upcase_unicode_char(upcase, *name++);
+ hash = partial_name_hash(c, hash);
+ }
+
+ return hash;
+}