提交 a945b980 编写于 作者: J Jeremy Fitzhardinge

xen/blkfront: change blk_shadow.request to proper pointer

Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
上级 c64e38ea
...@@ -65,7 +65,7 @@ enum blkif_state { ...@@ -65,7 +65,7 @@ enum blkif_state {
struct blk_shadow { struct blk_shadow {
struct blkif_request req; struct blkif_request req;
unsigned long request; struct request *request;
unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST]; unsigned long frame[BLKIF_MAX_SEGMENTS_PER_REQUEST];
}; };
...@@ -136,7 +136,7 @@ static void add_id_to_freelist(struct blkfront_info *info, ...@@ -136,7 +136,7 @@ static void add_id_to_freelist(struct blkfront_info *info,
unsigned long id) unsigned long id)
{ {
info->shadow[id].req.id = info->shadow_free; info->shadow[id].req.id = info->shadow_free;
info->shadow[id].request = 0; info->shadow[id].request = NULL;
info->shadow_free = id; info->shadow_free = id;
} }
...@@ -278,7 +278,7 @@ static int blkif_queue_request(struct request *req) ...@@ -278,7 +278,7 @@ static int blkif_queue_request(struct request *req)
/* Fill out a communications ring structure. */ /* Fill out a communications ring structure. */
ring_req = RING_GET_REQUEST(&info->ring, info->ring.req_prod_pvt); ring_req = RING_GET_REQUEST(&info->ring, info->ring.req_prod_pvt);
id = get_id_from_freelist(info); id = get_id_from_freelist(info);
info->shadow[id].request = (unsigned long)req; info->shadow[id].request = req;
ring_req->id = id; ring_req->id = id;
ring_req->sector_number = (blkif_sector_t)blk_rq_pos(req); ring_req->sector_number = (blkif_sector_t)blk_rq_pos(req);
...@@ -633,7 +633,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) ...@@ -633,7 +633,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
bret = RING_GET_RESPONSE(&info->ring, i); bret = RING_GET_RESPONSE(&info->ring, i);
id = bret->id; id = bret->id;
req = (struct request *)info->shadow[id].request; req = info->shadow[id].request;
blkif_completion(&info->shadow[id]); blkif_completion(&info->shadow[id]);
...@@ -898,7 +898,7 @@ static int blkif_recover(struct blkfront_info *info) ...@@ -898,7 +898,7 @@ static int blkif_recover(struct blkfront_info *info)
/* Stage 3: Find pending requests and requeue them. */ /* Stage 3: Find pending requests and requeue them. */
for (i = 0; i < BLK_RING_SIZE; i++) { for (i = 0; i < BLK_RING_SIZE; i++) {
/* Not in use? */ /* Not in use? */
if (copy[i].request == 0) if (!copy[i].request)
continue; continue;
/* Grab a request slot and copy shadow state into it. */ /* Grab a request slot and copy shadow state into it. */
...@@ -915,9 +915,7 @@ static int blkif_recover(struct blkfront_info *info) ...@@ -915,9 +915,7 @@ static int blkif_recover(struct blkfront_info *info)
req->seg[j].gref, req->seg[j].gref,
info->xbdev->otherend_id, info->xbdev->otherend_id,
pfn_to_mfn(info->shadow[req->id].frame[j]), pfn_to_mfn(info->shadow[req->id].frame[j]),
rq_data_dir( rq_data_dir(info->shadow[req->id].request));
(struct request *)
info->shadow[req->id].request));
info->shadow[req->id].req = *req; info->shadow[req->id].req = *req;
info->ring.req_prod_pvt++; info->ring.req_prod_pvt++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册