static int blkif_queue_rw_req(struct request *req, struct blkfront_ring_info *rinfo)
{
struct blkfront_info *info = rinfo->dev_info;
- struct blkif_request *ring_req;
+ struct blkif_request *ring_req, *extra_ring_req = NULL;
unsigned long id, extra_id = NO_ASSOCIATED_ID;
bool require_extra_req = false;
int i;
}
ring_req->u.rw.nr_segments = num_grant;
if (unlikely(require_extra_req)) {
- extra_id = blkif_ring_get_request(info, req,
+ extra_id = blkif_ring_get_request(rinfo, req,
&extra_ring_req);
/*
* Only the first request contains the scatter-gather
return BLKIF_RSP_OKAY;
}
-static void blkif_completion(struct blk_shadow *s,
+static bool blkif_completion(unsigned long *id,
struct blkfront_ring_info *rinfo,
struct blkif_response *bret)
{
struct scatterlist *sg;
int num_sg, num_grant;
struct blkfront_info *info = rinfo->dev_info;
- struct blk_shadow *s = &info->shadow[*id];
+ struct blk_shadow *s = &rinfo->shadow[*id];
struct copy_from_grant data = {
.grant_idx = 0,
};
/* The I/O request may be split in two */
if (unlikely(s->associated_id != NO_ASSOCIATED_ID)) {
- struct blk_shadow *s2 = &info->shadow[s->associated_id];
+ struct blk_shadow *s2 = &rinfo->shadow[s->associated_id];
/* Keep the status of the current response in shadow */
s->status = blkif_rsp_to_req_status(bret->status);
* We don't need anymore the second request, so recycling
* it now.
*/
- if (add_id_to_freelist(info, s->associated_id))
+ if (add_id_to_freelist(rinfo, s->associated_id))
WARN(1, "%s: can't recycle the second part (id = %ld) of the request\n",
info->gd->disk_name, s->associated_id);
}