2020-03-17 22:29:10

by Pali Rohár

[permalink] [raw]
Subject: [PATCH 0/4] Fixes for exfat driver

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


2020-03-17 22:29:22

by Pali Rohár

[permalink] [raw]
Subject: [PATCH 3/4] exfat: Remove unused functions exfat_high_surrogate() and exfat_low_surrogate()

After applying previous two patches, these functions are not used anymore.

Signed-off-by: Pali Rohár <[email protected]>
---
fs/exfat/exfat_fs.h | 2 --
fs/exfat/nls.c | 13 -------------
2 files changed, 15 deletions(-)

diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
index 67d4e46fb810..8a176a803206 100644
--- a/fs/exfat/exfat_fs.h
+++ b/fs/exfat/exfat_fs.h
@@ -492,8 +492,6 @@ int exfat_nls_to_utf16(struct super_block *sb,
struct exfat_uni_name *uniname, int *p_lossy);
int exfat_create_upcase_table(struct super_block *sb);
void exfat_free_upcase_table(struct exfat_sb_info *sbi);
-unsigned short exfat_high_surrogate(unicode_t u);
-unsigned short exfat_low_surrogate(unicode_t u);

/* exfat/misc.c */
void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c
index 6d1c3ae130ff..e3a9f5e08f68 100644
--- a/fs/exfat/nls.c
+++ b/fs/exfat/nls.c
@@ -537,22 +537,9 @@ static int exfat_utf8_to_utf16(struct super_block *sb,
return unilen;
}

-#define PLANE_SIZE 0x00010000
#define SURROGATE_MASK 0xfffff800
#define SURROGATE_PAIR 0x0000d800
#define SURROGATE_LOW 0x00000400
-#define SURROGATE_BITS 0x000003ff
-
-unsigned short exfat_high_surrogate(unicode_t u)
-{
- return ((u - PLANE_SIZE) >> 10) + SURROGATE_PAIR;
-}
-
-unsigned short exfat_low_surrogate(unicode_t u)
-{
- return ((u - PLANE_SIZE) & SURROGATE_BITS) | SURROGATE_PAIR |
- SURROGATE_LOW;
-}

static int __exfat_utf16_to_nls(struct super_block *sb,
struct exfat_uni_name *p_uniname, unsigned char *p_cstring,
--
2.20.1

2020-03-17 23:22:02

by Namjae Jeon

[permalink] [raw]
Subject: RE: [PATCH 0/4] Fixes for exfat driver

> 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.
Looks good to me.
Acked-by: Namjae Jeon <[email protected]>

Hi Al,

Could you please push these patches into your #for-next ?
Thanks!

>
> Patches are also in my exfat branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/pali/linux.git/log/?h=exfa
> t
>
> 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



2020-04-15 22:23:55

by Pali Rohár

[permalink] [raw]
Subject: Re: [PATCH 0/4] Fixes for exfat driver

On Wednesday 18 March 2020 08:20:04 Namjae Jeon wrote:
> > 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.
> Looks good to me.
> Acked-by: Namjae Jeon <[email protected]>
>
> Hi Al,
>
> Could you please push these patches into your #for-next ?
> Thanks!

Al, could you please take this patch series? Based on feedback current
hashing code is good enough. And we do not want to have broken discard
support in upcoming Linux kernel version.

> >
> > Patches are also in my exfat branch:
> > https://git.kernel.org/pub/scm/linux/kernel/git/pali/linux.git/log/?h=exfa
> > t
> >
> > 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
>
>
>

2020-04-16 01:14:40

by Namjae Jeon

[permalink] [raw]
Subject: RE: [PATCH 0/4] Fixes for exfat driver

> On Wednesday 18 March 2020 08:20:04 Namjae Jeon wrote:
> > > 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.
> > Looks good to me.
> > Acked-by: Namjae Jeon <[email protected]>
> >
> > Hi Al,
> >
> > Could you please push these patches into your #for-next ?
> > Thanks!
>
> Al, could you please take this patch series? Based on feedback current
> hashing code is good enough. And we do not want to have broken discard
> support in upcoming Linux kernel version.
Hi Pali,

I will push them to exfat git tree.

Thanks for your work!
>
> > >
> > > Patches are also in my exfat branch:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/pali/linux.git/log/?
> > > h=exfa
> > > t
> > >
> > > 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
> >
> >
> >