Commit 59ffd841 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

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: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent fcc31cb6
...@@ -69,7 +69,7 @@ extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, ...@@ -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 void DeleteMidQEntry(struct mid_q_entry *midEntry);
extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
unsigned int nvec, mid_callback_t *callback, unsigned int nvec, mid_callback_t *callback,
void *cbdata); void *cbdata, bool ignore_pend);
extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
struct smb_hdr * /* input */ , struct smb_hdr * /* input */ ,
struct smb_hdr * /* out */ , struct smb_hdr * /* out */ ,
......
...@@ -743,7 +743,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server) ...@@ -743,7 +743,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
iov.iov_base = smb; iov.iov_base = smb;
iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4; 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) if (rc)
cFYI(1, "Echo request failed: %d", rc); cFYI(1, "Echo request failed: %d", rc);
......
...@@ -343,13 +343,14 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) ...@@ -343,13 +343,14 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
*/ */
int int
cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, 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; int rc;
struct mid_q_entry *mid; struct mid_q_entry *mid;
struct smb_hdr *hdr = (struct smb_hdr *)iov[0].iov_base; 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) if (rc)
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment