lkml.org 
[lkml]   [2020]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v9 10/13] exfat: add nls operations
Date
> On Thursday 02 January 2020 16:20:33 Namjae Jeon wrote:
> > This adds the implementation of nls operations for exfat.
> >
> > Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> > Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
> > ---
> > fs/exfat/nls.c | 809
> > +++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 809 insertions(+)
> > create mode 100644 fs/exfat/nls.c
> >
> > diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c new file mode 100644
> > index 000000000000..af52328e28ff
> > --- /dev/null
> > +++ b/fs/exfat/nls.c
>
> ...
>
> > +int exfat_nls_uni16s_to_vfsname(struct super_block *sb,
> > + struct exfat_uni_name *uniname, unsigned char *p_cstring,
> > + int buflen)
> > +{
> > + if (EXFAT_SB(sb)->options.utf8)
> > + return __exfat_nls_utf16s_to_vfsname(sb, uniname, p_cstring,
> > + buflen);
> > + return __exfat_nls_uni16s_to_vfsname(sb, uniname, p_cstring,
> buflen);
> > +}
>
> Hello, I'm looking at this function and basically it do nothing.
> Or was it supposed that this function should do something more for UTF-8
> encoding?
>
> There is one if- statement, but in both branches is executed exactly
> same code.
>
> And executed function just pass same arguments as current callee
> function.
>
> So calls to exfat_nls_uni16s_to_vfsname() can be replaced by direct
> calls to __exfat_nls_uni16s_to_vfsname().
Ah, The function names are similar, but not same. see utf16s/uni16s.

Thanks!

>
> Or maybe better, rename __exfat_nls_uni16s_to_vfsname() function to
> exfat_nls_uni16s_to_vfsname().
>
> > +int exfat_nls_vfsname_to_uni16s(struct super_block *sb,
> > + const unsigned char *p_cstring, const int len,
> > + struct exfat_uni_name *uniname, int *p_lossy)
> > +{
> > + if (EXFAT_SB(sb)->options.utf8)
> > + return __exfat_nls_vfsname_to_utf16s(sb, p_cstring, len,
> > + uniname, p_lossy);
> > + return __exfat_nls_vfsname_to_uni16s(sb, p_cstring, len, uniname,
> > + p_lossy);
> > +}
>
> And same for this function.
>
> --
> Pali Rohár
> pali.rohar@gmail.com



\
 
 \ /
  Last update: 2020-01-03 08:07    [W:0.188 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site