From patchwork Wed Jul 18 15:48:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1212091 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 511173FD4F for ; Wed, 18 Jul 2012 15:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754725Ab2GRPuh (ORCPT ); Wed, 18 Jul 2012 11:50:37 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:33500 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754501Ab2GRPug (ORCPT ); Wed, 18 Jul 2012 11:50:36 -0400 Received: by mail-ee0-f46.google.com with SMTP id c13so594931eek.19 for ; Wed, 18 Jul 2012 08:50:36 -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=cvVg3fgEh6CmvdWvuvq652y4vevjvw9LXqC5O4cuML4=; b=vMh2lVLhwCq2+WJ+2oObSwHPu+9nRRG1M1neEg5Ld2xbvPQ247CuXtKU36287pZe7I NlO8kyrmnh9ZZNASKnoTpfHr13RZOO7wIiDzAUFIzw/oeTb01TBIGzwjjElF2+Gggfod R/LoW50h7JdH5EmgwITk5ThbdARumQCKUR3BnQ2pVTMV1K3x1G25h2lnL/mxnZCPGsRN XYsRZ4/Fc5qNFgObw809FkR+9nUpg+/8AqLurDgOLvdpVmkRTsoT6UXM2F5WIEnjeawL 8bvEKi7kZ8LHlFG8O0qxSN9Xsp2c+h6koM5Asq+wU1WAzk3a3KXMaro68r69jLNVH+uf AtvQ== Received: by 10.152.131.68 with SMTP id ok4mr3977072lab.47.1342626635899; Wed, 18 Jul 2012 08:50:35 -0700 (PDT) Received: from localhost.localdomain ([178.45.208.11]) by mx.google.com with ESMTPS id p2sm4826985lbj.4.2012.07.18.08.50.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 08:50:35 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 22/45] CIFS: Move async read to ops struct Date: Wed, 18 Jul 2012 19:48:38 +0400 Message-Id: <1342626541-29872-23-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1342626541-29872-1-git-send-email-pshilovsky@samba.org> References: <1342626541-29872-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/file.c | 8 +++++++- fs/cifs/smb1ops.c | 1 + fs/cifs/smb2maperror.c | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 797c17a..e71ab49 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -172,6 +172,7 @@ struct dfs_info3_param; struct cifs_fattr; struct smb_vol; struct cifs_fid; +struct cifs_readdata; struct smb_version_operations { int (*send_cancel)(struct TCP_Server_Info *, void *, @@ -280,6 +281,8 @@ struct smb_version_operations { int (*close)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); /* send a flush request to the server */ int (*flush)(const unsigned int, struct cifs_tcon *, struct cifs_fid *); + /* async read from the server */ + int (*async_readv)(struct cifs_readdata *); }; struct smb_version_values { diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 3f2cfb3..81403ad 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2481,6 +2481,9 @@ static int cifs_retry_async_readv(struct cifs_readdata *rdata) { int rc; + struct TCP_Server_Info *server; + + server = tlink_tcon(rdata->cfile->tlink)->ses->server; do { if (rdata->cfile->invalidHandle) { @@ -2488,7 +2491,7 @@ cifs_retry_async_readv(struct cifs_readdata *rdata) if (rc != 0) continue; } - rc = cifs_async_readv(rdata); + rc = server->ops->async_readv(rdata); } while (rc == -EAGAIN); return rc; @@ -2640,6 +2643,9 @@ cifs_iovec_read(struct file *file, const struct iovec *iov, open_file = file->private_data; tcon = tlink_tcon(open_file->tlink); + if (!tcon->ses->server->ops->async_readv) + return -ENOSYS; + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) pid = open_file->pid; else diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index 7e8a2bd..e2dbd22 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c @@ -785,6 +785,7 @@ struct smb_version_operations smb1_operations = { .set_fid = cifs_set_fid, .close = cifs_close_file, .flush = cifs_flush_file, + .async_readv = cifs_async_readv, }; struct smb_version_values smb1_values = { diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c index be41478..eaf5466 100644 --- a/fs/cifs/smb2maperror.c +++ b/fs/cifs/smb2maperror.c @@ -2455,7 +2455,8 @@ map_smb2_to_linux_error(char *buf, bool log_err) return 0; /* mask facility */ - if (log_err && (smb2err != (STATUS_MORE_PROCESSING_REQUIRED))) + if (log_err && (smb2err != STATUS_MORE_PROCESSING_REQUIRED) && + (smb2err != STATUS_END_OF_FILE)) smb2_print_status(smb2err); else if (cifsFYI & CIFS_RC) smb2_print_status(smb2err);