From f3a9b3758e0b6d40183929aba599a7da52313a3e Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Thu, 17 Aug 2023 01:22:32 +0100 Subject: fs/jfs: Use common ucs2 upper case table Use the UCS-2 upper case tables from nls, that are shared with smb. This code in JFS is hard to test, so we're only reusing the same tables (which are identical), not trying to reuse the rest of the helper functions. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Dave Kleikamp Signed-off-by: Steve French --- fs/nls/nls_ucs2_data.h | 15 +++++++++++++++ fs/nls/nls_ucs2_utils.h | 14 +------------- 2 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 fs/nls/nls_ucs2_data.h (limited to 'fs/nls') diff --git a/fs/nls/nls_ucs2_data.h b/fs/nls/nls_ucs2_data.h new file mode 100644 index 000000000000..1f454dc0f4e0 --- /dev/null +++ b/fs/nls/nls_ucs2_data.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _NLS_UCS2_DATA_H +#define _NLS_UCS2_DATA_H + +struct UniCaseRange { + wchar_t start; + wchar_t end; + signed char *table; +}; + +extern signed char NlsUniUpperTable[512]; +extern const struct UniCaseRange NlsUniUpperRange[]; + +#endif /* _NLS_UCS2_DATA_H */ diff --git a/fs/nls/nls_ucs2_utils.h b/fs/nls/nls_ucs2_utils.h index 3500596ea993..ef18d30db1d0 100644 --- a/fs/nls/nls_ucs2_utils.h +++ b/fs/nls/nls_ucs2_utils.h @@ -26,6 +26,7 @@ #include #include #include +#include "nls_ucs2_data.h" /* * Windows maps these to the user defined 16 bit Unicode range since they are @@ -40,19 +41,6 @@ #define UNI_PIPE ((__u16)('|' + 0xF000)) #define UNI_SLASH ((__u16)('\\' + 0xF000)) -#ifndef UNICASERANGE_DEFINED -struct UniCaseRange { - wchar_t start; - wchar_t end; - signed char *table; -}; -#endif /* UNICASERANGE_DEFINED */ - -#ifndef UNIUPR_NOUPPER -extern signed char NlsUniUpperTable[512]; -extern const struct UniCaseRange NlsUniUpperRange[]; -#endif /* UNIUPR_NOUPPER */ - /* * UniStrcat: Concatenate the second string to the first * -- cgit v1.2.3