*/
down_read(&ring->blkif->vbd_lock);
- if (likely(valid_req)) {
- switch (req.operation) {
- case BLKIF_OP_READ:
- case BLKIF_OP_WRITE:
- case BLKIF_OP_WRITE_BARRIER:
- case BLKIF_OP_FLUSH_DISKCACHE:
- case BLKIF_OP_INDIRECT:
- if (dispatch_rw_block_io(ring, &req, pending_req))
- goto done;
- break;
- case BLKIF_OP_DISCARD:
- if (dispatch_discard_io(ring, &req))
- goto done;
- break;
- default:
- BUG();
- }
- } else {
+ if (unlikely(!valid_req)) {
+ if (dispatch_other_io(ring, &req))
+ goto done;
+ }
+
+ switch (req.operation) {
+ case BLKIF_OP_READ:
+ case BLKIF_OP_WRITE:
+ case BLKIF_OP_WRITE_BARRIER:
+ case BLKIF_OP_FLUSH_DISKCACHE:
+ case BLKIF_OP_INDIRECT:
+ if (dispatch_rw_block_io(ring, &req, pending_req))
+ goto done;
+ break;
+ case BLKIF_OP_DISCARD:
+ if (dispatch_discard_io(ring, &req))
+ goto done;
+ break;
+ default:
if (dispatch_other_io(ring, &req))
goto done;
+ break;
}
/* Yield point for this unbounded loop. */