X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fjfs%2Fjfs_unicode.c;h=c7de6f5bbefc1da43b269ffe54ddec707ba7b0a1;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=b32208aad5508ee86afa10a3319f8af58fad2582;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/fs/jfs/jfs_unicode.c b/fs/jfs/jfs_unicode.c index b32208aad..c7de6f5bb 100644 --- a/fs/jfs/jfs_unicode.c +++ b/fs/jfs/jfs_unicode.c @@ -3,16 +3,16 @@ * * 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 - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -51,17 +51,18 @@ int jfs_strfromUCS_le(char *to, const __le16 * from, } } else { for (i = 0; (i < len) && from[i]; i++) { - if (le16_to_cpu(from[i]) & 0xff00) { - if (warn) { + if (unlikely(le16_to_cpu(from[i]) & 0xff00)) { + to[i] = '?'; + if (unlikely(warn)) { warn--; warn_again--; printk(KERN_ERR - "non-latin1 character 0x%x found in JFS file name\n", - le16_to_cpu(from[i])); + "non-latin1 character 0x%x found in JFS file name\n", + le16_to_cpu(from[i])); printk(KERN_ERR "mount with iocharset=utf8 to access\n"); } - to[i] = '?'; + } else to[i] = (char) (le16_to_cpu(from[i])); @@ -123,7 +124,7 @@ int get_UCSname(struct component_name * uniName, struct dentry *dentry) kmalloc((length + 1) * sizeof(wchar_t), GFP_NOFS); if (uniName->name == NULL) - return -ENOSPC; + return -ENOMEM; uniName->namlen = jfs_strtoUCS(uniName->name, dentry->d_name.name, length, nls_tab);