]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
ext2fs: drop ASCII NLS support
authorGabriel Krisman Bertazi <krisman@collabora.com>
Sun, 28 Apr 2019 20:52:12 +0000 (16:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 28 Apr 2019 20:52:12 +0000 (16:52 -0400)
As agreed on the kernel side, ext4 will only support utf8 for now, and
not plain ASCII, so we don't need this anymore.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/e2p/encoding.c
lib/ext2fs/Makefile.in
lib/ext2fs/ext2_fs.h
lib/ext2fs/nls.h
lib/ext2fs/nls_ascii.c [deleted file]

index 569d28941e7b4f98d33459969f3ae09e709a3ab4..69fa6e4c7d2641e3e86894cf6ac3440e83ccaf78 100644 (file)
@@ -28,11 +28,6 @@ static const struct {
        __u16 default_flags;
 
 } ext4_encoding_map[] = {
-       {
-               .encoding_magic = EXT4_ENC_ASCII,
-               .name = "ascii",
-               .default_flags = 0
-       },
        {
                .encoding_magic = EXT4_ENC_UTF8_12_1,
                .name = "utf8",
index 06c2394b34b8eec56618a899ece445d3ab57a3d9..4b3fc1881cffac54ef018a76d4f64418481b05cc 100644 (file)
@@ -20,8 +20,8 @@ COMPILE_ET=   _ET_DIR_OVERRIDE=$(srcdir)/../et ../et/compile_et
 @TEST_IO_CMT@TEST_IO_LIB_OBJS = test_io.o
 @IMAGER_CMT@E2IMAGE_LIB_OBJS = imager.o
 
-NLS_OBJS=nls_ascii.o nls_utf8-norm.o nls_utf8.o
-NLS_SRCS=$(srcdir)/nls_ascii.c $(srcdir)/nls_utf8-norm.c $(srcdir)/nls_utf8.c
+NLS_OBJS=nls_utf8-norm.o nls_utf8.o
+NLS_SRCS=$(srcdir)/nls_utf8-norm.c $(srcdir)/nls_utf8.c
 
 DEBUG_OBJS= debug_cmds.o extent_cmds.o tst_cmds.o debugfs.o util.o \
        ncheck.o icheck.o ls.o lsdel.o dump.o set_fields.o logdump.o \
@@ -1328,7 +1328,6 @@ do_journal.o: $(top_srcdir)/debugfs/do_journal.c $(top_builddir)/lib/config.h \
  $(top_srcdir)/lib/support/quotaio_tree.h $(srcdir)/kernel-jbd.h \
  $(srcdir)/jfs_compat.h $(srcdir)/kernel-list.h \
  $(top_srcdir)/debugfs/journal.h $(srcdir)/../../e2fsck/jfs_user.h
-nls_ascii.o: $(srcdir)/nls_ascii.c $(srcdir)/nls.h $(srcdir)/ext2_fs.h
 nls_utf8-norm.o: $(srcdir)/nls_utf8-norm.c $(srcdir)/utf8n.h \
  $(srcdir)/utf8data.h
 nls_utf8.o: $(srcdir)/nls_utf8.c $(srcdir)/nls.h $(srcdir)/ext2_fs.h \
index 97189d8688b41badb849074425b28dcf006ef1a3..ffcacafe8296a11154c2fba5d8ad829772407142 100644 (file)
@@ -1128,7 +1128,6 @@ struct mmp_struct {
  */
 #define EXT4_INLINE_DATA_DOTDOT_SIZE   (4)
 
-#define EXT4_ENC_ASCII         0
 #define EXT4_ENC_UTF8_12_1     1
 
 #define EXT4_ENC_STRICT_MODE_FL                        (1 << 0) /* Reject invalid sequences */
index ce92f8154b38aca103a749db1faa828fc1e5504b..1d55ee404d5c9072f1b92edde0f84adeb6b863ea 100644 (file)
@@ -43,14 +43,12 @@ struct nls_table {
        const struct nls_ops *ops;
 };
 
-extern const struct nls_table nls_ascii;
 extern const struct nls_table nls_utf8_12_1;
 
 static const struct {
        int encoding_magic;
        const struct nls_table *tbl;
 } nls_map[] = {
-       { EXT4_ENC_ASCII, &nls_ascii },
        { EXT4_ENC_UTF8_12_1, &nls_utf8_12_1 },
 };
 
diff --git a/lib/ext2fs/nls_ascii.c b/lib/ext2fs/nls_ascii.c
deleted file mode 100644 (file)
index cc03fea..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "nls.h"
-
-#include <errno.h>
-#include <string.h>
-
-
-static unsigned char charset_tolower(const struct nls_table *table,
-                                    unsigned int c)
-{
-       if (c >= 'A' && c <= 'Z')
-               return (c | 0x20);
-       return c;
-}
-
-static unsigned char charset_toupper(const struct nls_table *table,
-                                    unsigned int c)
-{
-       if (c >= 'a' && c <= 'z')
-               return (c & ~0x20);
-       return c;
-}
-
-static int ascii_casefold(const struct nls_table *table,
-                         const unsigned char *str, size_t len,
-                         unsigned char *dest, size_t dlen)
-{
-       int i;
-
-       if (dlen < len)
-               return -ENAMETOOLONG;
-
-       for (i = 0; i < len; i++) {
-               if (str[i] & 0x80)
-                       return -EINVAL;
-
-               dest[i] = charset_toupper(table, str[i]);
-       }
-
-       return len;
-}
-
-const static struct nls_ops ascii_ops = {
-       .casefold = ascii_casefold,
-};
-
-const struct nls_table nls_ascii = {
-       .ops = &ascii_ops,
-};