mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF
Function partial_name_hash() takes long type value into which can be stored one Unicode code point. Therefore conversion from UTF-32 to UTF-16 is not needed. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
This commit is contained in:
@@ -147,16 +147,10 @@ static int exfat_utf8_d_hash(const struct dentry *dentry, struct qstr *qstr)
|
|||||||
return charlen;
|
return charlen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert to UTF-16: code points above U+FFFF are encoded as
|
|
||||||
* surrogate pairs.
|
|
||||||
* exfat_toupper() works only for code points up to the U+FFFF.
|
* exfat_toupper() works only for code points up to the U+FFFF.
|
||||||
*/
|
*/
|
||||||
if (u > 0xFFFF) {
|
hash = partial_name_hash(u <= 0xFFFF ? exfat_toupper(sb, u) : u,
|
||||||
hash = partial_name_hash(exfat_high_surrogate(u), hash);
|
hash);
|
||||||
hash = partial_name_hash(exfat_low_surrogate(u), hash);
|
|
||||||
} else {
|
|
||||||
hash = partial_name_hash(exfat_toupper(sb, u), hash);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qstr->hash = end_name_hash(hash);
|
qstr->hash = end_name_hash(hash);
|
||||||
|
Reference in New Issue
Block a user