virtio_ring: add new function virtqueue_is_broken()

Add new function virtqueue_is_broken(). Callers of virtqueue_get_buf()
should check for a broken queue.

Signed-off-by: Heinz Graalfs <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
This commit is contained in:
Heinz Graalfs 2013-10-29 09:40:19 +10:30 • committed by Rusty Russell
commit b3b32c9413
2 changed files with 10 additions and 0 deletions

View file

@ -851,4 +851,12 @@ unsigned int virtqueue_get_vring_size(struct virtqueue *_vq)
}
EXPORT_SYMBOL_GPL(virtqueue_get_vring_size);
bool virtqueue_is_broken(struct virtqueue *_vq)
{
struct vring_virtqueue *vq = to_vvq(_vq);
return vq->broken;
}
EXPORT_SYMBOL_GPL(virtqueue_is_broken);
MODULE_LICENSE("GPL");