diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-01-12 00:14:42 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-01-12 00:14:42 -0500 |
commit | f96fde41f7f9af6cf20f6a1919f5d9670f84d574 (patch) | |
tree | 14b8a0343b255989ac8ba0ea34e18dca419723df /drivers/char | |
parent | 5dfc17628d57f9e62043ed0cba03a6e3eb019a78 (diff) |
virtio: rename virtqueue_add_buf_gfp to virtqueue_add_buf
Remove wrapper functions. This makes the allocation type explicit in
all callers; I used GPF_KERNEL where it seemed obvious, left it at
GFP_ATOMIC otherwise.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/virtio-rng.c | 2 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index fd699ccecf5b..723725bbb96b 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -47,7 +47,7 @@ static void register_buffer(u8 *buf, size_t size) | |||
47 | sg_init_one(&sg, buf, size); | 47 | sg_init_one(&sg, buf, size); |
48 | 48 | ||
49 | /* There should always be room for one buffer. */ | 49 | /* There should always be room for one buffer. */ |
50 | if (virtqueue_add_buf(vq, &sg, 0, 1, buf) < 0) | 50 | if (virtqueue_add_buf(vq, &sg, 0, 1, buf, GFP_KERNEL) < 0) |
51 | BUG(); | 51 | BUG(); |
52 | 52 | ||
53 | virtqueue_kick(vq); | 53 | virtqueue_kick(vq); |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 8e3c46d67cb3..d1ae1492ee78 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -392,7 +392,7 @@ static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf) | |||
392 | 392 | ||
393 | sg_init_one(sg, buf->buf, buf->size); | 393 | sg_init_one(sg, buf->buf, buf->size); |
394 | 394 | ||
395 | ret = virtqueue_add_buf(vq, sg, 0, 1, buf); | 395 | ret = virtqueue_add_buf(vq, sg, 0, 1, buf, GFP_ATOMIC); |
396 | virtqueue_kick(vq); | 396 | virtqueue_kick(vq); |
397 | return ret; | 397 | return ret; |
398 | } | 398 | } |
@@ -457,7 +457,7 @@ static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id, | |||
457 | vq = portdev->c_ovq; | 457 | vq = portdev->c_ovq; |
458 | 458 | ||
459 | sg_init_one(sg, &cpkt, sizeof(cpkt)); | 459 | sg_init_one(sg, &cpkt, sizeof(cpkt)); |
460 | if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt) >= 0) { | 460 | if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) >= 0) { |
461 | virtqueue_kick(vq); | 461 | virtqueue_kick(vq); |
462 | while (!virtqueue_get_buf(vq, &len)) | 462 | while (!virtqueue_get_buf(vq, &len)) |
463 | cpu_relax(); | 463 | cpu_relax(); |
@@ -506,7 +506,7 @@ static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count, | |||
506 | reclaim_consumed_buffers(port); | 506 | reclaim_consumed_buffers(port); |
507 | 507 | ||
508 | sg_init_one(sg, in_buf, in_count); | 508 | sg_init_one(sg, in_buf, in_count); |
509 | ret = virtqueue_add_buf(out_vq, sg, 1, 0, in_buf); | 509 | ret = virtqueue_add_buf(out_vq, sg, 1, 0, in_buf, GFP_ATOMIC); |
510 | 510 | ||
511 | /* Tell Host to go! */ | 511 | /* Tell Host to go! */ |
512 | virtqueue_kick(out_vq); | 512 | virtqueue_kick(out_vq); |