Commit 20b02dda authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: Don't do filename translation by default

Due to its roots in OS/2, JFS has always tried to convert pathnames
into unicode.  Unfortunately, it never had a reliable idea of what
the incoming character set was, so it defaulted to CONFIG_NLS_DEFAULT.

This behavior was confusing and many users have requested that JFS
have a more sane behavior.   This patch changes the default behavior
to store the incoming bytes directly without translation.  This is
consistent with the behavior when the default value of
CONFIG_NLS_DEFAULT (iso8859-1) was defined.  The default behavior
can be overridden by using the iocharset mount option.
parent 04a9f0d7
...@@ -12,10 +12,9 @@ Barry Arndt barndt@us.ibm.com ...@@ -12,10 +12,9 @@ Barry Arndt barndt@us.ibm.com
The following mount options are supported: The following mount options are supported:
iocharset=name Character set to use for converting from Unicode to iocharset=name Character set to use for converting from Unicode to
ASCII. The default is compiled into the kernel as ASCII. The default is to do no conversion. Use
CONFIG_NLS_DEFAULT. Use iocharset=utf8 for UTF8 iocharset=utf8 for UTF8 translations. This requires
translations. This requires CONFIG_NLS_UTF8 to be set CONFIG_NLS_UTF8 to be set in the kernel .config file.
in the kernel .config file.
resize=value Resize the volume to <value> blocks. JFS only supports resize=value Resize the volume to <value> blocks. JFS only supports
growing a volume, not shrinking it. This option is only growing a volume, not shrinking it. This option is only
...@@ -36,18 +35,6 @@ errors=continue Keep going on a filesystem error. ...@@ -36,18 +35,6 @@ errors=continue Keep going on a filesystem error.
errors=remount-ro Default. Remount the filesystem read-only on an error. errors=remount-ro Default. Remount the filesystem read-only on an error.
errors=panic Panic and halt the machine if an error occurs. errors=panic Panic and halt the machine if an error occurs.
JFS TODO list:
Plans for our near term development items
- enhance support for logfile on dedicated partition
Longer term work items
- implement defrag utility, for online defragmenting
- add quota support
- add support for block sizes (512,1024,2048)
Please send bugs, comments, cards and letters to shaggy@austin.ibm.com. Please send bugs, comments, cards and letters to shaggy@austin.ibm.com.
The JFS mailing list can be subscribed to by using the link labeled The JFS mailing list can be subscribed to by using the link labeled
......
/* /*
* Copyright (c) International Business Machines Corp., 2000-2002 * Copyright (C) International Business Machines Corp., 2000-2004
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -35,16 +35,22 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */ ...@@ -35,16 +35,22 @@ int jfs_strfromUCS_le(char *to, const wchar_t * from, /* LITTLE ENDIAN */
int i; int i;
int outlen = 0; int outlen = 0;
for (i = 0; (i < len) && from[i]; i++) { if (codepage) {
int charlen; for (i = 0; (i < len) && from[i]; i++) {
charlen = int charlen;
codepage->uni2char(le16_to_cpu(from[i]), &to[outlen], charlen =
NLS_MAX_CHARSET_SIZE); codepage->uni2char(le16_to_cpu(from[i]),
if (charlen > 0) { &to[outlen],
outlen += charlen; NLS_MAX_CHARSET_SIZE);
} else { if (charlen > 0)
to[outlen++] = '?'; outlen += charlen;
else
to[outlen++] = '?';
} }
} else {
for (i = 0; (i < len) && from[i]; i++)
to[i] = (char) (le16_to_cpu(from[i]));
outlen = i;
} }
to[outlen] = 0; to[outlen] = 0;
return outlen; return outlen;
...@@ -62,14 +68,22 @@ int jfs_strtoUCS(wchar_t * to, ...@@ -62,14 +68,22 @@ int jfs_strtoUCS(wchar_t * to,
int charlen; int charlen;
int i; int i;
for (i = 0; len && *from; i++, from += charlen, len -= charlen) { if (codepage) {
charlen = codepage->char2uni(from, len, &to[i]); for (i = 0; len && *from; i++, from += charlen, len -= charlen)
if (charlen < 1) { {
jfs_err("jfs_strtoUCS: char2uni returned %d.", charlen); charlen = codepage->char2uni(from, len, &to[i]);
jfs_err("charset = %s, char = 0x%x", if (charlen < 1) {
codepage->charset, (unsigned char) *from); jfs_err("jfs_strtoUCS: char2uni returned %d.",
return charlen; charlen);
jfs_err("charset = %s, char = 0x%x",
codepage->charset,
(unsigned char) *from);
return charlen;
}
} }
} else {
for (i = 0; (i < len) && from[i]; i++)
to[i] = (wchar_t) from[i];
} }
to[i] = 0; to[i] = 0;
......
...@@ -195,7 +195,8 @@ static void jfs_put_super(struct super_block *sb) ...@@ -195,7 +195,8 @@ static void jfs_put_super(struct super_block *sb)
rc = jfs_umount(sb); rc = jfs_umount(sb);
if (rc) if (rc)
jfs_err("jfs_umount failed with return code %d", rc); jfs_err("jfs_umount failed with return code %d", rc);
unload_nls(sbi->nls_tab); if (sbi->nls_tab)
unload_nls(sbi->nls_tab);
sbi->nls_tab = NULL; sbi->nls_tab = NULL;
kfree(sbi); kfree(sbi);
...@@ -435,9 +436,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -435,9 +436,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
if (!sb->s_root) if (!sb->s_root)
goto out_no_root; goto out_no_root;
if (!sbi->nls_tab)
sbi->nls_tab = load_nls_default();
/* logical blocks are represented by 40 bits in pxd_t, etc. */ /* logical blocks are represented by 40 bits in pxd_t, etc. */
sb->s_maxbytes = ((u64) sb->s_blocksize) << 40; sb->s_maxbytes = ((u64) sb->s_blocksize) << 40;
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment