aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2015-03-02 02:37:48 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-02 13:06:31 -0500
commit1b784140474e4fc94281a49e96c67d29df0efbde (patch)
tree569e9813ae7ab79616849b117c6b50b3d6e4dabb /net/unix/af_unix.c
parent39a0295f901423e260a034ac7c3211ecaa9c2745 (diff)
net: Remove iocb argument from sendmsg and recvmsg
After TIPC doesn't depend on iocb argument in its internal implementations of sendmsg() and recvmsg() hooks defined in proto structure, no any user is using iocb argument in them at all now. Then we can drop the redundant iocb argument completely from kinds of implementations of both sendmsg() and recvmsg() in the entire networking stack. Cc: Christoph Hellwig <hch@lst.de> Suggested-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 526b6edab018..433f287ee548 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -516,20 +516,15 @@ static unsigned int unix_dgram_poll(struct file *, struct socket *,
516 poll_table *); 516 poll_table *);
517static int unix_ioctl(struct socket *, unsigned int, unsigned long); 517static int unix_ioctl(struct socket *, unsigned int, unsigned long);
518static int unix_shutdown(struct socket *, int); 518static int unix_shutdown(struct socket *, int);
519static int unix_stream_sendmsg(struct kiocb *, struct socket *, 519static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t);
520 struct msghdr *, size_t); 520static int unix_stream_recvmsg(struct socket *, struct msghdr *, size_t, int);
521static int unix_stream_recvmsg(struct kiocb *, struct socket *, 521static int unix_dgram_sendmsg(struct socket *, struct msghdr *, size_t);
522 struct msghdr *, size_t, int); 522static int unix_dgram_recvmsg(struct socket *, struct msghdr *, size_t, int);
523static int unix_dgram_sendmsg(struct kiocb *, struct socket *,
524 struct msghdr *, size_t);
525static int unix_dgram_recvmsg(struct kiocb *, struct socket *,
526 struct msghdr *, size_t, int);
527static int unix_dgram_connect(struct socket *, struct sockaddr *, 523static int unix_dgram_connect(struct socket *, struct sockaddr *,
528 int, int); 524 int, int);
529static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *, 525static int unix_seqpacket_sendmsg(struct socket *, struct msghdr *, size_t);
530 struct msghdr *, size_t); 526static int unix_seqpacket_recvmsg(struct socket *, struct msghdr *, size_t,
531static int unix_seqpacket_recvmsg(struct kiocb *, struct socket *, 527 int);
532 struct msghdr *, size_t, int);
533 528
534static int unix_set_peek_off(struct sock *sk, int val) 529static int unix_set_peek_off(struct sock *sk, int val)
535{ 530{
@@ -1442,8 +1437,8 @@ static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock,
1442 * Send AF_UNIX data. 1437 * Send AF_UNIX data.
1443 */ 1438 */
1444 1439
1445static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, 1440static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
1446 struct msghdr *msg, size_t len) 1441 size_t len)
1447{ 1442{
1448 struct sock *sk = sock->sk; 1443 struct sock *sk = sock->sk;
1449 struct net *net = sock_net(sk); 1444 struct net *net = sock_net(sk);
@@ -1622,8 +1617,8 @@ out:
1622 */ 1617 */
1623#define UNIX_SKB_FRAGS_SZ (PAGE_SIZE << get_order(32768)) 1618#define UNIX_SKB_FRAGS_SZ (PAGE_SIZE << get_order(32768))
1624 1619
1625static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, 1620static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
1626 struct msghdr *msg, size_t len) 1621 size_t len)
1627{ 1622{
1628 struct sock *sk = sock->sk; 1623 struct sock *sk = sock->sk;
1629 struct sock *other = NULL; 1624 struct sock *other = NULL;
@@ -1725,8 +1720,8 @@ out_err:
1725 return sent ? : err; 1720 return sent ? : err;
1726} 1721}
1727 1722
1728static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock, 1723static int unix_seqpacket_sendmsg(struct socket *sock, struct msghdr *msg,
1729 struct msghdr *msg, size_t len) 1724 size_t len)
1730{ 1725{
1731 int err; 1726 int err;
1732 struct sock *sk = sock->sk; 1727 struct sock *sk = sock->sk;
@@ -1741,19 +1736,18 @@ static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock,
1741 if (msg->msg_namelen) 1736 if (msg->msg_namelen)
1742 msg->msg_namelen = 0; 1737 msg->msg_namelen = 0;
1743 1738
1744 return unix_dgram_sendmsg(kiocb, sock, msg, len); 1739 return unix_dgram_sendmsg(sock, msg, len);
1745} 1740}
1746 1741
1747static int unix_seqpacket_recvmsg(struct kiocb *iocb, struct socket *sock, 1742static int unix_seqpacket_recvmsg(struct socket *sock, struct msghdr *msg,
1748 struct msghdr *msg, size_t size, 1743 size_t size, int flags)
1749 int flags)
1750{ 1744{
1751 struct sock *sk = sock->sk; 1745 struct sock *sk = sock->sk;
1752 1746
1753 if (sk->sk_state != TCP_ESTABLISHED) 1747 if (sk->sk_state != TCP_ESTABLISHED)
1754 return -ENOTCONN; 1748 return -ENOTCONN;
1755 1749
1756 return unix_dgram_recvmsg(iocb, sock, msg, size, flags); 1750 return unix_dgram_recvmsg(sock, msg, size, flags);
1757} 1751}
1758 1752
1759static void unix_copy_addr(struct msghdr *msg, struct sock *sk) 1753static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
@@ -1766,9 +1760,8 @@ static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
1766 } 1760 }
1767} 1761}
1768 1762
1769static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, 1763static int unix_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
1770 struct msghdr *msg, size_t size, 1764 size_t size, int flags)
1771 int flags)
1772{ 1765{
1773 struct scm_cookie scm; 1766 struct scm_cookie scm;
1774 struct sock *sk = sock->sk; 1767 struct sock *sk = sock->sk;
@@ -1900,9 +1893,8 @@ static unsigned int unix_skb_len(const struct sk_buff *skb)
1900 return skb->len - UNIXCB(skb).consumed; 1893 return skb->len - UNIXCB(skb).consumed;
1901} 1894}
1902 1895
1903static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, 1896static int unix_stream_recvmsg(struct socket *sock, struct msghdr *msg,
1904 struct msghdr *msg, size_t size, 1897 size_t size, int flags)
1905 int flags)
1906{ 1898{
1907 struct scm_cookie scm; 1899 struct scm_cookie scm;
1908 struct sock *sk = sock->sk; 1900 struct sock *sk = sock->sk;