All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF
@ 2020-04-03  2:18 Kohada.Tetsuhiro
  2020-04-03 20:40 ` Pali Rohár
  0 siblings, 1 reply; 15+ messages in thread
From: Kohada.Tetsuhiro @ 2020-04-03  2:18 UTC (permalink / raw)
  To: 'pali@kernel.org'
  Cc: 'linux-fsdevel@vger.kernel.org',
	'linux-kernel@vger.kernel.org',
	'namjae.jeon@samsung.com',
	'sj1557.seo@samsung.com',
	'viro@zeniv.linux.org.uk'


> I guess it was designed for 8bit types, not for long (64bit types) and
> I'm not sure how effective it is even for 16bit types for which it is
> already used.

In partial_name_hash (), when 8bit value or 16bit value is specified, 
upper 8-12bits tend to be 0.

> So question is, what should we do for either 21bit number (one Unicode
> code point = equivalent of UTF-32) or for sequence of 16bit numbers
> (UTF-16)?

If you want to get an unbiased hash value by specifying an 8 or 16-bit value,
the hash32() function is a good choice.
ex1: Prepare by hash32 () function.
   hash = partial_name_hash (hash32 (val16,32), hash);
ex2: Use the hash32() function directly.
   hash + = hash32 (val16,32);

> partial_name_hash(unsigned long c, unsigned long prevhash)
> {
>	return (prevhash + (c << 4) + (c >> 4)) * 11;
> }

Another way may replace partial_name_hash().

	return prevhash + hash32(c,32)


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 0/4] Fixes for exfat driver
@ 2020-03-17 22:25 Pali Rohár
  2020-03-17 22:25 ` [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF Pali Rohár
  0 siblings, 1 reply; 15+ messages in thread
From: Pali Rohár @ 2020-03-17 22:25 UTC (permalink / raw)
  To: Namjae Jeon, Sungjong Seo, Alexander Viro; +Cc: linux-fsdevel, linux-kernel

This patch series contains small fixes for exfat driver. It removes
conversion from UTF-16 to UTF-16 at two places where it is not needed
and fixes discard support.

Patches are also in my exfat branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pali/linux.git/log/?h=exfat

Pali Rohár (4):
  exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF
  exfat: Simplify exfat_utf8_d_cmp() for code points above U+FFFF
  exfat: Remove unused functions exfat_high_surrogate() and
    exfat_low_surrogate()
  exfat: Fix discard support

 fs/exfat/exfat_fs.h |  2 --
 fs/exfat/namei.c    | 19 ++++---------------
 fs/exfat/nls.c      | 13 -------------
 fs/exfat/super.c    |  5 +++--
 4 files changed, 7 insertions(+), 32 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-04-15  7:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03  2:18 [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF Kohada.Tetsuhiro
2020-04-03 20:40 ` Pali Rohár
2020-04-06  9:37   ` Kohada.Tetsuhiro
2020-04-07 10:06     ` Pali Rohár
2020-04-08  3:59       ` Kohada.Tetsuhiro
2020-04-08  9:04         ` Pali Rohár
2020-04-13  8:13           ` Kohada.Tetsuhiro
2020-04-13 10:10             ` Pali Rohár
2020-04-14  9:29               ` Kohada.Tetsuhiro
2020-04-14  9:47                 ` Pali Rohár
2020-04-15  7:46                   ` Kohada.Tetsuhiro
  -- strict thread matches above, loose matches on Subject: below --
2020-03-17 22:25 [PATCH 0/4] Fixes for exfat driver Pali Rohár
2020-03-17 22:25 ` [PATCH 1/4] exfat: Simplify exfat_utf8_d_hash() for code points above U+FFFF Pali Rohár
2020-03-18  0:09   ` Al Viro
2020-03-18  9:32     ` Pali Rohár
2020-03-28 23:40       ` Pali Rohár

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.