aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-02 13:06:38 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-02 13:06:38 -0500
commitb4844353c0577bef6db54e5b276ede1acbed5b3d (patch)
tree569e9813ae7ab79616849b117c6b50b3d6e4dabb /drivers
parent6556c38524f3a55427598af2d7fc9c1d9c75bdae (diff)
parent1b784140474e4fc94281a49e96c67d29df0efbde (diff)
Merge branch 'sendmsg_recvmsg_iocb_removal'
Ying Xue says: ==================== net: Remove iocb argument from sendmsg and recvmsg Currently there is only one user - TIPC whose sendmsg() instances using iocb argument. Meanwhile, there is no user using iocb argument in its recvmsg() instance. Therefore, if we eliminate the werid usage of iobc argument from TIPC, the iocb argument can be removed from all sendmsg() and recvmsg() instances of the whole networking stack. Reference: https://patchwork.ozlabs.org/patch/433960/ Changes: v2: * Fix compile errors of DCCP module pointed by David ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/mISDN/socket.c7
-rw-r--r--drivers/net/macvtap.c9
-rw-r--r--drivers/net/ppp/pppoe.c8
-rw-r--r--drivers/net/tun.c6
-rw-r--r--drivers/vhost/net.c6
5 files changed, 16 insertions, 20 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 84b35925ee4d..8dc7290089bb 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -112,8 +112,8 @@ mISDN_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
112} 112}
113 113
114static int 114static int
115mISDN_sock_recvmsg(struct kiocb *iocb, struct socket *sock, 115mISDN_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
116 struct msghdr *msg, size_t len, int flags) 116 int flags)
117{ 117{
118 struct sk_buff *skb; 118 struct sk_buff *skb;
119 struct sock *sk = sock->sk; 119 struct sock *sk = sock->sk;
@@ -173,8 +173,7 @@ mISDN_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
173} 173}
174 174
175static int 175static int
176mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock, 176mISDN_sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
177 struct msghdr *msg, size_t len)
178{ 177{
179 struct sock *sk = sock->sk; 178 struct sock *sk = sock->sk;
180 struct sk_buff *skb; 179 struct sk_buff *skb;
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index e40fdfccc9c1..1e51c6bf3ae1 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -1127,16 +1127,15 @@ static const struct file_operations macvtap_fops = {
1127#endif 1127#endif
1128}; 1128};
1129 1129
1130static int macvtap_sendmsg(struct kiocb *iocb, struct socket *sock, 1130static int macvtap_sendmsg(struct socket *sock, struct msghdr *m,
1131 struct msghdr *m, size_t total_len) 1131 size_t total_len)
1132{ 1132{
1133 struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock); 1133 struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock);
1134 return macvtap_get_user(q, m, &m->msg_iter, m->msg_flags & MSG_DONTWAIT); 1134 return macvtap_get_user(q, m, &m->msg_iter, m->msg_flags & MSG_DONTWAIT);
1135} 1135}
1136 1136
1137static int macvtap_recvmsg(struct kiocb *iocb, struct socket *sock, 1137static int macvtap_recvmsg(struct socket *sock, struct msghdr *m,
1138 struct msghdr *m, size_t total_len, 1138 size_t total_len, int flags)
1139 int flags)
1140{ 1139{
1141 struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock); 1140 struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock);
1142 int ret; 1141 int ret;
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index 9c97e9bcf5f5..ff059e1d8ac6 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -835,8 +835,8 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
835 return err; 835 return err;
836} 836}
837 837
838static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, 838static int pppoe_sendmsg(struct socket *sock, struct msghdr *m,
839 struct msghdr *m, size_t total_len) 839 size_t total_len)
840{ 840{
841 struct sk_buff *skb; 841 struct sk_buff *skb;
842 struct sock *sk = sock->sk; 842 struct sock *sk = sock->sk;
@@ -977,8 +977,8 @@ static const struct ppp_channel_ops pppoe_chan_ops = {
977 .start_xmit = pppoe_xmit, 977 .start_xmit = pppoe_xmit,
978}; 978};
979 979
980static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, 980static int pppoe_recvmsg(struct socket *sock, struct msghdr *m,
981 struct msghdr *m, size_t total_len, int flags) 981 size_t total_len, int flags)
982{ 982{
983 struct sock *sk = sock->sk; 983 struct sock *sk = sock->sk;
984 struct sk_buff *skb; 984 struct sk_buff *skb;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 857dca47bf80..b96b94cee760 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1448,8 +1448,7 @@ static void tun_sock_write_space(struct sock *sk)
1448 kill_fasync(&tfile->fasync, SIGIO, POLL_OUT); 1448 kill_fasync(&tfile->fasync, SIGIO, POLL_OUT);
1449} 1449}
1450 1450
1451static int tun_sendmsg(struct kiocb *iocb, struct socket *sock, 1451static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
1452 struct msghdr *m, size_t total_len)
1453{ 1452{
1454 int ret; 1453 int ret;
1455 struct tun_file *tfile = container_of(sock, struct tun_file, socket); 1454 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
@@ -1464,8 +1463,7 @@ static int tun_sendmsg(struct kiocb *iocb, struct socket *sock,
1464 return ret; 1463 return ret;
1465} 1464}
1466 1465
1467static int tun_recvmsg(struct kiocb *iocb, struct socket *sock, 1466static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len,
1468 struct msghdr *m, size_t total_len,
1469 int flags) 1467 int flags)
1470{ 1468{
1471 struct tun_file *tfile = container_of(sock, struct tun_file, socket); 1469 struct tun_file *tfile = container_of(sock, struct tun_file, socket);
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index afa06d28725d..633012cc9a57 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -390,7 +390,7 @@ static void handle_tx(struct vhost_net *net)
390 ubufs = NULL; 390 ubufs = NULL;
391 } 391 }
392 /* TODO: Check specific error and bomb out unless ENOBUFS? */ 392 /* TODO: Check specific error and bomb out unless ENOBUFS? */
393 err = sock->ops->sendmsg(NULL, sock, &msg, len); 393 err = sock->ops->sendmsg(sock, &msg, len);
394 if (unlikely(err < 0)) { 394 if (unlikely(err < 0)) {
395 if (zcopy_used) { 395 if (zcopy_used) {
396 vhost_net_ubuf_put(ubufs); 396 vhost_net_ubuf_put(ubufs);
@@ -566,7 +566,7 @@ static void handle_rx(struct vhost_net *net)
566 /* On overrun, truncate and discard */ 566 /* On overrun, truncate and discard */
567 if (unlikely(headcount > UIO_MAXIOV)) { 567 if (unlikely(headcount > UIO_MAXIOV)) {
568 iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); 568 iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
569 err = sock->ops->recvmsg(NULL, sock, &msg, 569 err = sock->ops->recvmsg(sock, &msg,
570 1, MSG_DONTWAIT | MSG_TRUNC); 570 1, MSG_DONTWAIT | MSG_TRUNC);
571 pr_debug("Discarded rx packet: len %zd\n", sock_len); 571 pr_debug("Discarded rx packet: len %zd\n", sock_len);
572 continue; 572 continue;
@@ -597,7 +597,7 @@ static void handle_rx(struct vhost_net *net)
597 */ 597 */
598 iov_iter_advance(&fixup, sizeof(hdr)); 598 iov_iter_advance(&fixup, sizeof(hdr));
599 } 599 }
600 err = sock->ops->recvmsg(NULL, sock, &msg, 600 err = sock->ops->recvmsg(sock, &msg,
601 sock_len, MSG_DONTWAIT | MSG_TRUNC); 601 sock_len, MSG_DONTWAIT | MSG_TRUNC);
602 /* Userspace might have consumed the packet meanwhile: 602 /* Userspace might have consumed the packet meanwhile:
603 * it's not supposed to do this usually, but might be hard 603 * it's not supposed to do this usually, but might be hard