From patchwork Mon Nov 5 18:18:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 10668845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB9E613BF for ; Mon, 5 Nov 2018 18:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA0E929B2C for ; Mon, 5 Nov 2018 18:18:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACD4D29C01; Mon, 5 Nov 2018 18:18:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SUBJ_OBFU_PUNCT_FEW autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E59329B2C for ; Mon, 5 Nov 2018 18:18:22 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 3639021F479; Mon, 5 Nov 2018 10:18:21 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id A78D621F38C for ; Mon, 5 Nov 2018 10:18:19 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 7830D463; Mon, 5 Nov 2018 13:18:18 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 72C1F2A1; Mon, 5 Nov 2018 13:18:18 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 5 Nov 2018 13:18:07 -0500 Message-Id: <1541441887-15064-1-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 Subject: [lustre-devel] [PATCH] lustre: remove iter type from iov_iter_[b|k]vec() X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP The linux commit aa563d7bca6e ("iov_iter: Separate type from direction and use accessor functions) removed the iter type from both iov_iter_bvec() and iov_iter_kvec(). Update lustre to this change. Without it we see in testing: WARNING: CPU: 2 PID: 3088 at lib/iov_iter.c:1082 iov_iter_kvec+0x25/0x30 Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 4 ++-- drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 8 ++++---- drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 4 ++-- drivers/staging/lustre/lnet/lnet/lib-move.c | 4 ++-- drivers/staging/lustre/lnet/lnet/lib-socket.c | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index 23ce59e..57fe037 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -1548,11 +1548,11 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid, LASSERT(!(payload_kiov && payload_iov)); if (payload_kiov) - iov_iter_bvec(&from, ITER_BVEC | WRITE, + iov_iter_bvec(&from, WRITE, payload_kiov, payload_niov, payload_nob + payload_offset); else - iov_iter_kvec(&from, ITER_KVEC | WRITE, + iov_iter_kvec(&from, WRITE, payload_iov, payload_niov, payload_nob + payload_offset); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c index c401896..4abf0eb 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c @@ -1001,7 +1001,7 @@ struct ksock_route * kvec->iov_base = &conn->ksnc_msg; kvec->iov_len = offsetof(struct ksock_msg, ksm_u); conn->ksnc_rx_nob_left = offsetof(struct ksock_msg, ksm_u); - iov_iter_kvec(&conn->ksnc_rx_to, READ|ITER_KVEC, kvec, + iov_iter_kvec(&conn->ksnc_rx_to, READ, kvec, 1, offsetof(struct ksock_msg, ksm_u)); break; @@ -1011,7 +1011,7 @@ struct ksock_route * kvec->iov_base = &conn->ksnc_msg.ksm_u.lnetmsg; kvec->iov_len = sizeof(struct lnet_hdr); conn->ksnc_rx_nob_left = sizeof(struct lnet_hdr); - iov_iter_kvec(&conn->ksnc_rx_to, READ|ITER_KVEC, kvec, + iov_iter_kvec(&conn->ksnc_rx_to, READ, kvec, 1, sizeof(struct lnet_hdr)); break; @@ -1043,7 +1043,7 @@ struct ksock_route * } while (nob_to_skip && /* mustn't overflow conn's rx iov */ niov < sizeof(conn->ksnc_rx_iov_space) / sizeof(struct iovec)); - iov_iter_kvec(&conn->ksnc_rx_to, READ|ITER_KVEC, kvec, niov, skipped); + iov_iter_kvec(&conn->ksnc_rx_to, READ, kvec, niov, skipped); return 0; } @@ -1157,7 +1157,7 @@ struct ksock_route * kvec->iov_base = &conn->ksnc_msg.ksm_u.lnetmsg; kvec->iov_len = sizeof(struct ksock_lnet_msg); - iov_iter_kvec(&conn->ksnc_rx_to, READ|ITER_KVEC, kvec, + iov_iter_kvec(&conn->ksnc_rx_to, READ, kvec, 1, sizeof(struct ksock_lnet_msg)); goto again; /* read lnet header now */ diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c index 33847b9..686c2d3 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c @@ -92,7 +92,7 @@ nob < tx->tx_resid) msg.msg_flags |= MSG_MORE; - iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, + iov_iter_kvec(&msg.msg_iter, WRITE, tx->tx_iov, tx->tx_niov, nob); return sock_sendmsg(sock, &msg); } @@ -140,7 +140,7 @@ nob < tx->tx_resid) msg.msg_flags |= MSG_MORE; - iov_iter_bvec(&msg.msg_iter, WRITE | ITER_BVEC, + iov_iter_bvec(&msg.msg_iter, WRITE, kiov, tx->tx_nkiov, nob); rc = sock_sendmsg(sock, &msg); } diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 5694d85..eaa1dfa 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -498,10 +498,10 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats, } if (iov) { - iov_iter_kvec(&to, ITER_KVEC | READ, iov, niov, mlen + offset); + iov_iter_kvec(&to, READ, iov, niov, mlen + offset); iov_iter_advance(&to, offset); } else { - iov_iter_bvec(&to, ITER_BVEC | READ, kiov, niov, mlen + offset); + iov_iter_bvec(&to, READ, kiov, niov, mlen + offset); iov_iter_advance(&to, offset); } rc = ni->ni_net->net_lnd->lnd_recv(ni, private, msg, delayed, &to, rlen); diff --git a/drivers/staging/lustre/lnet/lnet/lib-socket.c b/drivers/staging/lustre/lnet/lnet/lib-socket.c index d9c62d3..62a742e 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-socket.c +++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c @@ -58,7 +58,7 @@ * Caller may pass a zero timeout if she thinks the socket buffer is * empty enough to take the whole message immediately */ - iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, &iov, 1, nob); + iov_iter_kvec(&msg.msg_iter, WRITE, &iov, 1, nob); for (;;) { msg.msg_flags = !timeout ? MSG_DONTWAIT : 0; if (timeout) { @@ -113,7 +113,7 @@ LASSERT(nob > 0); LASSERT(jiffies_left > 0); - iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &iov, 1, nob); + iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, nob); for (;;) { /* Set receive timeout to remaining time */