Lines Matching full:shadow
190 struct blk_shadow shadow[]; member
291 rinfo->shadow_free = rinfo->shadow[free].req.u.rw.id; in get_id_from_freelist()
292 rinfo->shadow[free].req.u.rw.id = 0x0fffffee; /* debug */ in get_id_from_freelist()
299 if (rinfo->shadow[id].req.u.rw.id != id) in add_id_to_freelist()
301 if (rinfo->shadow[id].request == NULL) in add_id_to_freelist()
303 rinfo->shadow[id].req.u.rw.id = rinfo->shadow_free; in add_id_to_freelist()
304 rinfo->shadow[id].request = NULL; in add_id_to_freelist()
543 rinfo->shadow[id].request = req; in blkif_ring_get_request()
544 rinfo->shadow[id].status = REQ_PROCESSING; in blkif_ring_get_request()
545 rinfo->shadow[id].associated_id = NO_ASSOCIATED_ID; in blkif_ring_get_request()
547 rinfo->shadow[id].req.u.rw.id = id; in blkif_ring_get_request()
560 ring_req = &rinfo->shadow[id].req; in blkif_queue_discard_req()
573 rinfo->shadow[id].status = REQ_WAITING; in blkif_queue_discard_req()
606 * We always use the shadow of the first request to store the list in blkif_setup_rw_req_grant()
611 struct blk_shadow *shadow = &rinfo->shadow[setup->id]; in blkif_setup_rw_req_grant() local
630 shadow->indirect_grants[n] = gnt_list_entry; in blkif_setup_rw_req_grant()
638 * All the grants are stored in the shadow of the first in blkif_setup_rw_req_grant()
641 shadow->grants_used[setup->grant_idx] = gnt_list_entry; in blkif_setup_rw_req_grant()
752 ring_req = &rinfo->shadow[id].req; in blkif_queue_rw_req()
754 num_sg = blk_rq_map_sg(req->q, req, rinfo->shadow[id].sg); in blkif_queue_rw_req()
757 for_each_sg(rinfo->shadow[id].sg, sg, num_sg, i) in blkif_queue_rw_req()
764 rinfo->shadow[id].num_sg = num_sg; in blkif_queue_rw_req()
804 extra_ring_req = &rinfo->shadow[extra_id].req; in blkif_queue_rw_req()
810 rinfo->shadow[extra_id].num_sg = 0; in blkif_queue_rw_req()
815 rinfo->shadow[extra_id].associated_id = id; in blkif_queue_rw_req()
816 rinfo->shadow[id].associated_id = extra_id; in blkif_queue_rw_req()
827 for_each_sg(rinfo->shadow[id].sg, sg, num_sg, i) { in blkif_queue_rw_req()
849 rinfo->shadow[id].status = REQ_WAITING; in blkif_queue_rw_req()
852 rinfo->shadow[extra_id].status = REQ_WAITING; in blkif_queue_rw_req()
1248 if (!rinfo->shadow[i].request) in blkif_free_ring()
1251 segs = rinfo->shadow[i].req.operation == BLKIF_OP_INDIRECT ? in blkif_free_ring()
1252 rinfo->shadow[i].req.u.indirect.nr_segments : in blkif_free_ring()
1253 rinfo->shadow[i].req.u.rw.nr_segments; in blkif_free_ring()
1255 persistent_gnt = rinfo->shadow[i].grants_used[j]; in blkif_free_ring()
1262 if (rinfo->shadow[i].req.operation != BLKIF_OP_INDIRECT) in blkif_free_ring()
1270 persistent_gnt = rinfo->shadow[i].indirect_grants[j]; in blkif_free_ring()
1277 kvfree(rinfo->shadow[i].grants_used); in blkif_free_ring()
1278 rinfo->shadow[i].grants_used = NULL; in blkif_free_ring()
1279 kvfree(rinfo->shadow[i].indirect_grants); in blkif_free_ring()
1280 rinfo->shadow[i].indirect_grants = NULL; in blkif_free_ring()
1281 kvfree(rinfo->shadow[i].sg); in blkif_free_ring()
1282 rinfo->shadow[i].sg = NULL; in blkif_free_ring()
1390 struct blk_shadow *s = &rinfo->shadow[*id]; in blkif_completion()
1400 struct blk_shadow *s2 = &rinfo->shadow[s->associated_id]; in blkif_completion()
1402 /* Keep the status of the current response in shadow. */ in blkif_completion()
1413 * All the grants is stored in the first shadow in order in blkif_completion()
1556 if (rinfo->shadow[id].status != REQ_WAITING) { in blkif_interrupt()
1562 rinfo->shadow[id].status = REQ_PROCESSING; in blkif_interrupt()
1563 req = rinfo->shadow[id].request; in blkif_interrupt()
1565 op = rinfo->shadow[id].req.operation; in blkif_interrupt()
1567 op = rinfo->shadow[id].req.u.indirect.indirect_op; in blkif_interrupt()
1621 rinfo->shadow[id].req.u.rw.nr_segments == 0)) { in blkif_interrupt()
1878 rinfo->shadow[j].req.u.rw.id = j + 1; in talk_to_blkback()
1879 rinfo->shadow[BLK_RING_SIZE(info)-1].req.u.rw.id = 0x0fffffff; in talk_to_blkback()
1910 info->rinfo_size = struct_size(info->rinfo, shadow, in negotiate_mq()
2072 struct blk_shadow *shadow = rinfo->shadow; in blkfront_resume() local
2076 if (!shadow[j].request) in blkfront_resume()
2082 if (req_op(shadow[j].request) == REQ_OP_FLUSH || in blkfront_resume()
2083 req_op(shadow[j].request) == REQ_OP_DISCARD || in blkfront_resume()
2084 req_op(shadow[j].request) == REQ_OP_SECURE_ERASE || in blkfront_resume()
2085 shadow[j].request->cmd_flags & REQ_FUA) { in blkfront_resume()
2093 list_add(&shadow[j].request->queuelist, &info->requests); in blkfront_resume()
2096 merge_bio.head = shadow[j].request->bio; in blkfront_resume()
2097 merge_bio.tail = shadow[j].request->biotail; in blkfront_resume()
2099 shadow[j].request->bio = NULL; in blkfront_resume()
2100 blk_mq_end_request(shadow[j].request, BLK_STS_OK); in blkfront_resume()
2207 rinfo->shadow[i].grants_used = in blkfront_setup_indirect()
2209 sizeof(rinfo->shadow[i].grants_used[0]), in blkfront_setup_indirect()
2211 rinfo->shadow[i].sg = kvcalloc(psegs, in blkfront_setup_indirect()
2212 sizeof(rinfo->shadow[i].sg[0]), in blkfront_setup_indirect()
2215 rinfo->shadow[i].indirect_grants = in blkfront_setup_indirect()
2217 sizeof(rinfo->shadow[i].indirect_grants[0]), in blkfront_setup_indirect()
2219 if ((rinfo->shadow[i].grants_used == NULL) || in blkfront_setup_indirect()
2220 (rinfo->shadow[i].sg == NULL) || in blkfront_setup_indirect()
2222 (rinfo->shadow[i].indirect_grants == NULL))) in blkfront_setup_indirect()
2224 sg_init_table(rinfo->shadow[i].sg, psegs); in blkfront_setup_indirect()
2233 kvfree(rinfo->shadow[i].grants_used); in blkfront_setup_indirect()
2234 rinfo->shadow[i].grants_used = NULL; in blkfront_setup_indirect()
2235 kvfree(rinfo->shadow[i].sg); in blkfront_setup_indirect()
2236 rinfo->shadow[i].sg = NULL; in blkfront_setup_indirect()
2237 kvfree(rinfo->shadow[i].indirect_grants); in blkfront_setup_indirect()
2238 rinfo->shadow[i].indirect_grants = NULL; in blkfront_setup_indirect()