diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/xen-blkback/blkback.c | 9 | ||||
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 2 | ||||
-rw-r--r-- | drivers/block/xen-blkfront.c | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index d7dd5cbdac5f..a05961683efa 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
@@ -512,7 +512,7 @@ static int xen_blkbk_map(struct blkif_request *req, | |||
512 | * not mapped but we have room for it | 512 | * not mapped but we have room for it |
513 | */ | 513 | */ |
514 | new_map = true; | 514 | new_map = true; |
515 | persistent_gnt = kzalloc( | 515 | persistent_gnt = kmalloc( |
516 | sizeof(struct persistent_gnt), | 516 | sizeof(struct persistent_gnt), |
517 | GFP_KERNEL); | 517 | GFP_KERNEL); |
518 | if (!persistent_gnt) | 518 | if (!persistent_gnt) |
@@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req, | |||
523 | return -ENOMEM; | 523 | return -ENOMEM; |
524 | } | 524 | } |
525 | persistent_gnt->gnt = req->u.rw.seg[i].gref; | 525 | persistent_gnt->gnt = req->u.rw.seg[i].gref; |
526 | persistent_gnt->handle = BLKBACK_INVALID_HANDLE; | ||
526 | 527 | ||
527 | pages_to_gnt[segs_to_map] = | 528 | pages_to_gnt[segs_to_map] = |
528 | persistent_gnt->page; | 529 | persistent_gnt->page; |
@@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req, | |||
584 | */ | 585 | */ |
585 | bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST); | 586 | bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST); |
586 | for (i = 0, j = 0; i < nseg; i++) { | 587 | for (i = 0, j = 0; i < nseg; i++) { |
587 | if (!persistent_gnts[i] || !persistent_gnts[i]->handle) { | 588 | if (!persistent_gnts[i] || |
589 | persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) { | ||
588 | /* This is a newly mapped grant */ | 590 | /* This is a newly mapped grant */ |
589 | BUG_ON(j >= segs_to_map); | 591 | BUG_ON(j >= segs_to_map); |
590 | if (unlikely(map[j].status != 0)) { | 592 | if (unlikely(map[j].status != 0)) { |
@@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req, | |||
601 | } | 603 | } |
602 | } | 604 | } |
603 | if (persistent_gnts[i]) { | 605 | if (persistent_gnts[i]) { |
604 | if (!persistent_gnts[i]->handle) { | 606 | if (persistent_gnts[i]->handle == |
607 | BLKBACK_INVALID_HANDLE) { | ||
605 | /* | 608 | /* |
606 | * If this is a new persistent grant | 609 | * If this is a new persistent grant |
607 | * save the handler | 610 | * save the handler |
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index b2250265308a..a03ecbb0044c 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c | |||
@@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be) | |||
760 | return -1; | 760 | return -1; |
761 | } | 761 | } |
762 | err = xenbus_gather(XBT_NIL, dev->otherend, | 762 | err = xenbus_gather(XBT_NIL, dev->otherend, |
763 | "feature-persistent-grants", "%u", | 763 | "feature-persistent", "%u", |
764 | &pers_grants, NULL); | 764 | &pers_grants, NULL); |
765 | if (err) | 765 | if (err) |
766 | pers_grants = 0; | 766 | pers_grants = 0; |
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 911d733d21b6..f1de806b0a63 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info, | |||
852 | rq_for_each_segment(bvec, s->request, iter) { | 852 | rq_for_each_segment(bvec, s->request, iter) { |
853 | BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE); | 853 | BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE); |
854 | i = offset >> PAGE_SHIFT; | 854 | i = offset >> PAGE_SHIFT; |
855 | BUG_ON(i >= s->req.u.rw.nr_segments); | ||
855 | shared_data = kmap_atomic( | 856 | shared_data = kmap_atomic( |
856 | pfn_to_page(s->grants_used[i]->pfn)); | 857 | pfn_to_page(s->grants_used[i]->pfn)); |
857 | bvec_data = bvec_kmap_irq(bvec, &flags); | 858 | bvec_data = bvec_kmap_irq(bvec, &flags); |
@@ -1069,7 +1070,7 @@ again: | |||
1069 | goto abort_transaction; | 1070 | goto abort_transaction; |
1070 | } | 1071 | } |
1071 | err = xenbus_printf(xbt, dev->nodename, | 1072 | err = xenbus_printf(xbt, dev->nodename, |
1072 | "feature-persistent-grants", "%u", 1); | 1073 | "feature-persistent", "%u", 1); |
1073 | if (err) | 1074 | if (err) |
1074 | dev_warn(&dev->dev, | 1075 | dev_warn(&dev->dev, |
1075 | "writing persistent grants feature to xenbus"); | 1076 | "writing persistent grants feature to xenbus"); |