Commit fc02f337 authored by Al Viro's avatar Al Viro

[xen] fix "direction" argument of iov_iter_kvec()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent e3bf3df8
...@@ -129,13 +129,13 @@ static bool pvcalls_conn_back_read(void *opaque) ...@@ -129,13 +129,13 @@ static bool pvcalls_conn_back_read(void *opaque)
if (masked_prod < masked_cons) { if (masked_prod < masked_cons) {
vec[0].iov_base = data->in + masked_prod; vec[0].iov_base = data->in + masked_prod;
vec[0].iov_len = wanted; vec[0].iov_len = wanted;
iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, wanted); iov_iter_kvec(&msg.msg_iter, READ, vec, 1, wanted);
} else { } else {
vec[0].iov_base = data->in + masked_prod; vec[0].iov_base = data->in + masked_prod;
vec[0].iov_len = array_size - masked_prod; vec[0].iov_len = array_size - masked_prod;
vec[1].iov_base = data->in; vec[1].iov_base = data->in;
vec[1].iov_len = wanted - vec[0].iov_len; vec[1].iov_len = wanted - vec[0].iov_len;
iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, wanted); iov_iter_kvec(&msg.msg_iter, READ, vec, 2, wanted);
} }
atomic_set(&map->read, 0); atomic_set(&map->read, 0);
...@@ -188,13 +188,13 @@ static bool pvcalls_conn_back_write(struct sock_mapping *map) ...@@ -188,13 +188,13 @@ static bool pvcalls_conn_back_write(struct sock_mapping *map)
if (pvcalls_mask(prod, array_size) > pvcalls_mask(cons, array_size)) { if (pvcalls_mask(prod, array_size) > pvcalls_mask(cons, array_size)) {
vec[0].iov_base = data->out + pvcalls_mask(cons, array_size); vec[0].iov_base = data->out + pvcalls_mask(cons, array_size);
vec[0].iov_len = size; vec[0].iov_len = size;
iov_iter_kvec(&msg.msg_iter, READ, vec, 1, size); iov_iter_kvec(&msg.msg_iter, WRITE, vec, 1, size);
} else { } else {
vec[0].iov_base = data->out + pvcalls_mask(cons, array_size); vec[0].iov_base = data->out + pvcalls_mask(cons, array_size);
vec[0].iov_len = array_size - pvcalls_mask(cons, array_size); vec[0].iov_len = array_size - pvcalls_mask(cons, array_size);
vec[1].iov_base = data->out; vec[1].iov_base = data->out;
vec[1].iov_len = size - vec[0].iov_len; vec[1].iov_len = size - vec[0].iov_len;
iov_iter_kvec(&msg.msg_iter, READ, vec, 2, size); iov_iter_kvec(&msg.msg_iter, WRITE, vec, 2, size);
} }
atomic_set(&map->write, 0); atomic_set(&map->write, 0);
......
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