aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-15 21:39:31 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-11 15:53:35 -0400
commit01e97e6517053d7c0b9af5248e944a9209909cf5 (patch)
tree30f57eededa62a390543b3a596d81006deb22384 /net/socket.c
parenta2dd3793a1c3ac709f1d7b48ad7751563f4c654f (diff)
new helper: msg_data_left()
convert open-coded instances Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c
index 21676e469b13..5b0126234606 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -612,7 +612,7 @@ EXPORT_SYMBOL(__sock_tx_timestamp);
612 612
613static inline int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg) 613static inline int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg)
614{ 614{
615 int ret = sock->ops->sendmsg(sock, msg, iov_iter_count(&msg->msg_iter)); 615 int ret = sock->ops->sendmsg(sock, msg, msg_data_left(msg));
616 BUG_ON(ret == -EIOCBQUEUED); 616 BUG_ON(ret == -EIOCBQUEUED);
617 return ret; 617 return ret;
618} 618}
@@ -620,7 +620,7 @@ static inline int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg)
620int sock_sendmsg(struct socket *sock, struct msghdr *msg) 620int sock_sendmsg(struct socket *sock, struct msghdr *msg)
621{ 621{
622 int err = security_socket_sendmsg(sock, msg, 622 int err = security_socket_sendmsg(sock, msg,
623 iov_iter_count(&msg->msg_iter)); 623 msg_data_left(msg));
624 624
625 return err ?: sock_sendmsg_nosec(sock, msg); 625 return err ?: sock_sendmsg_nosec(sock, msg);
626} 626}