diff options
Diffstat (limited to 'fs/cifs/misc.c')
| -rw-r--r-- | fs/cifs/misc.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 09bfcf08a90f..a09e077ba925 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
| @@ -637,77 +637,6 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length) | |||
| 637 | return; | 637 | return; |
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | /* Convert 16 bit Unicode pathname to wire format from string in current code | ||
| 641 | page. Conversion may involve remapping up the seven characters that are | ||
| 642 | only legal in POSIX-like OS (if they are present in the string). Path | ||
| 643 | names are little endian 16 bit Unicode on the wire */ | ||
| 644 | int | ||
| 645 | cifsConvertToUCS(__le16 *target, const char *source, int maxlen, | ||
| 646 | const struct nls_table *cp, int mapChars) | ||
| 647 | { | ||
| 648 | int i, j, charlen; | ||
| 649 | int len_remaining = maxlen; | ||
| 650 | char src_char; | ||
| 651 | __u16 temp; | ||
| 652 | |||
| 653 | if (!mapChars) | ||
| 654 | return cifs_strtoUCS(target, source, PATH_MAX, cp); | ||
| 655 | |||
| 656 | for (i = 0, j = 0; i < maxlen; j++) { | ||
| 657 | src_char = source[i]; | ||
| 658 | switch (src_char) { | ||
| 659 | case 0: | ||
| 660 | target[j] = 0; | ||
| 661 | goto ctoUCS_out; | ||
| 662 | case ':': | ||
| 663 | target[j] = cpu_to_le16(UNI_COLON); | ||
| 664 | break; | ||
| 665 | case '*': | ||
| 666 | target[j] = cpu_to_le16(UNI_ASTERIK); | ||
| 667 | break; | ||
| 668 | case '?': | ||
| 669 | target[j] = cpu_to_le16(UNI_QUESTION); | ||
| 670 | break; | ||
| 671 | case '<': | ||
| 672 | target[j] = cpu_to_le16(UNI_LESSTHAN); | ||
| 673 | break; | ||
| 674 | case '>': | ||
| 675 | target[j] = cpu_to_le16(UNI_GRTRTHAN); | ||
| 676 | break; | ||
| 677 | case '|': | ||
| 678 | target[j] = cpu_to_le16(UNI_PIPE); | ||
| 679 | break; | ||
| 680 | /* BB We can not handle remapping slash until | ||
| 681 | all the calls to build_path_from_dentry | ||
| 682 | are modified, as they use slash as separator BB */ | ||
| 683 | /* case '\\': | ||
| 684 | target[j] = cpu_to_le16(UNI_SLASH); | ||
| 685 | break;*/ | ||
| 686 | default: | ||
| 687 | charlen = cp->char2uni(source+i, | ||
| 688 | len_remaining, &temp); | ||
| 689 | /* if no match, use question mark, which | ||
| 690 | at least in some cases servers as wild card */ | ||
| 691 | if (charlen < 1) { | ||
| 692 | target[j] = cpu_to_le16(0x003f); | ||
| 693 | charlen = 1; | ||
| 694 | } else | ||
| 695 | target[j] = cpu_to_le16(temp); | ||
| 696 | len_remaining -= charlen; | ||
| 697 | /* character may take more than one byte in the | ||
| 698 | the source string, but will take exactly two | ||
| 699 | bytes in the target string */ | ||
| 700 | i += charlen; | ||
| 701 | continue; | ||
| 702 | } | ||
| 703 | i++; /* move to next char in source string */ | ||
| 704 | len_remaining--; | ||
| 705 | } | ||
| 706 | |||
| 707 | ctoUCS_out: | ||
| 708 | return i; | ||
| 709 | } | ||
| 710 | |||
| 711 | void | 640 | void |
| 712 | cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb) | 641 | cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb) |
| 713 | { | 642 | { |
