Lines Matching refs:pending_req

146 				struct pending_req *pending_req);
414 static struct pending_req *alloc_req(struct xen_blkif_ring *ring) in alloc_req()
416 struct pending_req *req = NULL; in alloc_req()
421 req = list_entry(ring->pending_free.next, struct pending_req, in alloc_req()
433 static void free_req(struct xen_blkif_ring *ring, struct pending_req *req) in free_req()
673 struct pending_req *pending_req = (struct pending_req *)(data->data); in xen_blkbk_unmap_and_respond_callback() local
674 struct xen_blkif_ring *ring = pending_req->ring; in xen_blkbk_unmap_and_respond_callback()
682 make_response(ring, pending_req->id, in xen_blkbk_unmap_and_respond_callback()
683 pending_req->operation, pending_req->status); in xen_blkbk_unmap_and_respond_callback()
684 free_req(ring, pending_req); in xen_blkbk_unmap_and_respond_callback()
703 static void xen_blkbk_unmap_and_respond(struct pending_req *req) in xen_blkbk_unmap_and_respond()
902 static int xen_blkbk_map_seg(struct pending_req *pending_req) in xen_blkbk_map_seg() argument
906 rc = xen_blkbk_map(pending_req->ring, pending_req->segments, in xen_blkbk_map_seg()
907 pending_req->nr_segs, in xen_blkbk_map_seg()
908 (pending_req->operation != BLKIF_OP_READ)); in xen_blkbk_map_seg()
914 struct pending_req *pending_req, in xen_blkbk_parse_indirect() argument
918 struct grant_page **pages = pending_req->indirect_pages; in xen_blkbk_parse_indirect()
919 struct xen_blkif_ring *ring = pending_req->ring; in xen_blkbk_parse_indirect()
923 nseg = pending_req->nr_segs; in xen_blkbk_parse_indirect()
945 pending_req->segments[n]->gref = segments[i].gref; in xen_blkbk_parse_indirect()
1012 struct pending_req *pending_req) in dispatch_other_io() argument
1014 free_req(ring, pending_req); in dispatch_other_io()
1037 static void __end_block_io_op(struct pending_req *pending_req, in __end_block_io_op() argument
1041 if (pending_req->operation == BLKIF_OP_FLUSH_DISKCACHE && in __end_block_io_op()
1044 xen_blkbk_flush_diskcache(XBT_NIL, pending_req->ring->blkif->be, 0); in __end_block_io_op()
1045 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1046 } else if (pending_req->operation == BLKIF_OP_WRITE_BARRIER && in __end_block_io_op()
1049 xen_blkbk_barrier(XBT_NIL, pending_req->ring->blkif->be, 0); in __end_block_io_op()
1050 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1054 pending_req->status = BLKIF_RSP_ERROR; in __end_block_io_op()
1062 if (atomic_dec_and_test(&pending_req->pendcnt)) in __end_block_io_op()
1063 xen_blkbk_unmap_and_respond(pending_req); in __end_block_io_op()
1191 struct pending_req *pending_req; in __do_block_io_op() local
1218 pending_req = alloc_req(ring); in __do_block_io_op()
1219 if (NULL == pending_req) { in __do_block_io_op()
1249 if (dispatch_rw_block_io(ring, &req, pending_req)) in __do_block_io_op()
1253 free_req(ring, pending_req); in __do_block_io_op()
1258 if (dispatch_other_io(ring, &req, pending_req)) in __do_block_io_op()
1292 struct pending_req *pending_req) in dispatch_rw_block_io() argument
1295 struct seg_buf *seg = pending_req->seg; in dispatch_rw_block_io()
1298 struct bio **biolist = pending_req->biolist; in dispatch_rw_block_io()
1304 struct grant_page **pages = pending_req->segments; in dispatch_rw_block_io()
1357 pending_req->ring = ring; in dispatch_rw_block_io()
1358 pending_req->id = req->u.rw.id; in dispatch_rw_block_io()
1359 pending_req->operation = req_operation; in dispatch_rw_block_io()
1360 pending_req->status = BLKIF_RSP_OKAY; in dispatch_rw_block_io()
1361 pending_req->nr_segs = nseg; in dispatch_rw_block_io()
1380 if (xen_blkbk_parse_indirect(req, pending_req, seg, &preq)) in dispatch_rw_block_io()
1410 xen_blk_drain_io(pending_req->ring); in dispatch_rw_block_io()
1418 if (xen_blkbk_map_seg(pending_req)) in dispatch_rw_block_io()
1438 bio->bi_private = pending_req; in dispatch_rw_block_io()
1453 bio->bi_private = pending_req; in dispatch_rw_block_io()
1457 atomic_set(&pending_req->pendcnt, nbio); in dispatch_rw_block_io()
1474 xen_blkbk_unmap(ring, pending_req->segments, in dispatch_rw_block_io()
1475 pending_req->nr_segs); in dispatch_rw_block_io()
1479 free_req(ring, pending_req); in dispatch_rw_block_io()