From patchwork Fri Jul 13 07:53:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1194281 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0C1DD3FC4C for ; Fri, 13 Jul 2012 07:55:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755201Ab2GMHz5 (ORCPT ); Fri, 13 Jul 2012 03:55:57 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:49057 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755103Ab2GMHz5 (ORCPT ); Fri, 13 Jul 2012 03:55:57 -0400 Received: by mail-lb0-f174.google.com with SMTP id gm6so5433132lbb.19 for ; Fri, 13 Jul 2012 00:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=TmxrDx/DAQQv5RUI/kOYp2B742S043H9iIp3B9hdv/Y=; b=obpNybx+brCsNPXnI9WDUFvMbvGFC9scwNYy5yRFtEDOnjQWUAc4fmNpqCX41y3Mmw khxDkMj0FigzWXfCqNrkfTasv44GhBlKIwUvA9jSaOWeUuz1an5TLkfcIEKJSbSpozx3 cYizvcqMED9kaolZf/OFTvjUzgVJvlTZJSUJlOyFprCx8e1HSnLrLeBkvy+57IVGpdrT WFAKoz/cYBWvhHDzXZdDTPSX91LRDU7xEo0RKHkNDooYxNk2tYMJfzlclYwUq7XJ93li 3E1WTXpHfppXmAy0D77tfOfQS6P/obMq+EACzGRuXBBdFfLvIbEoiWFepIEuIpGdjnYg Hjiw== Received: by 10.112.85.72 with SMTP id f8mr292372lbz.65.1342166155289; Fri, 13 Jul 2012 00:55:55 -0700 (PDT) Received: from localhost.localdomain ([178.45.132.158]) by mx.google.com with ESMTPS id er3sm1595545lbb.16.2012.07.13.00.55.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jul 2012 00:55:54 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH v3 28/32] CIFS: Add SMB2 support for async requests Date: Fri, 13 Jul 2012 11:53:41 +0400 Message-Id: <1342166025-29377-29-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1342166025-29377-1-git-send-email-pshilovsky@samba.org> References: <1342166025-29377-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Signed-off-by: Pavel Shilovsky --- fs/cifs/smb2ops.c | 1 + fs/cifs/smb2proto.h | 4 ++++ fs/cifs/smb2transport.c | 23 ++++++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletions(-) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 2f9950e..8672e49 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -209,6 +209,7 @@ smb2_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, struct smb_version_operations smb21_operations = { .setup_request = smb2_setup_request, + .setup_async_request = smb2_setup_async_request, .check_receive = smb2_check_receive, .add_credits = smb2_add_credits, .set_credits = smb2_set_credits, diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index 1517b4c..1a17955 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h @@ -43,6 +43,10 @@ extern int smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server, bool log_error); extern int smb2_setup_request(struct cifs_ses *ses, struct kvec *iov, unsigned int nvec, struct mid_q_entry **ret_mid); +extern int smb2_setup_async_request(struct TCP_Server_Info *server, + struct kvec *iov, unsigned int nvec, + struct mid_q_entry **ret_mid); +extern void smb2_echo_request(struct work_struct *work); extern int smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_sb_info *cifs_sb, diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c index b4b6b9a..31f5d42 100644 --- a/fs/cifs/smb2transport.c +++ b/fs/cifs/smb2transport.c @@ -148,4 +148,25 @@ smb2_setup_request(struct cifs_ses *ses, struct kvec *iov, return rc; } -/* BB add missing functions here */ +int +smb2_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov, + unsigned int nvec, struct mid_q_entry **ret_mid) +{ + int rc = 0; + struct smb2_hdr *hdr = (struct smb2_hdr *)iov[0].iov_base; + struct mid_q_entry *mid; + + smb2_seq_num_into_buf(server, hdr); + + mid = smb2_mid_entry_alloc(hdr, server); + if (mid == NULL) + return -ENOMEM; + + /* rc = smb2_sign_smb2(iov, nvec, server); + if (rc) { + DeleteMidQEntry(mid); + return rc; + }*/ + *ret_mid = mid; + return rc; +}