aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
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/rxrpc
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/rxrpc')
-rw-r--r--net/rxrpc/af_rxrpc.c7
-rw-r--r--net/rxrpc/ar-internal.h10
-rw-r--r--net/rxrpc/ar-output.c20
-rw-r--r--net/rxrpc/ar-recvmsg.c4
4 files changed, 17 insertions, 24 deletions
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index 7b1670489638..0095b9a0b779 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -441,8 +441,7 @@ static int rxrpc_connect(struct socket *sock, struct sockaddr *addr,
441 * - sends a call data packet 441 * - sends a call data packet
442 * - may send an abort (abort code in control data) 442 * - may send an abort (abort code in control data)
443 */ 443 */
444static int rxrpc_sendmsg(struct kiocb *iocb, struct socket *sock, 444static int rxrpc_sendmsg(struct socket *sock, struct msghdr *m, size_t len)
445 struct msghdr *m, size_t len)
446{ 445{
447 struct rxrpc_transport *trans; 446 struct rxrpc_transport *trans;
448 struct rxrpc_sock *rx = rxrpc_sk(sock->sk); 447 struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
@@ -482,7 +481,7 @@ static int rxrpc_sendmsg(struct kiocb *iocb, struct socket *sock,
482 switch (rx->sk.sk_state) { 481 switch (rx->sk.sk_state) {
483 case RXRPC_SERVER_LISTENING: 482 case RXRPC_SERVER_LISTENING:
484 if (!m->msg_name) { 483 if (!m->msg_name) {
485 ret = rxrpc_server_sendmsg(iocb, rx, m, len); 484 ret = rxrpc_server_sendmsg(rx, m, len);
486 break; 485 break;
487 } 486 }
488 case RXRPC_SERVER_BOUND: 487 case RXRPC_SERVER_BOUND:
@@ -492,7 +491,7 @@ static int rxrpc_sendmsg(struct kiocb *iocb, struct socket *sock,
492 break; 491 break;
493 } 492 }
494 case RXRPC_CLIENT_CONNECTED: 493 case RXRPC_CLIENT_CONNECTED:
495 ret = rxrpc_client_sendmsg(iocb, rx, trans, m, len); 494 ret = rxrpc_client_sendmsg(rx, trans, m, len);
496 break; 495 break;
497 default: 496 default:
498 ret = -ENOTCONN; 497 ret = -ENOTCONN;
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index ba9fd36d3f15..2fc1e659e5c9 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -548,10 +548,9 @@ int rxrpc_get_server_data_key(struct rxrpc_connection *, const void *, time_t,
548extern unsigned rxrpc_resend_timeout; 548extern unsigned rxrpc_resend_timeout;
549 549
550int rxrpc_send_packet(struct rxrpc_transport *, struct sk_buff *); 550int rxrpc_send_packet(struct rxrpc_transport *, struct sk_buff *);
551int rxrpc_client_sendmsg(struct kiocb *, struct rxrpc_sock *, 551int rxrpc_client_sendmsg(struct rxrpc_sock *, struct rxrpc_transport *,
552 struct rxrpc_transport *, struct msghdr *, size_t); 552 struct msghdr *, size_t);
553int rxrpc_server_sendmsg(struct kiocb *, struct rxrpc_sock *, struct msghdr *, 553int rxrpc_server_sendmsg(struct rxrpc_sock *, struct msghdr *, size_t);
554 size_t);
555 554
556/* 555/*
557 * ar-peer.c 556 * ar-peer.c
@@ -572,8 +571,7 @@ extern const struct file_operations rxrpc_connection_seq_fops;
572 * ar-recvmsg.c 571 * ar-recvmsg.c
573 */ 572 */
574void rxrpc_remove_user_ID(struct rxrpc_sock *, struct rxrpc_call *); 573void rxrpc_remove_user_ID(struct rxrpc_sock *, struct rxrpc_call *);
575int rxrpc_recvmsg(struct kiocb *, struct socket *, struct msghdr *, size_t, 574int rxrpc_recvmsg(struct socket *, struct msghdr *, size_t, int);
576 int);
577 575
578/* 576/*
579 * ar-security.c 577 * ar-security.c
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 8331c95e1522..09f584566e23 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -23,8 +23,7 @@
23 */ 23 */
24unsigned rxrpc_resend_timeout = 4 * HZ; 24unsigned rxrpc_resend_timeout = 4 * HZ;
25 25
26static int rxrpc_send_data(struct kiocb *iocb, 26static int rxrpc_send_data(struct rxrpc_sock *rx,
27 struct rxrpc_sock *rx,
28 struct rxrpc_call *call, 27 struct rxrpc_call *call,
29 struct msghdr *msg, size_t len); 28 struct msghdr *msg, size_t len);
30 29
@@ -129,9 +128,8 @@ static void rxrpc_send_abort(struct rxrpc_call *call, u32 abort_code)
129 * - caller holds the socket locked 128 * - caller holds the socket locked
130 * - the socket may be either a client socket or a server socket 129 * - the socket may be either a client socket or a server socket
131 */ 130 */
132int rxrpc_client_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx, 131int rxrpc_client_sendmsg(struct rxrpc_sock *rx, struct rxrpc_transport *trans,
133 struct rxrpc_transport *trans, struct msghdr *msg, 132 struct msghdr *msg, size_t len)
134 size_t len)
135{ 133{
136 struct rxrpc_conn_bundle *bundle; 134 struct rxrpc_conn_bundle *bundle;
137 enum rxrpc_command cmd; 135 enum rxrpc_command cmd;
@@ -191,7 +189,7 @@ int rxrpc_client_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx,
191 /* request phase complete for this client call */ 189 /* request phase complete for this client call */
192 ret = -EPROTO; 190 ret = -EPROTO;
193 } else { 191 } else {
194 ret = rxrpc_send_data(iocb, rx, call, msg, len); 192 ret = rxrpc_send_data(rx, call, msg, len);
195 } 193 }
196 194
197 rxrpc_put_call(call); 195 rxrpc_put_call(call);
@@ -232,7 +230,7 @@ int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg,
232 call->state != RXRPC_CALL_SERVER_SEND_REPLY) { 230 call->state != RXRPC_CALL_SERVER_SEND_REPLY) {
233 ret = -EPROTO; /* request phase complete for this client call */ 231 ret = -EPROTO; /* request phase complete for this client call */
234 } else { 232 } else {
235 ret = rxrpc_send_data(NULL, call->socket, call, msg, len); 233 ret = rxrpc_send_data(call->socket, call, msg, len);
236 } 234 }
237 235
238 release_sock(&call->socket->sk); 236 release_sock(&call->socket->sk);
@@ -271,8 +269,7 @@ EXPORT_SYMBOL(rxrpc_kernel_abort_call);
271 * send a message through a server socket 269 * send a message through a server socket
272 * - caller holds the socket locked 270 * - caller holds the socket locked
273 */ 271 */
274int rxrpc_server_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx, 272int rxrpc_server_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
275 struct msghdr *msg, size_t len)
276{ 273{
277 enum rxrpc_command cmd; 274 enum rxrpc_command cmd;
278 struct rxrpc_call *call; 275 struct rxrpc_call *call;
@@ -313,7 +310,7 @@ int rxrpc_server_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx,
313 break; 310 break;
314 } 311 }
315 312
316 ret = rxrpc_send_data(iocb, rx, call, msg, len); 313 ret = rxrpc_send_data(rx, call, msg, len);
317 break; 314 break;
318 315
319 case RXRPC_CMD_SEND_ABORT: 316 case RXRPC_CMD_SEND_ABORT:
@@ -520,8 +517,7 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
520 * - must be called in process context 517 * - must be called in process context
521 * - caller holds the socket locked 518 * - caller holds the socket locked
522 */ 519 */
523static int rxrpc_send_data(struct kiocb *iocb, 520static int rxrpc_send_data(struct rxrpc_sock *rx,
524 struct rxrpc_sock *rx,
525 struct rxrpc_call *call, 521 struct rxrpc_call *call,
526 struct msghdr *msg, size_t len) 522 struct msghdr *msg, size_t len)
527{ 523{
diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c
index d58ba702bd2c..a4f883e2d66f 100644
--- a/net/rxrpc/ar-recvmsg.c
+++ b/net/rxrpc/ar-recvmsg.c
@@ -43,8 +43,8 @@ void rxrpc_remove_user_ID(struct rxrpc_sock *rx, struct rxrpc_call *call)
43 * - we need to be careful about two or more threads calling recvmsg 43 * - we need to be careful about two or more threads calling recvmsg
44 * simultaneously 44 * simultaneously
45 */ 45 */
46int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock, 46int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
47 struct msghdr *msg, size_t len, int flags) 47 int flags)
48{ 48{
49 struct rxrpc_skb_priv *sp; 49 struct rxrpc_skb_priv *sp;
50 struct rxrpc_call *call = NULL, *continue_call = NULL; 50 struct rxrpc_call *call = NULL, *continue_call = NULL;