aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.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/tipc/socket.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/tipc/socket.c')
-rw-r--r--net/tipc/socket.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index c245ec31fa4c..dcb797c60806 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -895,7 +895,6 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p)
895 895
896/** 896/**
897 * tipc_sendmsg - send message in connectionless manner 897 * tipc_sendmsg - send message in connectionless manner
898 * @iocb: if NULL, indicates that socket lock is already held
899 * @sock: socket structure 898 * @sock: socket structure
900 * @m: message to send 899 * @m: message to send
901 * @dsz: amount of user data to be sent 900 * @dsz: amount of user data to be sent
@@ -907,7 +906,7 @@ static int tipc_wait_for_sndmsg(struct socket *sock, long *timeo_p)
907 * 906 *
908 * Returns the number of bytes sent on success, or errno otherwise 907 * Returns the number of bytes sent on success, or errno otherwise
909 */ 908 */
910static int tipc_sendmsg(struct kiocb *iocb, struct socket *sock, 909static int tipc_sendmsg(struct socket *sock,
911 struct msghdr *m, size_t dsz) 910 struct msghdr *m, size_t dsz)
912{ 911{
913 struct sock *sk = sock->sk; 912 struct sock *sk = sock->sk;
@@ -1052,7 +1051,6 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p)
1052 1051
1053/** 1052/**
1054 * tipc_send_stream - send stream-oriented data 1053 * tipc_send_stream - send stream-oriented data
1055 * @iocb: (unused)
1056 * @sock: socket structure 1054 * @sock: socket structure
1057 * @m: data to send 1055 * @m: data to send
1058 * @dsz: total length of data to be transmitted 1056 * @dsz: total length of data to be transmitted
@@ -1062,8 +1060,7 @@ static int tipc_wait_for_sndpkt(struct socket *sock, long *timeo_p)
1062 * Returns the number of bytes sent on success (or partial success), 1060 * Returns the number of bytes sent on success (or partial success),
1063 * or errno if no data sent 1061 * or errno if no data sent
1064 */ 1062 */
1065static int tipc_send_stream(struct kiocb *iocb, struct socket *sock, 1063static int tipc_send_stream(struct socket *sock, struct msghdr *m, size_t dsz)
1066 struct msghdr *m, size_t dsz)
1067{ 1064{
1068 struct sock *sk = sock->sk; 1065 struct sock *sk = sock->sk;
1069 int ret; 1066 int ret;
@@ -1147,7 +1144,6 @@ next:
1147 1144
1148/** 1145/**
1149 * tipc_send_packet - send a connection-oriented message 1146 * tipc_send_packet - send a connection-oriented message
1150 * @iocb: if NULL, indicates that socket lock is already held
1151 * @sock: socket structure 1147 * @sock: socket structure
1152 * @m: message to send 1148 * @m: message to send
1153 * @dsz: length of data to be transmitted 1149 * @dsz: length of data to be transmitted
@@ -1156,13 +1152,12 @@ next:
1156 * 1152 *
1157 * Returns the number of bytes sent on success, or errno otherwise 1153 * Returns the number of bytes sent on success, or errno otherwise
1158 */ 1154 */
1159static int tipc_send_packet(struct kiocb *iocb, struct socket *sock, 1155static int tipc_send_packet(struct socket *sock, struct msghdr *m, size_t dsz)
1160 struct msghdr *m, size_t dsz)
1161{ 1156{
1162 if (dsz > TIPC_MAX_USER_MSG_SIZE) 1157 if (dsz > TIPC_MAX_USER_MSG_SIZE)
1163 return -EMSGSIZE; 1158 return -EMSGSIZE;
1164 1159
1165 return tipc_send_stream(iocb, sock, m, dsz); 1160 return tipc_send_stream(sock, m, dsz);
1166} 1161}
1167 1162
1168/* tipc_sk_finish_conn - complete the setup of a connection 1163/* tipc_sk_finish_conn - complete the setup of a connection
@@ -1337,7 +1332,6 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop)
1337 1332
1338/** 1333/**
1339 * tipc_recvmsg - receive packet-oriented message 1334 * tipc_recvmsg - receive packet-oriented message
1340 * @iocb: (unused)
1341 * @m: descriptor for message info 1335 * @m: descriptor for message info
1342 * @buf_len: total size of user buffer area 1336 * @buf_len: total size of user buffer area
1343 * @flags: receive flags 1337 * @flags: receive flags
@@ -1347,8 +1341,8 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop)
1347 * 1341 *
1348 * Returns size of returned message data, errno otherwise 1342 * Returns size of returned message data, errno otherwise
1349 */ 1343 */
1350static int tipc_recvmsg(struct kiocb *iocb, struct socket *sock, 1344static int tipc_recvmsg(struct socket *sock, struct msghdr *m, size_t buf_len,
1351 struct msghdr *m, size_t buf_len, int flags) 1345 int flags)
1352{ 1346{
1353 struct sock *sk = sock->sk; 1347 struct sock *sk = sock->sk;
1354 struct tipc_sock *tsk = tipc_sk(sk); 1348 struct tipc_sock *tsk = tipc_sk(sk);
@@ -1432,7 +1426,6 @@ exit:
1432 1426
1433/** 1427/**
1434 * tipc_recv_stream - receive stream-oriented data 1428 * tipc_recv_stream - receive stream-oriented data
1435 * @iocb: (unused)
1436 * @m: descriptor for message info 1429 * @m: descriptor for message info
1437 * @buf_len: total size of user buffer area 1430 * @buf_len: total size of user buffer area
1438 * @flags: receive flags 1431 * @flags: receive flags
@@ -1442,8 +1435,8 @@ exit:
1442 * 1435 *
1443 * Returns size of returned message data, errno otherwise 1436 * Returns size of returned message data, errno otherwise
1444 */ 1437 */
1445static int tipc_recv_stream(struct kiocb *iocb, struct socket *sock, 1438static int tipc_recv_stream(struct socket *sock, struct msghdr *m,
1446 struct msghdr *m, size_t buf_len, int flags) 1439 size_t buf_len, int flags)
1447{ 1440{
1448 struct sock *sk = sock->sk; 1441 struct sock *sk = sock->sk;
1449 struct tipc_sock *tsk = tipc_sk(sk); 1442 struct tipc_sock *tsk = tipc_sk(sk);