|
Kmods SIG |
50e2b3 |
From dddf7da3985ee144b46ee287e81e47b9ee8bb980 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
50e2b3 |
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
|
|
Kmods SIG |
50e2b3 |
Date: Tue, 17 Mar 2020 23:25:52 +0100
|
|
Kmods SIG |
50e2b3 |
Subject: [Backport dddf7da3985e] exfat: Simplify exfat_utf8_d_hash() for code
|
|
Kmods SIG |
50e2b3 |
points above U+FFFF
|
|
Kmods SIG |
50e2b3 |
MIME-Version: 1.0
|
|
Kmods SIG |
50e2b3 |
Content-Type: text/plain; charset=UTF-8
|
|
Kmods SIG |
50e2b3 |
Content-Transfer-Encoding: 8bit
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Function partial_name_hash() takes long type value into which can be stored
|
|
Kmods SIG |
50e2b3 |
one Unicode code point. Therefore conversion from UTF-32 to UTF-16 is not
|
|
Kmods SIG |
50e2b3 |
needed.
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Pali Rohár <pali@kernel.org>
|
|
Kmods SIG |
50e2b3 |
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
|
|
Kmods SIG |
50e2b3 |
---
|
|
Kmods SIG |
50e2b3 |
src/namei.c | 10 ++--------
|
|
Kmods SIG |
50e2b3 |
1 file changed, 2 insertions(+), 8 deletions(-)
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
diff --git a/src/namei.c b/src/namei.c
|
|
Kmods SIG |
50e2b3 |
index 585b47b2db3da5d208fa1d53da9b18ae3d07c2dd..fa926b9c883adf353f3e911d96d6efcd71677dcc 100644
|
|
Kmods SIG |
50e2b3 |
--- a/src/namei.c
|
|
Kmods SIG |
50e2b3 |
+++ b/src/namei.c
|
|
Kmods SIG |
50e2b3 |
@@ -147,16 +147,10 @@ static int exfat_utf8_d_hash(const struct dentry *dentry, struct qstr *qstr)
|
|
Kmods SIG |
50e2b3 |
return charlen;
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
/*
|
|
Kmods SIG |
50e2b3 |
- * Convert to UTF-16: code points above U+FFFF are encoded as
|
|
Kmods SIG |
50e2b3 |
- * surrogate pairs.
|
|
Kmods SIG |
50e2b3 |
* exfat_toupper() works only for code points up to the U+FFFF.
|
|
Kmods SIG |
50e2b3 |
*/
|
|
Kmods SIG |
50e2b3 |
- if (u > 0xFFFF) {
|
|
Kmods SIG |
50e2b3 |
- hash = partial_name_hash(exfat_high_surrogate(u), hash);
|
|
Kmods SIG |
50e2b3 |
- hash = partial_name_hash(exfat_low_surrogate(u), hash);
|
|
Kmods SIG |
50e2b3 |
- } else {
|
|
Kmods SIG |
50e2b3 |
- hash = partial_name_hash(exfat_toupper(sb, u), hash);
|
|
Kmods SIG |
50e2b3 |
- }
|
|
Kmods SIG |
50e2b3 |
+ hash = partial_name_hash(u <= 0xFFFF ? exfat_toupper(sb, u) : u,
|
|
Kmods SIG |
50e2b3 |
+ hash);
|
|
Kmods SIG |
50e2b3 |
}
|
|
Kmods SIG |
50e2b3 |
|
|
Kmods SIG |
50e2b3 |
qstr->hash = end_name_hash(hash);
|
|
Kmods SIG |
50e2b3 |
--
|
|
Kmods SIG |
50e2b3 |
2.31.1
|
|
Kmods SIG |
50e2b3 |
|