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/virtio/virtio_ring.c | |
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/virtio/virtio_ring.c')
-rw-r--r-- | drivers/virtio/virtio_ring.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index fe50486341a4..6ea92a6d1134 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c | |||
@@ -167,7 +167,7 @@ static int vring_add_indirect(struct vring_virtqueue *vq, | |||
167 | } | 167 | } |
168 | 168 | ||
169 | /** | 169 | /** |
170 | * virtqueue_add_buf_gfp - expose buffer to other end | 170 | * virtqueue_add_buf - expose buffer to other end |
171 | * @vq: the struct virtqueue we're talking about. | 171 | * @vq: the struct virtqueue we're talking about. |
172 | * @sg: the description of the buffer(s). | 172 | * @sg: the description of the buffer(s). |
173 | * @out_num: the number of sg readable by other side | 173 | * @out_num: the number of sg readable by other side |
@@ -183,12 +183,12 @@ static int vring_add_indirect(struct vring_virtqueue *vq, | |||
183 | * positive return values as "available": indirect buffers mean that | 183 | * positive return values as "available": indirect buffers mean that |
184 | * we can put an entire sg[] array inside a single queue entry. | 184 | * we can put an entire sg[] array inside a single queue entry. |
185 | */ | 185 | */ |
186 | int virtqueue_add_buf_gfp(struct virtqueue *_vq, | 186 | int virtqueue_add_buf(struct virtqueue *_vq, |
187 | struct scatterlist sg[], | 187 | struct scatterlist sg[], |
188 | unsigned int out, | 188 | unsigned int out, |
189 | unsigned int in, | 189 | unsigned int in, |
190 | void *data, | 190 | void *data, |
191 | gfp_t gfp) | 191 | gfp_t gfp) |
192 | { | 192 | { |
193 | struct vring_virtqueue *vq = to_vvq(_vq); | 193 | struct vring_virtqueue *vq = to_vvq(_vq); |
194 | unsigned int i, avail, uninitialized_var(prev); | 194 | unsigned int i, avail, uninitialized_var(prev); |
@@ -259,13 +259,13 @@ add_head: | |||
259 | 259 | ||
260 | return vq->num_free; | 260 | return vq->num_free; |
261 | } | 261 | } |
262 | EXPORT_SYMBOL_GPL(virtqueue_add_buf_gfp); | 262 | EXPORT_SYMBOL_GPL(virtqueue_add_buf); |
263 | 263 | ||
264 | /** | 264 | /** |
265 | * virtqueue_kick - update after add_buf | 265 | * virtqueue_kick - update after add_buf |
266 | * @vq: the struct virtqueue | 266 | * @vq: the struct virtqueue |
267 | * | 267 | * |
268 | * After one or more virtqueue_add_buf_gfp calls, invoke this to kick | 268 | * After one or more virtqueue_add_buf calls, invoke this to kick |
269 | * the other side. | 269 | * the other side. |
270 | * | 270 | * |
271 | * Caller must ensure we don't call this with other virtqueue | 271 | * Caller must ensure we don't call this with other virtqueue |
@@ -341,7 +341,7 @@ static inline bool more_used(const struct vring_virtqueue *vq) | |||
341 | * operations at the same time (except where noted). | 341 | * operations at the same time (except where noted). |
342 | * | 342 | * |
343 | * Returns NULL if there are no used buffers, or the "data" token | 343 | * Returns NULL if there are no used buffers, or the "data" token |
344 | * handed to virtqueue_add_buf_gfp(). | 344 | * handed to virtqueue_add_buf(). |
345 | */ | 345 | */ |
346 | void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len) | 346 | void *virtqueue_get_buf(struct virtqueue *_vq, unsigned int *len) |
347 | { | 347 | { |
@@ -490,7 +490,7 @@ EXPORT_SYMBOL_GPL(virtqueue_enable_cb_delayed); | |||
490 | * virtqueue_detach_unused_buf - detach first unused buffer | 490 | * virtqueue_detach_unused_buf - detach first unused buffer |
491 | * @vq: the struct virtqueue we're talking about. | 491 | * @vq: the struct virtqueue we're talking about. |
492 | * | 492 | * |
493 | * Returns NULL or the "data" token handed to virtqueue_add_buf_gfp(). | 493 | * Returns NULL or the "data" token handed to virtqueue_add_buf(). |
494 | * This is not valid on an active queue; it is useful only for device | 494 | * This is not valid on an active queue; it is useful only for device |
495 | * shutdown. | 495 | * shutdown. |
496 | */ | 496 | */ |