Re: [PATCH 5/6] cifs_readv_receive: use cifs_read_from_socket()

From: Jeff Layton
Date: Tue Apr 19 2016 - 11:01:20 EST


On Sat, 2016-04-09 at 21:52 +0100, Al Viro wrote:
> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> ---
> Âfs/cifs/cifssmb.c | 11 ++++-------
> Â1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 76fcb50..3da077a 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -1447,10 +1447,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
> Â len = min_t(unsigned int, buflen, server->vals->read_rsp_size) -
> Â HEADER_SIZE(server) + 1;
> Â
> - rdata->iov.iov_base = buf + HEADER_SIZE(server) - 1;
> - rdata->iov.iov_len = len;
> -
> - length = cifs_readv_from_socket(server, &rdata->iov, 1, len);
> + length = cifs_read_from_socket(server,
> + ÂÂÂÂÂÂÂbuf + HEADER_SIZE(server) - 1, len);
> Â if (length < 0)
> Â return length;
> Â server->total_read += length;
> @@ -1502,9 +1500,8 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
> Â len = data_offset - server->total_read;
> Â if (len > 0) {
> Â /* read any junk before data into the rest of smallbuf */
> - rdata->iov.iov_base = buf + server->total_read;
> - rdata->iov.iov_len = len;
> - length = cifs_readv_from_socket(server, &rdata->iov, 1, len);
> + length = cifs_read_from_socket(server,
> + ÂÂÂÂÂÂÂbuf + server->total_read, len);
> Â if (length < 0)
> Â return length;
> Â server->total_read += length;

This one is orthogonal to the rest. Looks good though.

Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxxxxxxx>