Commit 8040ddfb authored by Al Viro's avatar Al Viro Committed by Greg Kroah-Hartman

staging: lustre: ksocknal_lib_recv_iov(): recvmsg doesn't bugger iovec anymore...

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72e62b6c
...@@ -201,14 +201,7 @@ ksocknal_lib_eager_ack(struct ksock_conn *conn) ...@@ -201,14 +201,7 @@ ksocknal_lib_eager_ack(struct ksock_conn *conn)
int int
ksocknal_lib_recv_iov(struct ksock_conn *conn) ksocknal_lib_recv_iov(struct ksock_conn *conn)
{ {
#if SOCKNAL_SINGLE_FRAG_RX
struct kvec scratch;
struct kvec *scratchiov = &scratch;
unsigned int niov = 1;
#else
struct kvec *scratchiov = conn->ksnc_scheduler->kss_scratch_iov;
unsigned int niov = conn->ksnc_rx_niov; unsigned int niov = conn->ksnc_rx_niov;
#endif
struct kvec *iov = conn->ksnc_rx_iov; struct kvec *iov = conn->ksnc_rx_iov;
struct msghdr msg = { struct msghdr msg = {
.msg_flags = 0 .msg_flags = 0
...@@ -220,20 +213,15 @@ ksocknal_lib_recv_iov(struct ksock_conn *conn) ...@@ -220,20 +213,15 @@ ksocknal_lib_recv_iov(struct ksock_conn *conn)
int sum; int sum;
__u32 saved_csum; __u32 saved_csum;
/*
* NB we can't trust socket ops to either consume our iovs
* or leave them alone.
*/
LASSERT(niov > 0); LASSERT(niov > 0);
for (nob = i = 0; i < niov; i++) { for (nob = i = 0; i < niov; i++)
scratchiov[i] = iov[i]; nob += iov[i].iov_len;
nob += scratchiov[i].iov_len;
}
LASSERT(nob <= conn->ksnc_rx_nob_wanted); LASSERT(nob <= conn->ksnc_rx_nob_wanted);
rc = kernel_recvmsg(conn->ksnc_sock, &msg, scratchiov, niov, nob, iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, iov, niov, nob);
MSG_DONTWAIT); rc = sock_recvmsg(conn->ksnc_sock, &msg, MSG_DONTWAIT);
saved_csum = 0; saved_csum = 0;
if (conn->ksnc_proto == &ksocknal_protocol_v2x) { if (conn->ksnc_proto == &ksocknal_protocol_v2x) {
......
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