Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: remove virtqueue_add_buf().

All users changed to virtqueue_add_sg() or virtqueue_add_outbuf/inbuf.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

+3 -41
+3 -34
drivers/virtio/virtio_ring.c
··· 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 299 * virtqueue_add_sgs - expose buffers to other end 331 300 * @vq: the struct virtqueue we're talking about. 332 301 * @sgs: array of terminated scatterlists. ··· 442 473 * virtqueue_kick - update after add_buf 443 474 * @vq: the struct virtqueue 444 475 * 445 - * After one or more virtqueue_add_buf calls, invoke this to kick 476 + * After one or more virtqueue_add_* calls, invoke this to kick 446 477 * the other side. 447 478 * 448 479 * Caller must ensure we don't call this with other virtqueue ··· 499 530 * operations at the same time (except where noted). 500 531 * 501 532 * Returns NULL if there are no used buffers, or the "data" token 502 - * handed to virtqueue_add_buf(). 533 + * handed to virtqueue_add_*(). 503 534 */ 504 535 void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len) 505 536 { ··· 654 685 * virtqueue_detach_unused_buf - detach first unused buffer 655 686 * @vq: the struct virtqueue we're talking about. 656 687 * 657 - * Returns NULL or the "data" token handed to virtqueue_add_buf(). 688 + * Returns NULL or the "data" token handed to virtqueue_add_*(). 658 689 * This is not valid on an active queue; it is useful only for device 659 690 * shutdown. 660 691 */
-7
include/linux/virtio.h
··· 34 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 37 int virtqueue_add_outbuf(struct virtqueue *vq, 45 38 struct scatterlist sg[], unsigned int num, 46 39 void *data,