diff options
author | Steve French <sfrench@us.ibm.com> | 2005-09-22 19:32:06 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-09-22 19:32:06 -0400 |
commit | 70ca734a14366b634224a1e4586d43b36b65ab67 (patch) | |
tree | bad9c511f846baebc18d0f5190bbe5fde5ae0dd1 /fs/cifs/misc.c | |
parent | 2096243885ee34b78cb57ce835e07c8536a67d2a (diff) |
[CIFS] Various minor bigendian fixes and sparse level 2 warning message fixes
Most important of these fixes mapchars on bigendian and a few statfs fields
Signed-off-by: Shaggy (shaggy@austin.ibm.com)
Signed-off-by: Steve French (sfrench@us.ibm.com)
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r-- | fs/cifs/misc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 26b35b55f31b..8a0edd695f84 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -419,7 +419,7 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid) | |||
419 | int | 419 | int |
420 | checkSMB(struct smb_hdr *smb, __u16 mid, int length) | 420 | checkSMB(struct smb_hdr *smb, __u16 mid, int length) |
421 | { | 421 | { |
422 | __u32 len = be32_to_cpu(smb->smb_buf_length); | 422 | __u32 len = smb->smb_buf_length; |
423 | cFYI(0, | 423 | cFYI(0, |
424 | ("Entering checkSMB with Length: %x, smb_buf_length: %x ", | 424 | ("Entering checkSMB with Length: %x, smb_buf_length: %x ", |
425 | length, len)); | 425 | length, len)); |
@@ -448,9 +448,9 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length) | |||
448 | if (checkSMBhdr(smb, mid)) | 448 | if (checkSMBhdr(smb, mid)) |
449 | return 1; | 449 | return 1; |
450 | 450 | ||
451 | if ((4 + len != smbCalcSize(smb)) | 451 | if ((4 + len != smbCalcSize_LE(smb)) |
452 | || (4 + len != (unsigned int)length)) { | 452 | || (4 + len != (unsigned int)length)) { |
453 | cERROR(1, ("smbCalcSize %x ", smbCalcSize(smb))); | 453 | cERROR(1, ("smbCalcSize %x ", smbCalcSize_LE(smb))); |
454 | cERROR(1, | 454 | cERROR(1, |
455 | ("bad smb size detected. The Mid=%d", smb->Mid)); | 455 | ("bad smb size detected. The Mid=%d", smb->Mid)); |
456 | return 1; | 456 | return 1; |
@@ -672,6 +672,7 @@ cifsConvertToUCS(__le16 * target, const char *source, int maxlen, | |||
672 | int i,j,charlen; | 672 | int i,j,charlen; |
673 | int len_remaining = maxlen; | 673 | int len_remaining = maxlen; |
674 | char src_char; | 674 | char src_char; |
675 | __u16 temp; | ||
675 | 676 | ||
676 | if(!mapChars) | 677 | if(!mapChars) |
677 | return cifs_strtoUCS((wchar_t *) target, source, PATH_MAX, cp); | 678 | return cifs_strtoUCS((wchar_t *) target, source, PATH_MAX, cp); |
@@ -708,13 +709,14 @@ cifsConvertToUCS(__le16 * target, const char *source, int maxlen, | |||
708 | break;*/ | 709 | break;*/ |
709 | default: | 710 | default: |
710 | charlen = cp->char2uni(source+i, | 711 | charlen = cp->char2uni(source+i, |
711 | len_remaining, target+j); | 712 | len_remaining, &temp); |
712 | /* if no match, use question mark, which | 713 | /* if no match, use question mark, which |
713 | at least in some cases servers as wild card */ | 714 | at least in some cases servers as wild card */ |
714 | if(charlen < 1) { | 715 | if(charlen < 1) { |
715 | target[j] = cpu_to_le16(0x003f); | 716 | target[j] = cpu_to_le16(0x003f); |
716 | charlen = 1; | 717 | charlen = 1; |
717 | } | 718 | } else |
719 | target[j] = cpu_to_le16(temp); | ||
718 | len_remaining -= charlen; | 720 | len_remaining -= charlen; |
719 | /* character may take more than one byte in the | 721 | /* character may take more than one byte in the |
720 | the source string, but will take exactly two | 722 | the source string, but will take exactly two |