Commit 45740847 authored by Pavel Shilovsky's avatar Pavel Shilovsky

CIFS: Setup async request in ops struct

Signed-off-by: default avatarPavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent 25e26632
...@@ -173,6 +173,9 @@ struct smb_version_operations { ...@@ -173,6 +173,9 @@ struct smb_version_operations {
/* setup request: allocate mid, sign message */ /* setup request: allocate mid, sign message */
int (*setup_request)(struct cifs_ses *, struct kvec *, unsigned int, int (*setup_request)(struct cifs_ses *, struct kvec *, unsigned int,
struct mid_q_entry **); struct mid_q_entry **);
/* setup async request: allocate mid, sign message */
int (*setup_async_request)(struct TCP_Server_Info *, struct kvec *,
unsigned int, struct mid_q_entry **);
/* check response: verify signature, map error */ /* check response: verify signature, map error */
int (*check_receive)(struct mid_q_entry *, struct TCP_Server_Info *, int (*check_receive)(struct mid_q_entry *, struct TCP_Server_Info *,
bool); bool);
......
...@@ -78,6 +78,8 @@ extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses, ...@@ -78,6 +78,8 @@ extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
char *in_buf, int flags); char *in_buf, int flags);
extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int, extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int,
struct mid_q_entry **); struct mid_q_entry **);
extern int cifs_setup_async_request(struct TCP_Server_Info *, struct kvec *,
unsigned int, struct mid_q_entry **);
extern int cifs_check_receive(struct mid_q_entry *mid, extern int cifs_check_receive(struct mid_q_entry *mid,
struct TCP_Server_Info *server, bool log_error); struct TCP_Server_Info *server, bool log_error);
extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
......
...@@ -524,6 +524,7 @@ struct smb_version_operations smb1_operations = { ...@@ -524,6 +524,7 @@ struct smb_version_operations smb1_operations = {
.send_cancel = send_nt_cancel, .send_cancel = send_nt_cancel,
.compare_fids = cifs_compare_fids, .compare_fids = cifs_compare_fids,
.setup_request = cifs_setup_request, .setup_request = cifs_setup_request,
.setup_async_request = cifs_setup_async_request,
.check_receive = cifs_check_receive, .check_receive = cifs_check_receive,
.add_credits = cifs_add_credits, .add_credits = cifs_add_credits,
.set_credits = cifs_set_credits, .set_credits = cifs_set_credits,
......
...@@ -345,7 +345,7 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) ...@@ -345,7 +345,7 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
return 0; return 0;
} }
static int int
cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov, cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov,
unsigned int nvec, struct mid_q_entry **ret_mid) unsigned int nvec, struct mid_q_entry **ret_mid)
{ {
...@@ -391,7 +391,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, ...@@ -391,7 +391,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
return rc; return rc;
mutex_lock(&server->srv_mutex); mutex_lock(&server->srv_mutex);
rc = cifs_setup_async_request(server, iov, nvec, &mid); rc = server->ops->setup_async_request(server, iov, nvec, &mid);
if (rc) { if (rc) {
mutex_unlock(&server->srv_mutex); mutex_unlock(&server->srv_mutex);
add_credits(server, 1, optype); add_credits(server, 1, optype);
......
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