diff options
| -rw-r--r-- | drivers/virtio/virtio_ring.c | 37 | ||||
| -rw-r--r-- | include/linux/virtio.h | 7 |
2 files changed, 3 insertions, 41 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 5217baf5528c..c70207478e57 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c | |||
| @@ -296,37 +296,6 @@ add_head: | |||
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | /** | 298 | /** |
| 299 | * virtqueue_add_buf - expose buffer to other end | ||
| 300 | * @vq: the struct virtqueue we're talking about. | ||
| 301 | * @sg: the description of the buffer(s). | ||
| 302 | * @out_num: the number of sg readable by other side | ||
| 303 | * @in_num: the number of sg which are writable (after readable ones) | ||
| 304 | * @data: the token identifying the buffer. | ||
| 305 | * @gfp: how to do memory allocations (if necessary). | ||
| 306 | * | ||
| 307 | * Caller must ensure we don't call this with other virtqueue operations | ||
| 308 | * at the same time (except where noted). | ||
| 309 | * | ||
| 310 | * Returns zero or a negative error (ie. ENOSPC, ENOMEM). | ||
| 311 | */ | ||
| 312 | int virtqueue_add_buf(struct virtqueue *_vq, | ||
| 313 | struct scatterlist sg[], | ||
| 314 | unsigned int out, | ||
| 315 | unsigned int in, | ||
| 316 | void *data, | ||
| 317 | gfp_t gfp) | ||
| 318 | { | ||
| 319 | struct scatterlist *sgs[2]; | ||
| 320 | |||
| 321 | sgs[0] = sg; | ||
| 322 | sgs[1] = sg + out; | ||
| 323 | |||
| 324 | return virtqueue_add(_vq, sgs, sg_next_arr, | ||
| 325 | out, in, out ? 1 : 0, in ? 1 : 0, data, gfp); | ||
| 326 | } | ||
| 327 | EXPORT_SYMBOL_GPL(virtqueue_add_buf); | ||
| 328 | |||
| 329 | /** | ||
| 330 | * virtqueue_add_sgs - expose buffers to other end | 299 | * virtqueue_add_sgs - expose buffers to other end |
| 331 | * @vq: the struct virtqueue we're talking about. | 300 | * @vq: the struct virtqueue we're talking about. |
| 332 | * @sgs: array of terminated scatterlists. | 301 | * @sgs: array of terminated scatterlists. |
| @@ -473,7 +442,7 @@ EXPORT_SYMBOL_GPL(virtqueue_notify); | |||
| 473 | * virtqueue_kick - update after add_buf | 442 | * virtqueue_kick - update after add_buf |
| 474 | * @vq: the struct virtqueue | 443 | * @vq: the struct virtqueue |
| 475 | * | 444 | * |
| 476 | * After one or more virtqueue_add_buf calls, invoke this to kick | 445 | * After one or more virtqueue_add_* calls, invoke this to kick |
| 477 | * the other side. | 446 | * the other side. |
| 478 | * | 447 | * |
| 479 | * Caller must ensure we don't call this with other virtqueue | 448 | * Caller must ensure we don't call this with other virtqueue |
| @@ -530,7 +499,7 @@ static inline bool more_used(const struct vring_virtqueue *vq) | |||
| 530 | * operations at the same time (except where noted). | 499 | * operations at the same time (except where noted). |
| 531 | * | 500 | * |
| 532 | * Returns NULL if there are no used buffers, or the "data" token | 501 | * Returns NULL if there are no used buffers, or the "data" token |
| 533 | * handed to virtqueue_add_buf(). | 502 | * handed to virtqueue_add_*(). |
| 534 | */ | 503 | */ |
| 535 | void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len) | 504 | void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len) |
| 536 | { | 505 | { |
| @@ -685,7 +654,7 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb_delayed); | |||
| 685 | * virtqueue_detach_unused_buf - detach first unused buffer | 654 | * virtqueue_detach_unused_buf - detach first unused buffer |
| 686 | * @vq: the struct virtqueue we're talking about. | 655 | * @vq: the struct virtqueue we're talking about. |
| 687 | * | 656 | * |
| 688 | * Returns NULL or the "data" token handed to virtqueue_add_buf(). | 657 | * Returns NULL or the "data" token handed to virtqueue_add_*(). |
| 689 | * This is not valid on an active queue; it is useful only for device | 658 | * This is not valid on an active queue; it is useful only for device |
| 690 | * shutdown. | 659 | * shutdown. |
| 691 | */ | 660 | */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 9ff8645b7e0b..e94c75ded111 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -34,13 +34,6 @@ struct virtqueue { | |||
| 34 | void *priv; | 34 | void *priv; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | int virtqueue_add_buf(struct virtqueue *vq, | ||
| 38 | struct scatterlist sg[], | ||
| 39 | unsigned int out_num, | ||
| 40 | unsigned int in_num, | ||
| 41 | void *data, | ||
| 42 | gfp_t gfp); | ||
| 43 | |||
| 44 | int virtqueue_add_outbuf(struct virtqueue *vq, | 37 | int virtqueue_add_outbuf(struct virtqueue *vq, |
| 45 | struct scatterlist sg[], unsigned int num, | 38 | struct scatterlist sg[], unsigned int num, |
| 46 | void *data, | 39 | void *data, |
