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/net/virtio_net.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/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 76fe14efb2b5..6345a52194f9 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -370,7 +370,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp) | |||
370 | 370 | ||
371 | skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len); | 371 | skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len); |
372 | 372 | ||
373 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp); | 373 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 2, skb, gfp); |
374 | if (err < 0) | 374 | if (err < 0) |
375 | dev_kfree_skb(skb); | 375 | dev_kfree_skb(skb); |
376 | 376 | ||
@@ -415,8 +415,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp) | |||
415 | 415 | ||
416 | /* chain first in list head */ | 416 | /* chain first in list head */ |
417 | first->private = (unsigned long)list; | 417 | first->private = (unsigned long)list; |
418 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2, | 418 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2, |
419 | first, gfp); | 419 | first, gfp); |
420 | if (err < 0) | 420 | if (err < 0) |
421 | give_pages(vi, first); | 421 | give_pages(vi, first); |
422 | 422 | ||
@@ -434,7 +434,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp) | |||
434 | 434 | ||
435 | sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE); | 435 | sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE); |
436 | 436 | ||
437 | err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp); | 437 | err = virtqueue_add_buf(vi->rvq, vi->rx_sg, 0, 1, page, gfp); |
438 | if (err < 0) | 438 | if (err < 0) |
439 | give_pages(vi, page); | 439 | give_pages(vi, page); |
440 | 440 | ||
@@ -609,7 +609,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) | |||
609 | 609 | ||
610 | hdr->num_sg = skb_to_sgvec(skb, vi->tx_sg + 1, 0, skb->len) + 1; | 610 | hdr->num_sg = skb_to_sgvec(skb, vi->tx_sg + 1, 0, skb->len) + 1; |
611 | return virtqueue_add_buf(vi->svq, vi->tx_sg, hdr->num_sg, | 611 | return virtqueue_add_buf(vi->svq, vi->tx_sg, hdr->num_sg, |
612 | 0, skb); | 612 | 0, skb, GFP_ATOMIC); |
613 | } | 613 | } |
614 | 614 | ||
615 | static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) | 615 | static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) |
@@ -767,7 +767,7 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, | |||
767 | sg_set_buf(&sg[i + 1], sg_virt(s), s->length); | 767 | sg_set_buf(&sg[i + 1], sg_virt(s), s->length); |
768 | sg_set_buf(&sg[out + in - 1], &status, sizeof(status)); | 768 | sg_set_buf(&sg[out + in - 1], &status, sizeof(status)); |
769 | 769 | ||
770 | BUG_ON(virtqueue_add_buf(vi->cvq, sg, out, in, vi) < 0); | 770 | BUG_ON(virtqueue_add_buf(vi->cvq, sg, out, in, vi, GFP_ATOMIC) < 0); |
771 | 771 | ||
772 | virtqueue_kick(vi->cvq); | 772 | virtqueue_kick(vi->cvq); |
773 | 773 | ||