aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-05-04 08:05:26 -0400
committerSteve French <sfrench@us.ibm.com>2011-05-19 10:10:53 -0400
commit820a803ffac3ef591e597bc107f8e289a823a29c (patch)
tree246451259a7efc5027647de639a69cb121b889e0 /fs/cifs/connect.c
parent0e6e37a7a81f370d9aafafdf88aca13977f6fb5f (diff)
cifs: keep BCC in little-endian format
This is the same patch as originally posted, just with some merge conflicts fixed up... Currently, the ByteCount is usually converted to host-endian on receive. This is confusing however, as we need to keep two sets of routines for accessing it, and keep track of when to use each routine. Munging received packets like this also limits when the signature can be calulated. Simplify the code by keeping the received ByteCount in little-endian format. This allows us to eliminate a set of routines for accessing it and we can now drop the *_le suffixes from the accessor functions since that's now implied. While we're at it, switch all of the places that read the ByteCount directly to use the get_bcc inline which should also clean up some unaligned accesses. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 5d331cdd0b27..2b511991187a 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -317,12 +317,12 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
317 put_unaligned_le16(total_in_buf, &pSMBt->t2_rsp.DataCount); 317 put_unaligned_le16(total_in_buf, &pSMBt->t2_rsp.DataCount);
318 318
319 /* fix up the BCC */ 319 /* fix up the BCC */
320 byte_count = get_bcc_le(pTargetSMB); 320 byte_count = get_bcc(pTargetSMB);
321 byte_count += total_in_buf2; 321 byte_count += total_in_buf2;
322 /* is the result too big for the field? */ 322 /* is the result too big for the field? */
323 if (byte_count > USHRT_MAX) 323 if (byte_count > USHRT_MAX)
324 return -EPROTO; 324 return -EPROTO;
325 put_bcc_le(byte_count, pTargetSMB); 325 put_bcc(byte_count, pTargetSMB);
326 326
327 byte_count = be32_to_cpu(pTargetSMB->smb_buf_length); 327 byte_count = be32_to_cpu(pTargetSMB->smb_buf_length);
328 byte_count += total_in_buf2; 328 byte_count += total_in_buf2;