VHOST_ACCESS_WO);
if (ret < 0)
goto out;
- iov_iter_init(&t, WRITE, vq->iotlb_iov, ret, size);
+ iov_iter_init(&t, READ, vq->iotlb_iov, ret, size);
ret = copy_to_iter(from, size, &t);
if (ret == size)
ret = 0;
(unsigned long long) size);
goto out;
}
- iov_iter_init(&f, READ, vq->iotlb_iov, ret, size);
+ iov_iter_init(&f, WRITE, vq->iotlb_iov, ret, size);
ret = copy_from_iter(to, size, &f);
if (ret == size)
ret = 0;
vq_err(vq, "Translation failure %d in indirect.\n", ret);
return ret;
}
- iov_iter_init(&from, READ, vq->indirect, ret, len);
+ iov_iter_init(&from, WRITE, vq->indirect, ret, len);
count = len / sizeof desc;
/* Buffers are chained via a 16 bit next field, so
* we can have at most 2^16 of these. */
else if (ret < 0)
return ret;
- iov_iter_bvec(&iter, READ, iov, ret, translated);
+ iov_iter_bvec(&iter, WRITE, iov, ret, translated);
ret = copy_from_iter(dst, translated, &iter);
if (ret < 0)
else if (ret < 0)
return ret;
- iov_iter_bvec(&iter, WRITE, iov, ret, translated);
+ iov_iter_bvec(&iter, READ, iov, ret, translated);
ret = copy_to_iter(src, translated, &iter);
if (ret < 0)