diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 19:32:50 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-09 16:28:23 -0500 |
| commit | d838df2e5dcbb6ed4d82854869e9a30f9aeef6da (patch) | |
| tree | dd72df4d21aa997d830a80683b5afc80852f5a01 /drivers | |
| parent | 56c39fb67cdb665ae67fba4975f5e20e6614cda6 (diff) | |
vmci: propagate msghdr all way down to __qp_memcpy_from_queue()
... and switch it to memcpy_to_msg()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/misc/vmw_vmci/vmci_queue_pair.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index 1b7b303085d2..7aaaf51e1596 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/uio.h> | 27 | #include <linux/uio.h> |
| 28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
| 29 | #include <linux/vmalloc.h> | 29 | #include <linux/vmalloc.h> |
| 30 | #include <linux/skbuff.h> | ||
| 30 | 31 | ||
| 31 | #include "vmci_handle_array.h" | 32 | #include "vmci_handle_array.h" |
| 32 | #include "vmci_queue_pair.h" | 33 | #include "vmci_queue_pair.h" |
| @@ -429,11 +430,11 @@ static int __qp_memcpy_from_queue(void *dest, | |||
| 429 | to_copy = size - bytes_copied; | 430 | to_copy = size - bytes_copied; |
| 430 | 431 | ||
| 431 | if (is_iovec) { | 432 | if (is_iovec) { |
| 432 | struct iovec *iov = (struct iovec *)dest; | 433 | struct msghdr *msg = dest; |
| 433 | int err; | 434 | int err; |
| 434 | 435 | ||
| 435 | /* The iovec will track bytes_copied internally. */ | 436 | /* The iovec will track bytes_copied internally. */ |
| 436 | err = memcpy_toiovec(iov, (u8 *)va + page_offset, | 437 | err = memcpy_to_msg(msg, (u8 *)va + page_offset, |
| 437 | to_copy); | 438 | to_copy); |
| 438 | if (err != 0) { | 439 | if (err != 0) { |
| 439 | if (kernel_if->host) | 440 | if (kernel_if->host) |
| @@ -3264,13 +3265,13 @@ EXPORT_SYMBOL_GPL(vmci_qpair_enquev); | |||
| 3264 | * of bytes dequeued or < 0 on error. | 3265 | * of bytes dequeued or < 0 on error. |
| 3265 | */ | 3266 | */ |
| 3266 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, | 3267 | ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, |
| 3267 | void *iov, | 3268 | struct msghdr *msg, |
| 3268 | size_t iov_size, | 3269 | size_t iov_size, |
| 3269 | int buf_type) | 3270 | int buf_type) |
| 3270 | { | 3271 | { |
| 3271 | ssize_t result; | 3272 | ssize_t result; |
| 3272 | 3273 | ||
| 3273 | if (!qpair || !iov) | 3274 | if (!qpair) |
| 3274 | return VMCI_ERROR_INVALID_ARGS; | 3275 | return VMCI_ERROR_INVALID_ARGS; |
| 3275 | 3276 | ||
| 3276 | qp_lock(qpair); | 3277 | qp_lock(qpair); |
| @@ -3279,7 +3280,7 @@ ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, | |||
| 3279 | result = qp_dequeue_locked(qpair->produce_q, | 3280 | result = qp_dequeue_locked(qpair->produce_q, |
| 3280 | qpair->consume_q, | 3281 | qpair->consume_q, |
| 3281 | qpair->consume_q_size, | 3282 | qpair->consume_q_size, |
| 3282 | iov, iov_size, | 3283 | msg, iov_size, |
| 3283 | qp_memcpy_from_queue_iov, | 3284 | qp_memcpy_from_queue_iov, |
| 3284 | true); | 3285 | true); |
| 3285 | 3286 | ||
| @@ -3308,13 +3309,13 @@ EXPORT_SYMBOL_GPL(vmci_qpair_dequev); | |||
| 3308 | * of bytes peeked or < 0 on error. | 3309 | * of bytes peeked or < 0 on error. |
| 3309 | */ | 3310 | */ |
| 3310 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, | 3311 | ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, |
| 3311 | void *iov, | 3312 | struct msghdr *msg, |
| 3312 | size_t iov_size, | 3313 | size_t iov_size, |
| 3313 | int buf_type) | 3314 | int buf_type) |
| 3314 | { | 3315 | { |
| 3315 | ssize_t result; | 3316 | ssize_t result; |
| 3316 | 3317 | ||
| 3317 | if (!qpair || !iov) | 3318 | if (!qpair) |
| 3318 | return VMCI_ERROR_INVALID_ARGS; | 3319 | return VMCI_ERROR_INVALID_ARGS; |
| 3319 | 3320 | ||
| 3320 | qp_lock(qpair); | 3321 | qp_lock(qpair); |
| @@ -3323,7 +3324,7 @@ ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, | |||
| 3323 | result = qp_dequeue_locked(qpair->produce_q, | 3324 | result = qp_dequeue_locked(qpair->produce_q, |
| 3324 | qpair->consume_q, | 3325 | qpair->consume_q, |
| 3325 | qpair->consume_q_size, | 3326 | qpair->consume_q_size, |
| 3326 | iov, iov_size, | 3327 | msg, iov_size, |
| 3327 | qp_memcpy_from_queue_iov, | 3328 | qp_memcpy_from_queue_iov, |
| 3328 | false); | 3329 | false); |
| 3329 | 3330 | ||
