Merge tag 'sound-4.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[linux-2.6-microblaze.git] / fs / cifs / smb2ops.c
index bdb963d..ed88ab8 100644 (file)
@@ -1406,7 +1406,8 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses,
        } while (rc == -EAGAIN);
 
        if (rc) {
-               cifs_dbg(VFS, "ioctl error in smb2_get_dfs_refer rc=%d\n", rc);
+               if (rc != -ENOENT)
+                       cifs_dbg(VFS, "ioctl error in smb2_get_dfs_refer rc=%d\n", rc);
                goto out;
        }
 
@@ -2087,22 +2088,6 @@ init_sg(struct smb_rqst *rqst, u8 *sign)
        return sg;
 }
 
-struct cifs_crypt_result {
-       int err;
-       struct completion completion;
-};
-
-static void cifs_crypt_complete(struct crypto_async_request *req, int err)
-{
-       struct cifs_crypt_result *res = req->data;
-
-       if (err == -EINPROGRESS)
-               return;
-
-       res->err = err;
-       complete(&res->completion);
-}
-
 static int
 smb2_get_enc_key(struct TCP_Server_Info *server, __u64 ses_id, int enc, u8 *key)
 {
@@ -2143,12 +2128,10 @@ crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
        struct aead_request *req;
        char *iv;
        unsigned int iv_len;
-       struct cifs_crypt_result result = {0, };
+       DECLARE_CRYPTO_WAIT(wait);
        struct crypto_aead *tfm;
        unsigned int crypt_len = le32_to_cpu(tr_hdr->OriginalMessageSize);
 
-       init_completion(&result.completion);
-
        rc = smb2_get_enc_key(server, tr_hdr->SessionId, enc, key);
        if (rc) {
                cifs_dbg(VFS, "%s: Could not get %scryption key\n", __func__,
@@ -2208,14 +2191,10 @@ crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
        aead_request_set_ad(req, assoc_data_len);
 
        aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
-                                 cifs_crypt_complete, &result);
+                                 crypto_req_done, &wait);
 
-       rc = enc ? crypto_aead_encrypt(req) : crypto_aead_decrypt(req);
-
-       if (rc == -EINPROGRESS || rc == -EBUSY) {
-               wait_for_completion(&result.completion);
-               rc = result.err;
-       }
+       rc = crypto_wait_req(enc ? crypto_aead_encrypt(req)
+                               : crypto_aead_decrypt(req), &wait);
 
        if (!rc && enc)
                memcpy(&tr_hdr->Signature, sign, SMB2_SIGNATURE_SIZE);