From patchwork Mon Jul 14 09:01:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4543581 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50DF8C0514 for ; Mon, 14 Jul 2014 09:01:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 589602010E for ; Mon, 14 Jul 2014 09:01:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4083220131 for ; Mon, 14 Jul 2014 09:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753438AbaGNJBa (ORCPT ); Mon, 14 Jul 2014 05:01:30 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:41417 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbaGNJB3 (ORCPT ); Mon, 14 Jul 2014 05:01:29 -0400 Received: by mail-la0-f41.google.com with SMTP id hz20so2626365lab.14 for ; Mon, 14 Jul 2014 02:01:27 -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:in-reply-to:references; bh=SF3/ngnZ5TemBAb+MUjFO7kpOr1sNOCvrYgaWP5CI6I=; b=AKw9+p2sBi3XDqwmpIjWB0Hd47qtelrJTnpiFTBMfs35zOYAViMZtKS9TqnX+lUaex 9/HvdqtwQiyuoMWUcnVUprF5gOe0qpDGYLXuD8JqLodxZiXmMUlPOMI2GHDtZ1oEKQwc YKe2nru0kdE+yYxQuWJdp5AK8r2Uc0O6QhErE/g1VTQfYCsKUNNPPkZKq/VWWKdLn1YV LkuEZUT23DM28P3hIlsbUIaRcI29Bg8e5AjRdSIz3ju/1XUCn9hcRD4d7wWehKxJnzXT X0EYFj10h7uaCS0cZkTqP8/GGN5ZiwyUnWHG7DZmuLqPC/ei8ET5D5YDWrpXEu4l2XS7 c0oA== X-Received: by 10.152.8.109 with SMTP id q13mr12533726laa.31.1405328487943; Mon, 14 Jul 2014 02:01:27 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.85]) by mx.google.com with ESMTPSA id r2sm5063434lag.27.2014.07.14.02.01.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 02:01:27 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH v2 2/7] CIFS: Use separate var for the number of bytes got in async read Date: Mon, 14 Jul 2014 13:01:12 +0400 Message-Id: <1405328477-13484-3-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1405328477-13484-1-git-send-email-pshilovsky@samba.org> References: <1405328477-13484-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 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP and don't mix it with the number of bytes that was requested. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsglob.h | 1 + fs/cifs/cifssmb.c | 6 +++--- fs/cifs/file.c | 2 +- fs/cifs/smb2pdu.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index f33ff4c..0012e1e 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -1059,6 +1059,7 @@ struct cifs_readdata { struct address_space *mapping; __u64 offset; unsigned int bytes; + unsigned int got_bytes; pid_t pid; int result; struct work_struct work; diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 6ded59d..a3e424d 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -1513,7 +1513,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) return length; server->total_read += length; - rdata->bytes = length; + rdata->got_bytes = length; cifs_dbg(FYI, "total_read=%u buflen=%u remaining=%u\n", server->total_read, buflen, data_len); @@ -1556,8 +1556,8 @@ cifs_readv_callback(struct mid_q_entry *mid) rc); } /* FIXME: should this be counted toward the initiating task? */ - task_io_account_read(rdata->bytes); - cifs_stats_bytes_read(tcon, rdata->bytes); + task_io_account_read(rdata->got_bytes); + cifs_stats_bytes_read(tcon, rdata->got_bytes); break; case MID_REQUEST_SUBMITTED: case MID_RETRY_NEEDED: diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 0974dd2..7fc9bdc 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2839,7 +2839,7 @@ cifs_uncached_readdata_release(struct kref *refcount) static int cifs_readdata_to_iov(struct cifs_readdata *rdata, struct iov_iter *iter) { - size_t remaining = rdata->bytes; + size_t remaining = rdata->got_bytes; unsigned int i; for (i = 0; i < rdata->nr_pages; i++) { diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 26624ee..0aabd7c 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1734,8 +1734,8 @@ smb2_readv_callback(struct mid_q_entry *mid) rc); } /* FIXME: should this be counted toward the initiating task? */ - task_io_account_read(rdata->bytes); - cifs_stats_bytes_read(tcon, rdata->bytes); + task_io_account_read(rdata->got_bytes); + cifs_stats_bytes_read(tcon, rdata->got_bytes); break; case MID_REQUEST_SUBMITTED: case MID_RETRY_NEEDED: