linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / ntfs / unistr.c
index ec7405a..0ea887f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * unistr.c - NTFS Unicode string handling. Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov
+ * Copyright (c) 2001-2005 Anton Altaparmakov
  *
  * This program/include file is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as published
@@ -19,6 +19,8 @@
  * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include "types.h"
+#include "debug.h"
 #include "ntfs.h"
 
 /*
@@ -262,7 +264,7 @@ int ntfs_nlstoucs(const ntfs_volume *vol, const char *ins,
 
        /* We don't trust outside sources. */
        if (ins) {
-               ucs = (ntfschar*)kmem_cache_alloc(ntfs_name_cache, SLAB_NOFS);
+               ucs = kmem_cache_alloc(ntfs_name_cache, SLAB_NOFS);
                if (ucs) {
                        for (i = o = 0; i < ins_len; i += wc_len) {
                                wc_len = nls->char2uni(ins + i, ins_len - i,
@@ -370,7 +372,8 @@ retry:                      wc = nls->uni2char(le16_to_cpu(ins[i]), ns + o,
        return -EINVAL;
 conversion_err:
        ntfs_error(vol->sb, "Unicode name contains characters that cannot be "
-                       "converted to character set %s.", nls->charset);
+                       "converted to character set %s.  You might want to "
+                       "try to use the mount option nls=utf8.", nls->charset);
        if (ns != *outs)
                kfree(ns);
        if (wc != -ENAMETOOLONG)