]> git.hungrycats.org Git - linux/commitdiff
[PATCH] cifs: annotate READ_{REQ,RESP}
authorAlexander Viro <viro@www.linux.org.uk>
Tue, 21 Sep 2004 09:48:02 +0000 (02:48 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 21 Sep 2004 09:48:02 +0000 (02:48 -0700)
Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/cifs/cifspdu.h
fs/cifs/cifssmb.c

index d089bbe97bc83c6f8d207694da8d57544955fe14..34bcde0a7f8a781136bdcb3002414eed7ef75673 100644 (file)
@@ -700,28 +700,28 @@ typedef struct smb_com_read_req {
        struct smb_hdr hdr;     /* wct = 12 */
        __u8 AndXCommand;
        __u8 AndXReserved;
-       __u16 AndXOffset;
+       __le16 AndXOffset;
        __u16 Fid;
-       __u32 OffsetLow;
-       __u16 MaxCount;
-       __u16 MinCount;         /* obsolete */
-       __u32 MaxCountHigh;
-       __u16 Remaining;
-       __u32 OffsetHigh;
-       __u16 ByteCount;
+       __le32 OffsetLow;
+       __le16 MaxCount;
+       __le16 MinCount;                /* obsolete */
+       __le32 MaxCountHigh;
+       __le16 Remaining;
+       __le32 OffsetHigh;
+       __le16 ByteCount;
 } READ_REQ;
 
 typedef struct smb_com_read_rsp {
        struct smb_hdr hdr;     /* wct = 12 */
        __u8 AndXCommand;
        __u8 AndXReserved;
-       __u16 AndXOffset;
-       __u16 Remaining;
-       __u16 DataCompactionMode;
-       __u16 Reserved;
-       __u16 DataLength;
-       __u16 DataOffset;
-       __u16 DataLengthHigh;
+       __le16 AndXOffset;
+       __le16 Remaining;
+       __le16 DataCompactionMode;
+       __le16 Reserved;
+       __le16 DataLength;
+       __le16 DataOffset;
+       __le16 DataLengthHigh;
        __u64 Reserved2;
        __u16 ByteCount;
        __u8 Pad;               /* BB check for whether padded to DWORD boundary and optimum performance here */
index bb7e58bf05d1af246083b0ed6f2e0426058170fa..f2f591ff45ca2ef7e5f28c37a83501587a6f5446 100644 (file)
@@ -697,24 +697,24 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon,
        if (rc) {
                cERROR(1, ("Send error in read = %d", rc));
        } else {
-               pSMBr->DataLength = le16_to_cpu(pSMBr->DataLength);
-               *nbytes = pSMBr->DataLength;
+               __u16 data_length = le16_to_cpu(pSMBr->DataLength);
+               *nbytes = data_length;
                /*check that DataLength would not go beyond end of SMB */
-               if ((pSMBr->DataLength > CIFS_MAX_MSGSIZE) 
-                               || (pSMBr->DataLength > count)) {
-                       cFYI(1,("bad length %d for count %d",pSMBr->DataLength,count));
+               if ((data_length > CIFS_MAX_MSGSIZE) 
+                               || (data_length > count)) {
+                       cFYI(1,("bad length %d for count %d",data_length,count));
                        rc = -EIO;
                        *nbytes = 0;
                } else {
                        pReadData =
                            (char *) (&pSMBr->hdr.Protocol) +
                            le16_to_cpu(pSMBr->DataOffset);
-/*                     if(rc = copy_to_user(buf, pReadData, pSMBr->DataLength)) {
+/*                     if(rc = copy_to_user(buf, pReadData, data_length)) {
                                cERROR(1,("Faulting on read rc = %d",rc));
                                rc = -EFAULT;
                        }*/ /* can not use copy_to_user when using page cache*/
                        if(*buf)
-                           memcpy(*buf,pReadData,pSMBr->DataLength);
+                           memcpy(*buf,pReadData,data_length);
                }
        }
        if (pSMB) {