aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-05-19 16:22:55 -0400
committerSteve French <sfrench@us.ibm.com>2011-05-22 22:59:16 -0400
commit59ffd84141472c45a1729a739e4730f974d26e63 (patch)
tree4790475b37a8130049ca6b33c2fe4115ee709e94
parentfcc31cb6f1ae6c4e64a463b124d3c2e9cbd7dd70 (diff)
cifs: add ignore_pend flag to cifs_call_async
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>
-rw-r--r--fs/cifs/cifsproto.h2
-rw-r--r--fs/cifs/cifssmb.c2
-rw-r--r--fs/cifs/transport.c5
3 files changed, 5 insertions, 4 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index f00aa74c2607..3738a322cbef 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -69,7 +69,7 @@ extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer,
69extern void DeleteMidQEntry(struct mid_q_entry *midEntry); 69extern void DeleteMidQEntry(struct mid_q_entry *midEntry);
70extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, 70extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
71 unsigned int nvec, mid_callback_t *callback, 71 unsigned int nvec, mid_callback_t *callback,
72 void *cbdata); 72 void *cbdata, bool ignore_pend);
73extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, 73extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
74 struct smb_hdr * /* input */ , 74 struct smb_hdr * /* input */ ,
75 struct smb_hdr * /* out */ , 75 struct smb_hdr * /* out */ ,
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 8791c74575d9..e0d24135b3c6 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -743,7 +743,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
743 iov.iov_base = smb; 743 iov.iov_base = smb;
744 iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4; 744 iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4;
745 745
746 rc = cifs_call_async(server, &iov, 1, cifs_echo_callback, server); 746 rc = cifs_call_async(server, &iov, 1, cifs_echo_callback, server, true);
747 if (rc) 747 if (rc)
748 cFYI(1, "Echo request failed: %d", rc); 748 cFYI(1, "Echo request failed: %d", rc);
749 749
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 67f59c7b5d79..16bcc0725cee 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -343,13 +343,14 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
343 */ 343 */
344int 344int
345cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, 345cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
346 unsigned int nvec, mid_callback_t *callback, void *cbdata) 346 unsigned int nvec, mid_callback_t *callback, void *cbdata,
347 bool ignore_pend)
347{ 348{
348 int rc; 349 int rc;
349 struct mid_q_entry *mid; 350 struct mid_q_entry *mid;
350 struct smb_hdr *hdr = (struct smb_hdr *)iov[0].iov_base; 351 struct smb_hdr *hdr = (struct smb_hdr *)iov[0].iov_base;
351 352
352 rc = wait_for_free_request(server, CIFS_ASYNC_OP); 353 rc = wait_for_free_request(server, ignore_pend ? CIFS_ASYNC_OP : 0);
353 if (rc) 354 if (rc)
354 return rc; 355 return rc;
355 356