diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-04-30 07:18:00 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-04-30 11:45:01 -0400 |
commit | f58841666bc22e827ca0dcef7b71c7bc2758ce82 (patch) | |
tree | 5391996d11f791a6ade2c1df1ed795be2cc6e1ab /fs/cifs/misc.c | |
parent | 460b96960d1946914e50316ffeefe7b41dddce91 (diff) |
cifs: change cifs_get_name_from_search_buf to use new unicode helper
...and remove cifs_convertUCSpath. There are no more callers. Also add a
#define for the buffer used in the readdir path so that we don't have so
many magic numbers floating around.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r-- | fs/cifs/misc.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index bb81c8af6a93..e079a9190ec4 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -635,66 +635,6 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length) | |||
635 | return; | 635 | return; |
636 | } | 636 | } |
637 | 637 | ||
638 | /* Convert 16 bit Unicode pathname from wire format to string in current code | ||
639 | page. Conversion may involve remapping up the seven characters that are | ||
640 | only legal in POSIX-like OS (if they are present in the string). Path | ||
641 | names are little endian 16 bit Unicode on the wire */ | ||
642 | int | ||
643 | cifs_convertUCSpath(char *target, const __le16 *source, int maxlen, | ||
644 | const struct nls_table *cp) | ||
645 | { | ||
646 | int i, j, len; | ||
647 | __u16 src_char; | ||
648 | |||
649 | for (i = 0, j = 0; i < maxlen; i++) { | ||
650 | src_char = le16_to_cpu(source[i]); | ||
651 | switch (src_char) { | ||
652 | case 0: | ||
653 | goto cUCS_out; /* BB check this BB */ | ||
654 | case UNI_COLON: | ||
655 | target[j] = ':'; | ||
656 | break; | ||
657 | case UNI_ASTERIK: | ||
658 | target[j] = '*'; | ||
659 | break; | ||
660 | case UNI_QUESTION: | ||
661 | target[j] = '?'; | ||
662 | break; | ||
663 | /* BB We can not handle remapping slash until | ||
664 | all the calls to build_path_from_dentry | ||
665 | are modified, as they use slash as separator BB */ | ||
666 | /* case UNI_SLASH: | ||
667 | target[j] = '\\'; | ||
668 | break;*/ | ||
669 | case UNI_PIPE: | ||
670 | target[j] = '|'; | ||
671 | break; | ||
672 | case UNI_GRTRTHAN: | ||
673 | target[j] = '>'; | ||
674 | break; | ||
675 | case UNI_LESSTHAN: | ||
676 | target[j] = '<'; | ||
677 | break; | ||
678 | default: | ||
679 | len = cp->uni2char(src_char, &target[j], | ||
680 | NLS_MAX_CHARSET_SIZE); | ||
681 | if (len > 0) { | ||
682 | j += len; | ||
683 | continue; | ||
684 | } else { | ||
685 | target[j] = '?'; | ||
686 | } | ||
687 | } | ||
688 | j++; | ||
689 | /* make sure we do not overrun callers allocated temp buffer */ | ||
690 | if (j >= (2 * NAME_MAX)) | ||
691 | break; | ||
692 | } | ||
693 | cUCS_out: | ||
694 | target[j] = 0; | ||
695 | return j; | ||
696 | } | ||
697 | |||
698 | /* Convert 16 bit Unicode pathname to wire format from string in current code | 638 | /* Convert 16 bit Unicode pathname to wire format from string in current code |
699 | page. Conversion may involve remapping up the seven characters that are | 639 | page. Conversion may involve remapping up the seven characters that are |
700 | only legal in POSIX-like OS (if they are present in the string). Path | 640 | only legal in POSIX-like OS (if they are present in the string). Path |