Skip to content

dedupe smb unicode files

[email protected] linux-cifs lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 1 replyIn review
  2. v44 patches 0 repliesSuperseded
  3. v24 patches 16 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches14 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4fs/smb: Remove unicode 'lower' tablesfs/smb/client/cifs_unicode.h fs/smb/client/cifs_uniupr.h fs/smb/server/unicode.h +1 more+0 -3430 replies
2/4fs/smb: Swing unicode common code from smb->NLSfs/nls/Kconfig fs/nls/Makefile fs/nls/nls_ucs2_utils.c +4 more+328 -2840 replies
3/4fs/smb/client: Use common code in clientfs/smb/client/Kconfig fs/smb/client/cifs_unicode.c fs/smb/client/cifs_unicode.h +2 more+4 -4050 replies
4/4fs/jfs: Use common ucs2 upper case tablefs/jfs/Kconfig fs/jfs/Makefile fs/jfs/jfs_unicode.h +3 more+23 -1470 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/4] dedupe smb unicode files

From: "Dr. David Alan Gilbert" <[email protected]>

The smb client and server code have (mostly) duplicated code for unicode manipulation, in particular upper case handling.

Flatten this lot into shared code.

There's some code that's slightly different between the two, and I've not attempted to share that - this should be strictly a no behaviour change set.

In addition, the same tables and code are shared in jfs, however there's very little testing available for the unicode in there, so just share the raw data tables.

I suspect there's more UCS-2 code that can be shared, in the NLS code and in the UCS-2 code used by the EFI interfaces.

Lightly tested with a module and a monolithic build, and just mounting itself.

This dupe was found using PMD:
https://pmd.github.io/pmd/pmd_userdocs_cpd.html

Dave

Version 5
Add some (wchar_t *) casts to keep sparse
happy, as spotted by kernel test robot

Dr. David Alan Gilbert (4):
fs/smb: Remove unicode 'lower' tables
fs/smb: Swing unicode common code from smb->NLS
fs/smb/client: Use common code in client
fs/jfs: Use common ucs2 upper case table

 fs/jfs/Kconfig                                |   1 +
 fs/jfs/Makefile                               |   2 +-
 fs/jfs/jfs_unicode.h                          |  17 +-
 fs/jfs/jfs_uniupr.c                           | 121 -------
 fs/nls/Kconfig                                |   8 +
 fs/nls/Makefile                               |   1 +
 fs/nls/nls_ucs2_data.h                        |  15 +
 .../server/uniupr.h => nls/nls_ucs2_utils.c}  | 156 +--------
 fs/nls/nls_ucs2_utils.h                       | 285 +++++++++++++++
 fs/smb/client/Kconfig                         |   1 +
 fs/smb/client/cifs_unicode.c                  |   1 -
 fs/smb/client/cifs_unicode.h                  | 330 +-----------------
 fs/smb/client/cifs_uniupr.h                   | 239 -------------
 fs/smb/client/smb2pdu.c                       |   4 +-
 fs/smb/server/Kconfig                         |   1 +
 fs/smb/server/unicode.c                       |   1 -
 fs/smb/server/unicode.h                       | 325 +----------------
 17 files changed, 342 insertions(+), 1166 deletions(-)
 delete mode 100644 fs/jfs/jfs_uniupr.c
 create mode 100644 fs/nls/nls_ucs2_data.h
 rename fs/{smb/server/uniupr.h => nls/nls_ucs2_utils.c} (50%)
 create mode 100644 fs/nls/nls_ucs2_utils.h
 delete mode 100644 fs/smb/client/cifs_uniupr.h
Signature · 1 line
2.41.0