From patchwork Thu Jul 10 09:30:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4522391 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 52294BEEAA for ; Thu, 10 Jul 2014 09:31:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5124E20200 for ; Thu, 10 Jul 2014 09:31:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68D382024C for ; Thu, 10 Jul 2014 09:31:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752449AbaGJJbA (ORCPT ); Thu, 10 Jul 2014 05:31:00 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:34627 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbaGJJbA (ORCPT ); Thu, 10 Jul 2014 05:31:00 -0400 Received: by mail-lb0-f173.google.com with SMTP id s7so5885215lbd.18 for ; Thu, 10 Jul 2014 02:30:58 -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=1xAZmfRX948eT1S3EqfPnoS5hjAanfIql0J2/pxcdA0=; b=j659mX93j6/W+9AAI0m6tDLgFSwutNm1vAn5jGZmxOU6kJqyVDOFWW0f3lrVWWMHm5 vSZPkfq2dbzbyP5vQIRNotbJgf2YGYlTkHcv6v5eKu45kxKEnU7LM9jIWuL8EB8nprlD sOzU64sUq/O8tJEd0cXH6JkFAq6EaKr+w5Cz6WbcIkzR3wKXNgBlj4pOxFI8tCxugMAp 6kFrCgCEagXoNh07zgajWFG1jTGorrvdWWxBTFZWGSLZ7uTj5YJXiE6Z8T4dU6uLrdlm nJv+8ighNZF0YQTum1PCNsqnJy+Z1RaLpmYhfQLsmjM0P/hwiwxthajh3LmtVKULzqF0 7ZsQ== X-Received: by 10.112.139.167 with SMTP id qz7mr3480917lbb.22.1404984658467; Thu, 10 Jul 2014 02:30:58 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.36]) by mx.google.com with ESMTPSA id v6sm23257226lal.35.2014.07.10.02.30.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jul 2014 02:30:57 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 2/7] CIFS: Use separate var for the number of bytes got in async read Date: Thu, 10 Jul 2014 13:30:42 +0400 Message-Id: <1404984647-8710-3-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1404984647-8710-1-git-send-email-pshilovsky@samba.org> References: <1404984647-8710-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=-7.4 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 e411d2e..8af078f 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 5b4ca0c..17c0c31 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1724,8 +1724,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: