]> err.no Git - linux-2.6/blobdiff - fs/cifs/transport.c
Blackfin arch: Do not pollute name space used in linux-2.6.x/sound
[linux-2.6] / fs / cifs / transport.c
index f9ebe70ecc4d1a3c2182cabda287fd1c6a76416d..7ed32b3cb781a0011a0560b7fe3898825f5c9e4f 100644 (file)
@@ -32,7 +32,7 @@
 #include "cifsglob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
-  
+
 extern mempool_t *cifs_mid_poolp;
 extern struct kmem_cache *cifs_oplock_cachep;
 
@@ -49,13 +49,13 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct cifsSesInfo *ses)
                cERROR(1, ("Null TCP session in AllocMidQEntry"));
                return NULL;
        }
-       
+
        temp = (struct mid_q_entry *) mempool_alloc(cifs_mid_poolp,
                                                    GFP_KERNEL | GFP_NOFS);
        if (temp == NULL)
                return temp;
        else {
-               memset(temp, 0, sizeof (struct mid_q_entry));
+               memset(temp, 0, sizeof(struct mid_q_entry));
                temp->mid = smb_buffer->Mid;    /* always LE */
                temp->pid = current->pid;
                temp->command = smb_buffer->Command;
@@ -158,7 +158,7 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
        iov.iov_len = len;
 
        smb_msg.msg_name = sin;
-       smb_msg.msg_namelen = sizeof (struct sockaddr);
+       smb_msg.msg_namelen = sizeof(struct sockaddr);
        smb_msg.msg_control = NULL;
        smb_msg.msg_controllen = 0;
        smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; /* BB add more flags?*/
@@ -223,12 +223,12 @@ smb_send2(struct socket *ssocket, struct kvec *iov, int n_vec,
        unsigned int total_len;
        int first_vec = 0;
        unsigned int smb_buf_length = smb_buffer->smb_buf_length;
-       
+
        if (ssocket == NULL)
                return -ENOTSOCK; /* BB eventually add reconnect code here */
 
        smb_msg.msg_name = sin;
-       smb_msg.msg_namelen = sizeof (struct sockaddr);
+       smb_msg.msg_namelen = sizeof(struct sockaddr);
        smb_msg.msg_control = NULL;
        smb_msg.msg_controllen = 0;
        smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; /* BB add more flags?*/
@@ -335,7 +335,7 @@ static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
 
                                /* can not count locking commands against total
                                   as they are allowed to block on server */
-                                       
+
                                /* update # of requests on the wire to server */
                                if (long_op < 3)
                                        atomic_inc(&ses->server->inFlight);
@@ -363,9 +363,8 @@ static int allocate_mid(struct cifsSesInfo *ses, struct smb_hdr *in_buf,
                } /* else ok - we are setting up session */
        }
        *ppmidQ = AllocMidQEntry(in_buf, ses);
-       if (*ppmidQ == NULL) {
+       if (*ppmidQ == NULL)
                return -ENOMEM;
-       }
        return 0;
 }
 
@@ -419,14 +418,14 @@ static int wait_for_response(struct cifsSesInfo *ses,
 int
 SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
             struct kvec *iov, int n_vec, int *pRespBufType /* ret */,
-            const int long_op)
+            const int long_op, const int logError)
 {
        int rc = 0;
        unsigned int receive_len;
        unsigned long timeout;
        struct mid_q_entry *midQ;
        struct smb_hdr *in_buf = iov[0].iov_base;
-       
+
        *pRespBufType = CIFS_NO_BUFFER;  /* no response buf yet */
 
        if ((ses == NULL) || (ses->server == NULL)) {
@@ -465,7 +464,6 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                wake_up(&ses->server->request_q);
                return rc;
        }
-
        rc = cifs_sign_smb2(iov, n_vec, ses->server, &midQ->sequence_number);
 
        midQ->midState = MID_REQUEST_SUBMITTED;
@@ -537,7 +535,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                wake_up(&ses->server->request_q);
                return rc;
        }
-  
+
        if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
                cERROR(1, ("Frame too large received.  Length: %d  Xid: %d",
                        receive_len, xid));
@@ -568,13 +566,11 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                        }
 
                        /* BB special case reconnect tid and uid here? */
-                       /* BB special case Errbadpassword and pwdexpired here */
-                       rc = map_smb_to_linux_error(midQ->resp_buf);
+                       rc = map_smb_to_linux_error(midQ->resp_buf, logError);
 
                        /* convert ByteCount if necessary */
-                       if (receive_len >=
-                           sizeof (struct smb_hdr) -
-                           4 /* do not count RFC1001 header */  +
+                       if (receive_len >= sizeof(struct smb_hdr) - 4
+                           /* do not count RFC1001 header */  +
                            (2 * midQ->resp_buf->WordCount) + 2 /* bcc */ )
                                BCC(midQ->resp_buf) =
                                        le16_to_cpu(BCC_LE(midQ->resp_buf));
@@ -718,7 +714,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
                wake_up(&ses->server->request_q);
                return rc;
        }
-  
+
        if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
                cERROR(1, ("Frame too large received.  Length: %d  Xid: %d",
                        receive_len, xid));
@@ -749,12 +745,11 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
                        *pbytes_returned = out_buf->smb_buf_length;
 
                        /* BB special case reconnect tid and uid here? */
-                       rc = map_smb_to_linux_error(out_buf);
+                       rc = map_smb_to_linux_error(out_buf, 0 /* no log */ );
 
                        /* convert ByteCount if necessary */
-                       if (receive_len >=
-                           sizeof (struct smb_hdr) -
-                           4 /* do not count RFC1001 header */  +
+                       if (receive_len >= sizeof(struct smb_hdr) - 4
+                           /* do not count RFC1001 header */  +
                            (2 * out_buf->WordCount) + 2 /* bcc */ )
                                BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));
                } else {
@@ -962,7 +957,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
                DeleteMidQEntry(midQ);
                return rc;
        }
-  
+
        if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
                cERROR(1, ("Frame too large received.  Length: %d  Xid: %d",
                        receive_len, xid));
@@ -993,12 +988,11 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
                        *pbytes_returned = out_buf->smb_buf_length;
 
                        /* BB special case reconnect tid and uid here? */
-                       rc = map_smb_to_linux_error(out_buf);
+                       rc = map_smb_to_linux_error(out_buf, 0 /* no log */ );
 
                        /* convert ByteCount if necessary */
-                       if (receive_len >=
-                           sizeof (struct smb_hdr) -
-                           4 /* do not count RFC1001 header */  +
+                       if (receive_len >= sizeof(struct smb_hdr) - 4
+                           /* do not count RFC1001 header */  +
                            (2 * out_buf->WordCount) + 2 /* bcc */ )
                                BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));
                } else {