]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
cifs: add ignore_pend flag to cifs_call_async
authorJeff Layton <jlayton@redhat.com>
Thu, 19 May 2011 20:22:55 +0000 (16:22 -0400)
committerSteve French <sfrench@us.ibm.com>
Mon, 23 May 2011 02:59:16 +0000 (02:59 +0000)
The current code always ignores the max_pending limit. Have it instead
only optionally ignore the pending limit. For CIFSSMBEcho, we need to
ignore it to make sure they always can go out. For async reads, writes
and potentially other calls, we need to respect it.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/transport.c

index f00aa74c260781d5d8dbb60e5c9bab1ff2594dbc..3738a322cbef9edbf92be89a0432fbed9a7c8ce7 100644 (file)
@@ -69,7 +69,7 @@ extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer,
 extern void DeleteMidQEntry(struct mid_q_entry *midEntry);
 extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
                           unsigned int nvec, mid_callback_t *callback,
-                          void *cbdata);
+                          void *cbdata, bool ignore_pend);
 extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
                        struct smb_hdr * /* input */ ,
                        struct smb_hdr * /* out */ ,
index 8791c74575d961ce7b80b20c0d7cf487de19f1fd..e0d24135b3c69f400e96efedb180094be646f36d 100644 (file)
@@ -743,7 +743,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
        iov.iov_base = smb;
        iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4;
 
-       rc = cifs_call_async(server, &iov, 1, cifs_echo_callback, server);
+       rc = cifs_call_async(server, &iov, 1, cifs_echo_callback, server, true);
        if (rc)
                cFYI(1, "Echo request failed: %d", rc);
 
index 67f59c7b5d79d1510e6ea8a9bf2954f5dd8afaea..16bcc0725ceec28d63bf09a18c99d90265ab4d4f 100644 (file)
@@ -343,13 +343,14 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
  */
 int
 cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
-               unsigned int nvec, mid_callback_t *callback, void *cbdata)
+               unsigned int nvec, mid_callback_t *callback, void *cbdata,
+               bool ignore_pend)
 {
        int rc;
        struct mid_q_entry *mid;
        struct smb_hdr *hdr = (struct smb_hdr *)iov[0].iov_base;
 
-       rc = wait_for_free_request(server, CIFS_ASYNC_OP);
+       rc = wait_for_free_request(server, ignore_pend ? CIFS_ASYNC_OP : 0);
        if (rc)
                return rc;