CIFS: Setup async request in ops struct
authorPavel Shilovsky <pshilovsky@samba.org>
Fri, 1 Jun 2012 10:26:18 +0000 (14:26 +0400)
committerPavel Shilovsky <pshilovsky@samba.org>
Tue, 24 Jul 2012 17:55:12 +0000 (21:55 +0400)
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/cifsglob.h
fs/cifs/cifsproto.h
fs/cifs/smb1ops.c
fs/cifs/transport.c

index 340dce0ed07b1397e09a8203a90c63dbeba3fd03..5e4d1c56767da362a49bb0f954fda3457c5d1723 100644 (file)
@@ -173,6 +173,9 @@ struct smb_version_operations {
        /* setup request: allocate mid, sign message */
        int (*setup_request)(struct cifs_ses *, struct kvec *, unsigned int,
                             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 */
        int (*check_receive)(struct mid_q_entry *, struct TCP_Server_Info *,
                             bool);
index 334b867a81ff8cbf73f06df589e526347f707e4c..cf7fb185103c539e12cb2e8070838bf62c2fb600 100644 (file)
@@ -78,6 +78,8 @@ extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
                            char *in_buf, int flags);
 extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int,
                              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,
                        struct TCP_Server_Info *server, bool log_error);
 extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
index 7195fadf1cfaeb6dd5f59ca7f609a7a23a1742a1..7bd4973591deefdb45f87d043e0a70b200d2fa50 100644 (file)
@@ -524,6 +524,7 @@ struct smb_version_operations smb1_operations = {
        .send_cancel = send_nt_cancel,
        .compare_fids = cifs_compare_fids,
        .setup_request = cifs_setup_request,
+       .setup_async_request = cifs_setup_async_request,
        .check_receive = cifs_check_receive,
        .add_credits = cifs_add_credits,
        .set_credits = cifs_set_credits,
index bcc02b476f6e5c93d09d9d8037fb66060a84620f..83867ef348dfe15276d83379f12ae5c46399f7a0 100644 (file)
@@ -345,7 +345,7 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
        return 0;
 }
 
-static int
+int
 cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov,
                         unsigned int nvec, struct mid_q_entry **ret_mid)
 {
@@ -391,7 +391,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
                return rc;
 
        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) {
                mutex_unlock(&server->srv_mutex);
                add_credits(server, 1, optype);