struct rxrpc_message *msg)
{
struct msghdr msghdr;
- mm_segment_t oldfs;
int ret;
_enter("%p{%d}", conn, ntohs(conn->addr.sin_port));
/* set up the message to be transmitted */
msghdr.msg_name = &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_controllen = 0;
msghdr.msg_flags = MSG_CONFIRM | MSG_DONTWAIT;
htons(conn->addr.sin_port));
/* send the message */
- oldfs = get_fs();
- set_fs(KERNEL_DS);
- ret = sock_sendmsg(conn->trans->socket, &msghdr, msg->dsize);
- set_fs(oldfs);
-
+ ret = kernel_sendmsg(conn->trans->socket, &msghdr,
+ msg->data, msg->dcount, msg->dsize);
if (ret < 0) {
msg->state = RXRPC_MSG_ERROR;
- }
- else {
+ } else {
msg->state = RXRPC_MSG_SENT;
ret = 0;
struct sockaddr_in sin;
struct msghdr msghdr;
struct kvec iov[2];
- mm_segment_t oldfs;
uint32_t _error;
int len, ret;
msghdr.msg_name = &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_controllen = 0;
msghdr.msg_flags = MSG_DONTWAIT;
htons(sin.sin_port));
/* send the message */
- oldfs = get_fs();
- set_fs(KERNEL_DS);
- ret = sock_sendmsg(trans->socket, &msghdr, len);
- set_fs(oldfs);
+ ret = kernel_sendmsg(trans->socket, &msghdr, iov, 2, len);
_leave(" = %d", ret);
return ret;
struct list_head connq, *_p;
struct errormsg emsg;
struct msghdr msg;
- mm_segment_t oldfs;
uint16_t port;
int local, err;
/* try and receive an error message */
msg.msg_name = &sin;
msg.msg_namelen = sizeof(sin);
- msg.msg_iov = NULL;
- msg.msg_iovlen = 0;
msg.msg_control = &emsg;
msg.msg_controllen = sizeof(emsg);
msg.msg_flags = 0;
- oldfs = get_fs();
- set_fs(KERNEL_DS);
- err = sock_recvmsg(trans->socket, &msg, 0,
+ err = kernel_recvmsg(trans->socket, &msg, NULL, 0, 0,
MSG_ERRQUEUE | MSG_DONTWAIT | MSG_TRUNC);
- set_fs(oldfs);
if (err == -EAGAIN) {
_leave("");