22 #include <linux/slab.h>
40 static const u8 legal_ansi_char_array[0x40] = {
41 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
42 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
44 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
45 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
47 0x17, 0x07, 0x18, 0x17, 0x17, 0x17, 0x17, 0x17,
48 0x17, 0x17, 0x18, 0x16, 0x16, 0x17, 0x07, 0x00,
50 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
51 0x17, 0x17, 0x04, 0x16, 0x18, 0x16, 0x18, 0x18,
106 if (name1_len > name2_len)
108 for (cnt = 0; cnt < min_len; ++
cnt) {
117 if (c1 < 64 && legal_ansi_char_array[c1] & 8)
124 if (name1_len < name2_len)
126 if (name1_len == name2_len)
130 if (c1 < 64 && legal_ansi_char_array[c1] & 8)
154 for (i = 0; i <
n; ++
i) {
191 for (i = 0; i <
n; ++
i) {
207 const u32 upcase_len)
221 file_name_attr->file_name_length, upcase, upcase_len);
225 FILE_NAME_ATTR *file_name_attr2,
230 file_name_attr1->file_name_length,
231 (
ntfschar*)&file_name_attr2->file_name,
232 file_name_attr2->file_name_length,
233 err_val, ic, upcase, upcase_len);
271 for (i = o = 0; i < ins_len; i += wc_len) {
272 wc_len = nls->
char2uni(ins + i, ins_len - i,
289 ntfs_error(vol->
sb,
"Failed to allocate buffer for converted "
290 "name from ntfs_name_cache.");
298 ntfs_error(vol->
sb,
"Name using character set %s contains "
299 "characters that cannot be converted to "
303 ntfs_error(vol->
sb,
"Name is too long (maximum length for a "
304 "name on NTFS is %d Unicode characters.",
337 const int ins_len,
unsigned char **outs,
int outs_len)
341 int i, o, ns_len,
wc;
357 for (i = o = 0; i < ins_len; i++) {
372 ns_len = ((ns_len + 64) & ~63) - 1;
387 ntfs_error(vol->
sb,
"Unicode name contains characters that cannot be "
388 "converted to character set %s. You might want to "
389 "try to use the mount option nls=utf8.", nls->
charset);