aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkback/blkback.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/xen-blkback/blkback.c')
-rw-r--r--drivers/block/xen-blkback/blkback.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 15ec4db194d1..d7104abc8b72 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -362,7 +362,7 @@ static int xen_blkbk_map(struct blkif_request *req,
362{ 362{
363 struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 363 struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST];
364 int i; 364 int i;
365 int nseg = req->nr_segments; 365 int nseg = req->u.rw.nr_segments;
366 int ret = 0; 366 int ret = 0;
367 367
368 /* 368 /*
@@ -449,7 +449,7 @@ static void xen_blk_discard(struct xen_blkif *blkif, struct blkif_request *req)
449 } else if (err) 449 } else if (err)
450 status = BLKIF_RSP_ERROR; 450 status = BLKIF_RSP_ERROR;
451 451
452 make_response(blkif, req->id, req->operation, status); 452 make_response(blkif, req->u.discard.id, req->operation, status);
453} 453}
454 454
455static void xen_blk_drain_io(struct xen_blkif *blkif) 455static void xen_blk_drain_io(struct xen_blkif *blkif)
@@ -644,7 +644,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
644 } 644 }
645 645
646 /* Check that the number of segments is sane. */ 646 /* Check that the number of segments is sane. */
647 nseg = req->nr_segments; 647 nseg = req->u.rw.nr_segments;
648
648 if (unlikely(nseg == 0 && operation != WRITE_FLUSH && 649 if (unlikely(nseg == 0 && operation != WRITE_FLUSH &&
649 operation != REQ_DISCARD) || 650 operation != REQ_DISCARD) ||
650 unlikely(nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) { 651 unlikely(nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) {
@@ -654,12 +655,12 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
654 goto fail_response; 655 goto fail_response;
655 } 656 }
656 657
657 preq.dev = req->handle; 658 preq.dev = req->u.rw.handle;
658 preq.sector_number = req->u.rw.sector_number; 659 preq.sector_number = req->u.rw.sector_number;
659 preq.nr_sects = 0; 660 preq.nr_sects = 0;
660 661
661 pending_req->blkif = blkif; 662 pending_req->blkif = blkif;
662 pending_req->id = req->id; 663 pending_req->id = req->u.rw.id;
663 pending_req->operation = req->operation; 664 pending_req->operation = req->operation;
664 pending_req->status = BLKIF_RSP_OKAY; 665 pending_req->status = BLKIF_RSP_OKAY;
665 pending_req->nr_pages = nseg; 666 pending_req->nr_pages = nseg;
@@ -784,7 +785,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
784 xen_blkbk_unmap(pending_req); 785 xen_blkbk_unmap(pending_req);
785 fail_response: 786 fail_response:
786 /* Haven't submitted any bio's yet. */ 787 /* Haven't submitted any bio's yet. */
787 make_response(blkif, req->id, req->operation, BLKIF_RSP_ERROR); 788 make_response(blkif, req->u.rw.id, req->operation, BLKIF_RSP_ERROR);
788 free_req(pending_req); 789 free_req(pending_req);
789 msleep(1); /* back off a bit */ 790 msleep(1); /* back off a bit */
790 return -EIO; 791 return -EIO;