cifs: simplify read_from_socket
authorJeff Layton <jlayton@redhat.com>
Tue, 11 Oct 2011 10:41:32 +0000 (06:41 -0400)
committerSteve French <smfrench@gmail.com>
Thu, 13 Oct 2011 05:05:59 +0000 (00:05 -0500)
commita52c1eb7ae79f0a11511d49cfc00d2f9e576abea
treeaa8fb47c90a18f9556b9db559ae29711da891c17
parent21fed0d5b763b94a7d1568c27d0cce892ab8d43e
cifs: simplify read_from_socket

Move the iovec handling entirely into read_from_socket. That simplifies
the code and gets rid of the special handling for header reads. With
this we can also get rid of the "goto incomplete_rcv" label in the main
demultiplex thread function since we can now treat header and non-header
receives the same way.

Also, make it return an int (since we'll never receive enough to worry
about the sign bit anyway), and simply make it return the amount of bytes
read or a negative error code.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/connect.c