aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>2004-07-12 21:00:06 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-12 21:00:06 -0700
commit7b091e0254ff3c5b44b2e5af2142d094414af45e (patch)
tree634d35f93b9394967fa04dfbd558bf42b5acf75d /net
parent0c4fb9bf2efb7fe20891946240912725fb117fee (diff)
downloadhistory-7b091e0254ff3c5b44b2e5af2142d094414af45e.tar.gz
[PATCH] sparse: switching afs to kvec
- afs and rxrpc switched to kvec; definition of kvec moved to uio.h (duh). - afs/mntpt.c got missing cast added. at that point afs is sparse-clean and rxrpc has only one remaining warning (setsockopt from local variable, protected by set_fs()).
Diffstat (limited to 'net')
-rw-r--r--net/rxrpc/call.c10
-rw-r--r--net/rxrpc/connection.c8
-rw-r--r--net/rxrpc/transport.c8
3 files changed, 17 insertions, 9 deletions
diff --git a/net/rxrpc/call.c b/net/rxrpc/call.c
index f95617a5970843..6c87fcaeca6a09 100644
--- a/net/rxrpc/call.c
+++ b/net/rxrpc/call.c
@@ -471,7 +471,7 @@ static inline int __rxrpc_call_gen_normal_ACK(struct rxrpc_call *call,
rxrpc_seq_t seq)
{
struct rxrpc_message *msg;
- struct iovec diov[3];
+ struct kvec diov[3];
unsigned aux[4];
int delta, ret;
@@ -717,7 +717,7 @@ static int rxrpc_call_generate_ACK(struct rxrpc_call *call,
/* send a special ACK if one is required */
if (special_ACK) {
struct rxrpc_ackpacket ack;
- struct iovec diov[2];
+ struct kvec diov[2];
uint8_t acks[1] = { RXRPC_ACK_TYPE_ACK };
/* fill out the appropriate form */
@@ -838,7 +838,7 @@ static int __rxrpc_call_abort(struct rxrpc_call *call, int errno)
{
struct rxrpc_connection *conn = call->conn;
struct rxrpc_message *msg;
- struct iovec diov[1];
+ struct kvec diov[1];
int ret;
u32 _error;
@@ -1919,14 +1919,14 @@ int rxrpc_call_read_data(struct rxrpc_call *call,
*/
int rxrpc_call_write_data(struct rxrpc_call *call,
size_t sioc,
- struct iovec siov[],
+ struct kvec *siov,
u8 rxhdr_flags,
int alloc_flags,
int dup_data,
size_t *size_sent)
{
struct rxrpc_message *msg;
- struct iovec *sptr;
+ struct kvec *sptr;
size_t space, size, chunk, tmp;
char *buf;
int ret;
diff --git a/net/rxrpc/connection.c b/net/rxrpc/connection.c
index a923806d63f04d..11c703bc695631 100644
--- a/net/rxrpc/connection.c
+++ b/net/rxrpc/connection.c
@@ -518,7 +518,7 @@ int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
struct rxrpc_call *call,
uint8_t type,
int dcount,
- struct iovec diov[],
+ struct kvec diov[],
int alloc_flags,
struct rxrpc_message **_msg)
{
@@ -634,7 +634,11 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
/* set up the message to be transmitted */
msghdr.msg_name = &conn->addr;
msghdr.msg_namelen = sizeof(conn->addr);
- msghdr.msg_iov = msg->data;
+ /*
+ * 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;
diff --git a/net/rxrpc/transport.c b/net/rxrpc/transport.c
index 4454c5938014b8..92bcf9bf41452d 100644
--- a/net/rxrpc/transport.c
+++ b/net/rxrpc/transport.c
@@ -611,7 +611,7 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
struct rxrpc_header ahdr;
struct sockaddr_in sin;
struct msghdr msghdr;
- struct iovec iov[2];
+ struct kvec iov[2];
mm_segment_t oldfs;
uint32_t _error;
int len, ret;
@@ -649,7 +649,11 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
msghdr.msg_name = &sin;
msghdr.msg_namelen = sizeof(sin);
- msghdr.msg_iov = iov;
+ /*
+ * 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;