Commit 8af0afb2 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: iovec cleanups - rxrpc

rxrpc (low-level part of afs) switched to kernel_...msg(); it already was
using kvec instead of iovec.
parent 1a7d7787
...@@ -620,7 +620,6 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn, ...@@ -620,7 +620,6 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
struct rxrpc_message *msg) struct rxrpc_message *msg)
{ {
struct msghdr msghdr; struct msghdr msghdr;
mm_segment_t oldfs;
int ret; int ret;
_enter("%p{%d}", conn, ntohs(conn->addr.sin_port)); _enter("%p{%d}", conn, ntohs(conn->addr.sin_port));
...@@ -634,12 +633,6 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn, ...@@ -634,12 +633,6 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
/* set up the message to be transmitted */ /* set up the message to be transmitted */
msghdr.msg_name = &conn->addr; msghdr.msg_name = &conn->addr;
msghdr.msg_namelen = sizeof(conn->addr); msghdr.msg_namelen = sizeof(conn->addr);
/*
* the following is safe, since for compiler definitions of kvec and
* iovec are identical, yielding the same in-core layout and alignment
*/
msghdr.msg_iov = (struct iovec *)msg->data;
msghdr.msg_iovlen = msg->dcount;
msghdr.msg_control = NULL; msghdr.msg_control = NULL;
msghdr.msg_controllen = 0; msghdr.msg_controllen = 0;
msghdr.msg_flags = MSG_CONFIRM | MSG_DONTWAIT; msghdr.msg_flags = MSG_CONFIRM | MSG_DONTWAIT;
...@@ -651,15 +644,11 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn, ...@@ -651,15 +644,11 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
htons(conn->addr.sin_port)); htons(conn->addr.sin_port));
/* send the message */ /* send the message */
oldfs = get_fs(); ret = kernel_sendmsg(conn->trans->socket, &msghdr,
set_fs(KERNEL_DS); msg->data, msg->dcount, msg->dsize);
ret = sock_sendmsg(conn->trans->socket, &msghdr, msg->dsize);
set_fs(oldfs);
if (ret < 0) { if (ret < 0) {
msg->state = RXRPC_MSG_ERROR; msg->state = RXRPC_MSG_ERROR;
} } else {
else {
msg->state = RXRPC_MSG_SENT; msg->state = RXRPC_MSG_SENT;
ret = 0; ret = 0;
......
...@@ -612,7 +612,6 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans, ...@@ -612,7 +612,6 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
struct sockaddr_in sin; struct sockaddr_in sin;
struct msghdr msghdr; struct msghdr msghdr;
struct kvec iov[2]; struct kvec iov[2];
mm_segment_t oldfs;
uint32_t _error; uint32_t _error;
int len, ret; int len, ret;
...@@ -649,12 +648,6 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans, ...@@ -649,12 +648,6 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
msghdr.msg_name = &sin; msghdr.msg_name = &sin;
msghdr.msg_namelen = sizeof(sin); msghdr.msg_namelen = sizeof(sin);
/*
* the following is safe, since for compiler definitions of kvec and
* iovec are identical, yielding the same in-core layout and alignment
*/
msghdr.msg_iov = (struct iovec *)iov;
msghdr.msg_iovlen = 2;
msghdr.msg_control = NULL; msghdr.msg_control = NULL;
msghdr.msg_controllen = 0; msghdr.msg_controllen = 0;
msghdr.msg_flags = MSG_DONTWAIT; msghdr.msg_flags = MSG_DONTWAIT;
...@@ -666,10 +659,7 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans, ...@@ -666,10 +659,7 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
htons(sin.sin_port)); htons(sin.sin_port));
/* send the message */ /* send the message */
oldfs = get_fs(); ret = kernel_sendmsg(trans->socket, &msghdr, iov, 2, len);
set_fs(KERNEL_DS);
ret = sock_sendmsg(trans->socket, &msghdr, len);
set_fs(oldfs);
_leave(" = %d", ret); _leave(" = %d", ret);
return ret; return ret;
...@@ -688,7 +678,6 @@ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans) ...@@ -688,7 +678,6 @@ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans)
struct list_head connq, *_p; struct list_head connq, *_p;
struct errormsg emsg; struct errormsg emsg;
struct msghdr msg; struct msghdr msg;
mm_segment_t oldfs;
uint16_t port; uint16_t port;
int local, err; int local, err;
...@@ -700,17 +689,12 @@ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans) ...@@ -700,17 +689,12 @@ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans)
/* try and receive an error message */ /* try and receive an error message */
msg.msg_name = &sin; msg.msg_name = &sin;
msg.msg_namelen = sizeof(sin); msg.msg_namelen = sizeof(sin);
msg.msg_iov = NULL;
msg.msg_iovlen = 0;
msg.msg_control = &emsg; msg.msg_control = &emsg;
msg.msg_controllen = sizeof(emsg); msg.msg_controllen = sizeof(emsg);
msg.msg_flags = 0; msg.msg_flags = 0;
oldfs = get_fs(); err = kernel_recvmsg(trans->socket, &msg, NULL, 0, 0,
set_fs(KERNEL_DS);
err = sock_recvmsg(trans->socket, &msg, 0,
MSG_ERRQUEUE | MSG_DONTWAIT | MSG_TRUNC); MSG_ERRQUEUE | MSG_DONTWAIT | MSG_TRUNC);
set_fs(oldfs);
if (err == -EAGAIN) { if (err == -EAGAIN) {
_leave(""); _leave("");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment