Merge tag 'iwlwifi-for-john-2014-10-23' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / fs / cifs / smb2misc.c
index 4aa7a0f07d6eace61da47500bb6e83a5bd39e294..1a08a34838fc9772e2a62ff5dd69b9431d38f453 100644 (file)
@@ -379,6 +379,14 @@ cifs_convert_path_to_utf16(const char *from, struct cifs_sb_info *cifs_sb)
        int len;
        const char *start_of_path;
        __le16 *to;
+       int map_type;
+
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SFM_CHR)
+               map_type = SFM_MAP_UNI_RSVD;
+       else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR)
+               map_type = SFU_MAP_UNI_RSVD;
+       else
+               map_type = NO_MAP_UNI_RSVD;
 
        /* Windows doesn't allow paths beginning with \ */
        if (from[0] == '\\')
@@ -386,9 +394,7 @@ cifs_convert_path_to_utf16(const char *from, struct cifs_sb_info *cifs_sb)
        else
                start_of_path = from;
        to = cifs_strndup_to_utf16(start_of_path, PATH_MAX, &len,
-                                  cifs_sb->local_nls,
-                                  cifs_sb->mnt_cifs_flags &
-                                       CIFS_MOUNT_MAP_SPECIAL_CHR);
+                                  cifs_sb->local_nls, map_type);
        return to;
 }