Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346280
b: refs/heads/master
c: cb5bd4d
h: refs/heads/master
v: v3
  • Loading branch information
Roger Pau Monne authored and Konrad Rzeszutek Wilk committed Nov 4, 2012
1 parent c75a8d0 commit 449e1cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a8704a51f386cab7394e38ff1d66eef924d8ab8
refs/heads/master: cb5bd4d19b46c220b1ac8462a3da01767dd99488
9 changes: 6 additions & 3 deletions trunk/drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static int xen_blkbk_map(struct blkif_request *req,
* not mapped but we have room for it
*/
new_map = true;
persistent_gnt = kzalloc(
persistent_gnt = kmalloc(
sizeof(struct persistent_gnt),
GFP_KERNEL);
if (!persistent_gnt)
Expand All @@ -523,6 +523,7 @@ static int xen_blkbk_map(struct blkif_request *req,
return -ENOMEM;
}
persistent_gnt->gnt = req->u.rw.seg[i].gref;
persistent_gnt->handle = BLKBACK_INVALID_HANDLE;

pages_to_gnt[segs_to_map] =
persistent_gnt->page;
Expand Down Expand Up @@ -584,7 +585,8 @@ static int xen_blkbk_map(struct blkif_request *req,
*/
bitmap_zero(pending_req->unmap_seg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
for (i = 0, j = 0; i < nseg; i++) {
if (!persistent_gnts[i] || !persistent_gnts[i]->handle) {
if (!persistent_gnts[i] ||
persistent_gnts[i]->handle == BLKBACK_INVALID_HANDLE) {
/* This is a newly mapped grant */
BUG_ON(j >= segs_to_map);
if (unlikely(map[j].status != 0)) {
Expand All @@ -601,7 +603,8 @@ static int xen_blkbk_map(struct blkif_request *req,
}
}
if (persistent_gnts[i]) {
if (!persistent_gnts[i]->handle) {
if (persistent_gnts[i]->handle ==
BLKBACK_INVALID_HANDLE) {
/*
* If this is a new persistent grant
* save the handler
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/xen-blkback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ static int connect_ring(struct backend_info *be)
return -1;
}
err = xenbus_gather(XBT_NIL, dev->otherend,
"feature-persistent-grants", "%u",
"feature-persistent", "%u",
&pers_grants, NULL);
if (err)
pers_grants = 0;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/block/xen-blkfront.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,7 @@ static void blkif_completion(struct blk_shadow *s, struct blkfront_info *info,
rq_for_each_segment(bvec, s->request, iter) {
BUG_ON((bvec->bv_offset + bvec->bv_len) > PAGE_SIZE);
i = offset >> PAGE_SHIFT;
BUG_ON(i >= s->req.u.rw.nr_segments);
shared_data = kmap_atomic(
pfn_to_page(s->grants_used[i]->pfn));
bvec_data = bvec_kmap_irq(bvec, &flags);
Expand Down Expand Up @@ -1069,7 +1070,7 @@ static int talk_to_blkback(struct xenbus_device *dev,
goto abort_transaction;
}
err = xenbus_printf(xbt, dev->nodename,
"feature-persistent-grants", "%u", 1);
"feature-persistent", "%u", 1);
if (err)
dev_warn(&dev->dev,
"writing persistent grants feature to xenbus");
Expand Down

0 comments on commit 449e1cc

Please sign in to comment.