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 /tools | |
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 'tools')
-rw-r--r-- | tools/virtio/linux/virtio.h | 21 | ||||
-rw-r--r-- | tools/virtio/virtio_test.c | 3 |
2 files changed, 8 insertions, 16 deletions
diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h index 953db2abf6b9..b4fbc91c41b4 100644 --- a/tools/virtio/linux/virtio.h +++ b/tools/virtio/linux/virtio.h | |||
@@ -186,21 +186,12 @@ struct virtqueue { | |||
186 | #endif | 186 | #endif |
187 | 187 | ||
188 | /* Interfaces exported by virtio_ring. */ | 188 | /* Interfaces exported by virtio_ring. */ |
189 | int virtqueue_add_buf_gfp(struct virtqueue *vq, | 189 | int virtqueue_add_buf(struct virtqueue *vq, |
190 | struct scatterlist sg[], | 190 | struct scatterlist sg[], |
191 | unsigned int out_num, | 191 | unsigned int out_num, |
192 | unsigned int in_num, | 192 | unsigned int in_num, |
193 | void *data, | 193 | void *data, |
194 | gfp_t gfp); | 194 | gfp_t gfp); |
195 | |||
196 | static inline int virtqueue_add_buf(struct virtqueue *vq, | ||
197 | struct scatterlist sg[], | ||
198 | unsigned int out_num, | ||
199 | unsigned int in_num, | ||
200 | void *data) | ||
201 | { | ||
202 | return virtqueue_add_buf_gfp(vq, sg, out_num, in_num, data, GFP_ATOMIC); | ||
203 | } | ||
204 | 195 | ||
205 | void virtqueue_kick(struct virtqueue *vq); | 196 | void virtqueue_kick(struct virtqueue *vq); |
206 | 197 | ||
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c index 0740284396c1..6bf95f995364 100644 --- a/tools/virtio/virtio_test.c +++ b/tools/virtio/virtio_test.c | |||
@@ -161,7 +161,8 @@ static void run_test(struct vdev_info *dev, struct vq_info *vq, int bufs) | |||
161 | if (started < bufs) { | 161 | if (started < bufs) { |
162 | sg_init_one(&sl, dev->buf, dev->buf_size); | 162 | sg_init_one(&sl, dev->buf, dev->buf_size); |
163 | r = virtqueue_add_buf(vq->vq, &sl, 1, 0, | 163 | r = virtqueue_add_buf(vq->vq, &sl, 1, 0, |
164 | dev->buf + started); | 164 | dev->buf + started, |
165 | GFP_ATOMIC); | ||
165 | if (likely(r >= 0)) { | 166 | if (likely(r >= 0)) { |
166 | ++started; | 167 | ++started; |
167 | virtqueue_kick(vq->vq); | 168 | virtqueue_kick(vq->vq); |