aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-09-24 00:26:31 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-09-23 08:56:31 -0400
commit3c1b27d5043086a485f8526353ae9fe37bfa1065 (patch)
treee3b6eda3c66bcd1fc3af6e7fa6e4e3af77459474 /drivers/block
parentf68d24082e22ccee3077d11aeb6dc5354f0ca7f1 (diff)
virtio: make add_buf return capacity remaining
This API change means that virtio_net can tell how much capacity remains for buffers. It's necessarily fuzzy, since VIRTIO_RING_F_INDIRECT_DESC means we can fit any number of descriptors in one, *if* we can kmalloc. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Dinesh Subhraveti <dineshs@us.ibm.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/virtio_blk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index aa1a3d5a3e2b..d739ee4201f9 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -139,7 +139,7 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
139 } 139 }
140 } 140 }
141 141
142 if (vblk->vq->vq_ops->add_buf(vblk->vq, vblk->sg, out, in, vbr)) { 142 if (vblk->vq->vq_ops->add_buf(vblk->vq, vblk->sg, out, in, vbr) < 0) {
143 mempool_free(vbr, vblk->pool); 143 mempool_free(vbr, vblk->pool);
144 return false; 144 return false;
145 } 145 }