From patchwork Fri Jul 13 07:53:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1194271 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 E90A93FC4C for ; Fri, 13 Jul 2012 07:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755186Ab2GMHzy (ORCPT ); Fri, 13 Jul 2012 03:55:54 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:45138 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755103Ab2GMHzy (ORCPT ); Fri, 13 Jul 2012 03:55:54 -0400 Received: by mail-lb0-f174.google.com with SMTP id gm6so5433168lbb.19 for ; Fri, 13 Jul 2012 00:55:53 -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=1ils+J8gLEK/eNZQV6c48FsYVFq4vgQzApM9gqr8tms=; b=P6prU2dYK78hISNrzPQ4rudlhhxOewK1uW1Giuyc97FIppKRoOp9mCSYWgKq6/Q/VD o8eIjcEVno3YYBUPwZGkqoMdEISZrs12WJtLaZmowmZqb1rAlmQfJAb34yqDSCJoC5u6 +UMsrMyB6x1uOXpDsjk/WkPVcJ+tSFOkRLH18f040bIAc1WLWRqjkA0oi/e8TQzXqwyA X8bbioDtJzFB0886/pzEzZenMP5P86f9b8LIwzaKcO4Lp6REBtHZdhIVoDYAfdMjYa3I pzLbPWdgcsEDuHMoKP7ZvAaOxE/gYoGPY5JAA+0XQBuCBlbUaQNYXVB/vOeq7UYi2LJ9 h4XA== Received: by 10.152.104.44 with SMTP id gb12mr165009lab.29.1342166153496; Fri, 13 Jul 2012 00:55:53 -0700 (PDT) Received: from localhost.localdomain ([178.45.132.158]) by mx.google.com with ESMTPS id er3sm1595545lbb.16.2012.07.13.00.55.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 13 Jul 2012 00:55:52 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH v3 27/32] CIFS: Setup async request in ops struct Date: Fri, 13 Jul 2012 11:53:40 +0400 Message-Id: <1342166025-29377-28-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/cifsglob.h | 3 +++ fs/cifs/cifsproto.h | 2 ++ fs/cifs/smb1ops.c | 1 + fs/cifs/transport.c | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 340dce0..5e4d1c5 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -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); diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 8836c7b..5aadeec 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h @@ -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 *, diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 7195fad..7bd4973 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c @@ -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, diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 8844328..4d37902 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -349,7 +349,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) { @@ -395,7 +395,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);