Commit 34a54d61 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French

CIFS: Use separate var for the number of bytes got in async read

and don't mix it with the number of bytes that was requested.
Signed-off-by: default avatarPavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent 3fabaa27
...@@ -1059,6 +1059,7 @@ struct cifs_readdata { ...@@ -1059,6 +1059,7 @@ struct cifs_readdata {
struct address_space *mapping; struct address_space *mapping;
__u64 offset; __u64 offset;
unsigned int bytes; unsigned int bytes;
unsigned int got_bytes;
pid_t pid; pid_t pid;
int result; int result;
struct work_struct work; struct work_struct work;
......
...@@ -1513,7 +1513,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) ...@@ -1513,7 +1513,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
return length; return length;
server->total_read += length; server->total_read += length;
rdata->bytes = length; rdata->got_bytes = length;
cifs_dbg(FYI, "total_read=%u buflen=%u remaining=%u\n", cifs_dbg(FYI, "total_read=%u buflen=%u remaining=%u\n",
server->total_read, buflen, data_len); server->total_read, buflen, data_len);
...@@ -1556,8 +1556,8 @@ cifs_readv_callback(struct mid_q_entry *mid) ...@@ -1556,8 +1556,8 @@ cifs_readv_callback(struct mid_q_entry *mid)
rc); rc);
} }
/* FIXME: should this be counted toward the initiating task? */ /* FIXME: should this be counted toward the initiating task? */
task_io_account_read(rdata->bytes); task_io_account_read(rdata->got_bytes);
cifs_stats_bytes_read(tcon, rdata->bytes); cifs_stats_bytes_read(tcon, rdata->got_bytes);
break; break;
case MID_REQUEST_SUBMITTED: case MID_REQUEST_SUBMITTED:
case MID_RETRY_NEEDED: case MID_RETRY_NEEDED:
......
...@@ -2840,7 +2840,7 @@ cifs_uncached_readdata_release(struct kref *refcount) ...@@ -2840,7 +2840,7 @@ cifs_uncached_readdata_release(struct kref *refcount)
static int static int
cifs_readdata_to_iov(struct cifs_readdata *rdata, struct iov_iter *iter) 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; unsigned int i;
for (i = 0; i < rdata->nr_pages; i++) { for (i = 0; i < rdata->nr_pages; i++) {
......
...@@ -1723,8 +1723,8 @@ smb2_readv_callback(struct mid_q_entry *mid) ...@@ -1723,8 +1723,8 @@ smb2_readv_callback(struct mid_q_entry *mid)
rc); rc);
} }
/* FIXME: should this be counted toward the initiating task? */ /* FIXME: should this be counted toward the initiating task? */
task_io_account_read(rdata->bytes); task_io_account_read(rdata->got_bytes);
cifs_stats_bytes_read(tcon, rdata->bytes); cifs_stats_bytes_read(tcon, rdata->got_bytes);
break; break;
case MID_REQUEST_SUBMITTED: case MID_REQUEST_SUBMITTED:
case MID_RETRY_NEEDED: case MID_RETRY_NEEDED:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment