Lines Matching refs:pending_req

146 				struct pending_req *pending_req);
409 static struct pending_req *alloc_req(struct xen_blkif_ring *ring) in alloc_req()
411 struct pending_req *req = NULL; in alloc_req()
416 req = list_entry(ring->pending_free.next, struct pending_req, in alloc_req()
428 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()
1087 struct pending_req *pending_req; in __do_block_io_op() local
1114 pending_req = alloc_req(ring); in __do_block_io_op()
1115 if (NULL == pending_req) { in __do_block_io_op()
1145 if (dispatch_rw_block_io(ring, &req, pending_req)) in __do_block_io_op()
1149 free_req(ring, pending_req); in __do_block_io_op()
1154 if (dispatch_other_io(ring, &req, pending_req)) in __do_block_io_op()
1188 struct pending_req *pending_req) in dispatch_rw_block_io() argument
1191 struct seg_buf *seg = pending_req->seg; in dispatch_rw_block_io()
1194 struct bio **biolist = pending_req->biolist; in dispatch_rw_block_io()
1200 struct grant_page **pages = pending_req->segments; in dispatch_rw_block_io()
1253 pending_req->ring = ring; in dispatch_rw_block_io()
1254 pending_req->id = req->u.rw.id; in dispatch_rw_block_io()
1255 pending_req->operation = req_operation; in dispatch_rw_block_io()
1256 pending_req->status = BLKIF_RSP_OKAY; in dispatch_rw_block_io()
1257 pending_req->nr_segs = nseg; in dispatch_rw_block_io()
1276 if (xen_blkbk_parse_indirect(req, pending_req, seg, &preq)) in dispatch_rw_block_io()
1306 xen_blk_drain_io(pending_req->ring); in dispatch_rw_block_io()
1314 if (xen_blkbk_map_seg(pending_req)) in dispatch_rw_block_io()
1334 bio->bi_private = pending_req; in dispatch_rw_block_io()
1349 bio->bi_private = pending_req; in dispatch_rw_block_io()
1353 atomic_set(&pending_req->pendcnt, nbio); in dispatch_rw_block_io()
1370 xen_blkbk_unmap(ring, pending_req->segments, in dispatch_rw_block_io()
1371 pending_req->nr_segs); in dispatch_rw_block_io()
1375 free_req(ring, pending_req); in dispatch_rw_block_io()