mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Suggested-by: Al Viro <[email protected]> Signed-off-by: Ying Xue <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
39a0295f90
commit
1b78414047
75 changed files with 302 additions and 442 deletions
|
|
@ -441,8 +441,7 @@ static int rxrpc_connect(struct socket *sock, struct sockaddr *addr,
|
|||
* - sends a call data packet
|
||||
* - may send an abort (abort code in control data)
|
||||
*/
|
||||
static int rxrpc_sendmsg(struct kiocb *iocb, struct socket *sock,
|
||||
struct msghdr *m, size_t len)
|
||||
static int rxrpc_sendmsg(struct socket *sock, struct msghdr *m, size_t len)
|
||||
{
|
||||
struct rxrpc_transport *trans;
|
||||
struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
|
||||
|
|
@ -482,7 +481,7 @@ static int rxrpc_sendmsg(struct kiocb *iocb, struct socket *sock,
|
|||
switch (rx->sk.sk_state) {
|
||||
case RXRPC_SERVER_LISTENING:
|
||||
if (!m->msg_name) {
|
||||
ret = rxrpc_server_sendmsg(iocb, rx, m, len);
|
||||
ret = rxrpc_server_sendmsg(rx, m, len);
|
||||
break;
|
||||
}
|
||||
case RXRPC_SERVER_BOUND:
|
||||
|
|
@ -492,7 +491,7 @@ static int rxrpc_sendmsg(struct kiocb *iocb, struct socket *sock,
|
|||
break;
|
||||
}
|
||||
case RXRPC_CLIENT_CONNECTED:
|
||||
ret = rxrpc_client_sendmsg(iocb, rx, trans, m, len);
|
||||
ret = rxrpc_client_sendmsg(rx, trans, m, len);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTCONN;
|
||||
|
|
|
|||
|
|
@ -548,10 +548,9 @@ int rxrpc_get_server_data_key(struct rxrpc_connection *, const void *, time_t,
|
|||
extern unsigned rxrpc_resend_timeout;
|
||||
|
||||
int rxrpc_send_packet(struct rxrpc_transport *, struct sk_buff *);
|
||||
int rxrpc_client_sendmsg(struct kiocb *, struct rxrpc_sock *,
|
||||
struct rxrpc_transport *, struct msghdr *, size_t);
|
||||
int rxrpc_server_sendmsg(struct kiocb *, struct rxrpc_sock *, struct msghdr *,
|
||||
size_t);
|
||||
int rxrpc_client_sendmsg(struct rxrpc_sock *, struct rxrpc_transport *,
|
||||
struct msghdr *, size_t);
|
||||
int rxrpc_server_sendmsg(struct rxrpc_sock *, struct msghdr *, size_t);
|
||||
|
||||
/*
|
||||
* ar-peer.c
|
||||
|
|
@ -572,8 +571,7 @@ extern const struct file_operations rxrpc_connection_seq_fops;
|
|||
* ar-recvmsg.c
|
||||
*/
|
||||
void rxrpc_remove_user_ID(struct rxrpc_sock *, struct rxrpc_call *);
|
||||
int rxrpc_recvmsg(struct kiocb *, struct socket *, struct msghdr *, size_t,
|
||||
int);
|
||||
int rxrpc_recvmsg(struct socket *, struct msghdr *, size_t, int);
|
||||
|
||||
/*
|
||||
* ar-security.c
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@
|
|||
*/
|
||||
unsigned rxrpc_resend_timeout = 4 * HZ;
|
||||
|
||||
static int rxrpc_send_data(struct kiocb *iocb,
|
||||
struct rxrpc_sock *rx,
|
||||
static int rxrpc_send_data(struct rxrpc_sock *rx,
|
||||
struct rxrpc_call *call,
|
||||
struct msghdr *msg, size_t len);
|
||||
|
||||
|
|
@ -129,9 +128,8 @@ static void rxrpc_send_abort(struct rxrpc_call *call, u32 abort_code)
|
|||
* - caller holds the socket locked
|
||||
* - the socket may be either a client socket or a server socket
|
||||
*/
|
||||
int rxrpc_client_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx,
|
||||
struct rxrpc_transport *trans, struct msghdr *msg,
|
||||
size_t len)
|
||||
int rxrpc_client_sendmsg(struct rxrpc_sock *rx, struct rxrpc_transport *trans,
|
||||
struct msghdr *msg, size_t len)
|
||||
{
|
||||
struct rxrpc_conn_bundle *bundle;
|
||||
enum rxrpc_command cmd;
|
||||
|
|
@ -191,7 +189,7 @@ int rxrpc_client_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx,
|
|||
/* request phase complete for this client call */
|
||||
ret = -EPROTO;
|
||||
} else {
|
||||
ret = rxrpc_send_data(iocb, rx, call, msg, len);
|
||||
ret = rxrpc_send_data(rx, call, msg, len);
|
||||
}
|
||||
|
||||
rxrpc_put_call(call);
|
||||
|
|
@ -232,7 +230,7 @@ int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg,
|
|||
call->state != RXRPC_CALL_SERVER_SEND_REPLY) {
|
||||
ret = -EPROTO; /* request phase complete for this client call */
|
||||
} else {
|
||||
ret = rxrpc_send_data(NULL, call->socket, call, msg, len);
|
||||
ret = rxrpc_send_data(call->socket, call, msg, len);
|
||||
}
|
||||
|
||||
release_sock(&call->socket->sk);
|
||||
|
|
@ -271,8 +269,7 @@ EXPORT_SYMBOL(rxrpc_kernel_abort_call);
|
|||
* send a message through a server socket
|
||||
* - caller holds the socket locked
|
||||
*/
|
||||
int rxrpc_server_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx,
|
||||
struct msghdr *msg, size_t len)
|
||||
int rxrpc_server_sendmsg(struct rxrpc_sock *rx, struct msghdr *msg, size_t len)
|
||||
{
|
||||
enum rxrpc_command cmd;
|
||||
struct rxrpc_call *call;
|
||||
|
|
@ -313,7 +310,7 @@ int rxrpc_server_sendmsg(struct kiocb *iocb, struct rxrpc_sock *rx,
|
|||
break;
|
||||
}
|
||||
|
||||
ret = rxrpc_send_data(iocb, rx, call, msg, len);
|
||||
ret = rxrpc_send_data(rx, call, msg, len);
|
||||
break;
|
||||
|
||||
case RXRPC_CMD_SEND_ABORT:
|
||||
|
|
@ -520,8 +517,7 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
|
|||
* - must be called in process context
|
||||
* - caller holds the socket locked
|
||||
*/
|
||||
static int rxrpc_send_data(struct kiocb *iocb,
|
||||
struct rxrpc_sock *rx,
|
||||
static int rxrpc_send_data(struct rxrpc_sock *rx,
|
||||
struct rxrpc_call *call,
|
||||
struct msghdr *msg, size_t len)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ void rxrpc_remove_user_ID(struct rxrpc_sock *rx, struct rxrpc_call *call)
|
|||
* - we need to be careful about two or more threads calling recvmsg
|
||||
* simultaneously
|
||||
*/
|
||||
int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
|
||||
struct msghdr *msg, size_t len, int flags)
|
||||
int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
|
||||
int flags)
|
||||
{
|
||||
struct rxrpc_skb_priv *sp;
|
||||
struct rxrpc_call *call = NULL, *continue_call = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue