diff options
author | Steve French <sfrench@us.ibm.com> | 2009-05-01 01:27:32 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-05-01 01:27:32 -0400 |
commit | 0e0d2cf32743c660aab20e40aeb2155c06a256db (patch) | |
tree | 94dfb57ad091f283172628a3bba754e1562ded7d /fs/cifs/cifssmb.c | |
parent | e14b2fe1e64d3e4bd2f328ff9d1969f318f55954 (diff) |
[CIFS] Remove sparse endian warnings
Removes two sparse CHECK_ENDIAN warnings from Jeffs earlier patch,
and removes the dead readlink code (after noting where in
findfirst we will need to add something like that in the future
to handle the newly discovered unexpected error on FindFirst of NTFS symlinks.
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index df5276e628bf..b968e5bd7df3 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -2451,16 +2451,20 @@ querySymLinkRetry: | |||
2451 | if (rc || (pSMBr->ByteCount < 2)) | 2451 | if (rc || (pSMBr->ByteCount < 2)) |
2452 | rc = -EIO; | 2452 | rc = -EIO; |
2453 | else { | 2453 | else { |
2454 | bool is_unicode; | ||
2454 | u16 count = le16_to_cpu(pSMBr->t2.DataCount); | 2455 | u16 count = le16_to_cpu(pSMBr->t2.DataCount); |
2455 | 2456 | ||
2456 | data_start = ((char *) &pSMBr->hdr.Protocol) + | 2457 | data_start = ((char *) &pSMBr->hdr.Protocol) + |
2457 | le16_to_cpu(pSMBr->t2.DataOffset); | 2458 | le16_to_cpu(pSMBr->t2.DataOffset); |
2458 | 2459 | ||
2460 | if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) | ||
2461 | is_unicode = true; | ||
2462 | else | ||
2463 | is_unicode = false; | ||
2464 | |||
2459 | /* BB FIXME investigate remapping reserved chars here */ | 2465 | /* BB FIXME investigate remapping reserved chars here */ |
2460 | *symlinkinfo = cifs_strndup_from_ucs(data_start, count, | 2466 | *symlinkinfo = cifs_strndup_from_ucs(data_start, count, |
2461 | pSMBr->hdr.Flags2 & | 2467 | is_unicode, nls_codepage); |
2462 | SMBFLG2_UNICODE, | ||
2463 | nls_codepage); | ||
2464 | if (!symlinkinfo) | 2468 | if (!symlinkinfo) |
2465 | rc = -ENOMEM; | 2469 | rc = -ENOMEM; |
2466 | } | 2470 | } |
@@ -3930,7 +3934,7 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, | |||
3930 | 3934 | ||
3931 | cFYI(1, ("num_referrals: %d dfs flags: 0x%x ... \n", | 3935 | cFYI(1, ("num_referrals: %d dfs flags: 0x%x ... \n", |
3932 | *num_of_nodes, | 3936 | *num_of_nodes, |
3933 | le16_to_cpu(pSMBr->DFSFlags))); | 3937 | le32_to_cpu(pSMBr->DFSFlags))); |
3934 | 3938 | ||
3935 | *target_nodes = kzalloc(sizeof(struct dfs_info3_param) * | 3939 | *target_nodes = kzalloc(sizeof(struct dfs_info3_param) * |
3936 | *num_of_nodes, GFP_KERNEL); | 3940 | *num_of_nodes, GFP_KERNEL); |
@@ -3946,7 +3950,7 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, | |||
3946 | int max_len; | 3950 | int max_len; |
3947 | struct dfs_info3_param *node = (*target_nodes)+i; | 3951 | struct dfs_info3_param *node = (*target_nodes)+i; |
3948 | 3952 | ||
3949 | node->flags = le16_to_cpu(pSMBr->DFSFlags); | 3953 | node->flags = le32_to_cpu(pSMBr->DFSFlags); |
3950 | if (is_unicode) { | 3954 | if (is_unicode) { |
3951 | __le16 *tmp = kmalloc(strlen(searchName)*2 + 2, | 3955 | __le16 *tmp = kmalloc(strlen(searchName)*2 + 2, |
3952 | GFP_KERNEL); | 3956 | GFP_KERNEL); |