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
The following mount options are supported:
iocharset=name Character set to use for converting from Unicode to
ASCII. The default is compiled into the kernel as
CONFIG_NLS_DEFAULT. Use iocharset=utf8 for UTF8
translations. This requires CONFIG_NLS_UTF8 to be set
in the kernel .config file.
ASCII. The default is to do no conversion. Use
iocharset=utf8 for UTF8 translations. This requires
CONFIG_NLS_UTF8 to be set in the kernel .config file.
resize=value Resize the volume to <value> blocks. JFS only supports
growing a volume, not shrinking it. This option is only
......@@ -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=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.
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
* 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 */
int i;
int outlen = 0;
for (i = 0; (i < len) && from[i]; i++) {
int charlen;
charlen =
codepage->uni2char(le16_to_cpu(from[i]), &to[outlen],
NLS_MAX_CHARSET_SIZE);
if (charlen > 0) {
outlen += charlen;
} else {
to[outlen++] = '?';
if (codepage) {
for (i = 0; (i < len) && from[i]; i++) {
int charlen;
charlen =
codepage->uni2char(le16_to_cpu(from[i]),
&to[outlen],
NLS_MAX_CHARSET_SIZE);
if (charlen > 0)
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;
return outlen;
......@@ -62,14 +68,22 @@ int jfs_strtoUCS(wchar_t * to,
int charlen;
int i;
for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
charlen = codepage->char2uni(from, len, &to[i]);
if (charlen < 1) {
jfs_err("jfs_strtoUCS: char2uni returned %d.", charlen);
jfs_err("charset = %s, char = 0x%x",
codepage->charset, (unsigned char) *from);
return charlen;
if (codepage) {
for (i = 0; len && *from; i++, from += charlen, len -= charlen)
{
charlen = codepage->char2uni(from, len, &to[i]);
if (charlen < 1) {
jfs_err("jfs_strtoUCS: char2uni returned %d.",
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;
......
......@@ -195,7 +195,8 @@ static void jfs_put_super(struct super_block *sb)
rc = jfs_umount(sb);
if (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;
kfree(sbi);
......@@ -435,9 +436,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
if (!sb->s_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. */
sb->s_maxbytes = ((u64) sb->s_blocksize) << 40;
#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