Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1448899
| From | Oleg Drokin <green@linuxhacker.ru> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 04/15] ksocknal_lib_recv_iov(): recvmsg doesn't bugger iovec anymore... |
| Date | 2016-07-23 08:50 +0200 |
| Message-ID | <rXYV3-7ZU-7@gated-at.bofh.it> (permalink) |
| References | <rXYLn-7WF-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
.../lustre/lnet/klnds/socklnd/socklnd_lib.c | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
index fe7b9f9..77bb29ff 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c
@@ -201,14 +201,7 @@ ksocknal_lib_eager_ack(struct ksock_conn *conn)
int
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;
-#endif
struct kvec *iov = conn->ksnc_rx_iov;
struct msghdr msg = {
.msg_flags = 0
@@ -220,20 +213,15 @@ ksocknal_lib_recv_iov(struct ksock_conn *conn)
int sum;
__u32 saved_csum;
- /*
- * NB we can't trust socket ops to either consume our iovs
- * or leave them alone.
- */
LASSERT(niov > 0);
- for (nob = i = 0; i < niov; i++) {
- scratchiov[i] = iov[i];
- nob += scratchiov[i].iov_len;
- }
+ for (nob = i = 0; i < niov; i++)
+ nob += iov[i].iov_len;
+
LASSERT(nob <= conn->ksnc_rx_nob_wanted);
- rc = kernel_recvmsg(conn->ksnc_sock, &msg, scratchiov, niov, nob,
- MSG_DONTWAIT);
+ iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, iov, niov, nob);
+ rc = sock_recvmsg(conn->ksnc_sock, &msg, MSG_DONTWAIT);
saved_csum = 0;
if (conn->ksnc_proto == &ksocknal_protocol_v2x) {
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/15] Lustre cleanups. Oleg Drokin <green@linuxhacker.ru> - 2016-07-23 08:50 +0200 [PATCH 05/15] ksocknal_lib_send_iov(): sendmsg doesn't bugger iovec... Oleg Drokin <green@linuxhacker.ru> - 2016-07-23 08:50 +0200 [PATCH 04/15] ksocknal_lib_recv_iov(): recvmsg doesn't bugger iovec anymore... Oleg Drokin <green@linuxhacker.ru> - 2016-07-23 08:50 +0200 [PATCH 03/15] lustre: don't reinvent struct bio_vec Oleg Drokin <green@linuxhacker.ru> - 2016-07-23 08:50 +0200
csiph-web