Lines Matching refs:pending_req

208 				struct pending_req *pending_req);
470 static struct pending_req *alloc_req(struct xen_blkif_ring *ring) in alloc_req()
472 struct pending_req *req = NULL; in alloc_req()
477 req = list_entry(ring->pending_free.next, struct pending_req, in alloc_req()
489 static void free_req(struct xen_blkif_ring *ring, struct pending_req *req) in free_req()
722 struct pending_req *pending_req = (struct pending_req *)(data->data); in xen_blkbk_unmap_and_respond_callback() local
723 struct xen_blkif_ring *ring = pending_req->ring; in xen_blkbk_unmap_and_respond_callback()
731 make_response(ring, pending_req->id, in xen_blkbk_unmap_and_respond_callback()
732 pending_req->operation, pending_req->status); in xen_blkbk_unmap_and_respond_callback()
733 free_req(ring, pending_req); in xen_blkbk_unmap_and_respond_callback()
752 static void xen_blkbk_unmap_and_respond(struct pending_req *req) in xen_blkbk_unmap_and_respond()
942 static int xen_blkbk_map_seg(struct pending_req *pending_req) in xen_blkbk_map_seg() argument
946 rc = xen_blkbk_map(pending_req->ring, pending_req->segments, in xen_blkbk_map_seg()
947 pending_req->nr_segs, in xen_blkbk_map_seg()
948 (pending_req->operation != BLKIF_OP_READ)); in xen_blkbk_map_seg()
954 struct pending_req *pending_req, in xen_blkbk_parse_indirect() argument
958 struct grant_page **pages = pending_req->indirect_pages; in xen_blkbk_parse_indirect()
959 struct xen_blkif_ring *ring = pending_req->ring; in xen_blkbk_parse_indirect()
963 nseg = pending_req->nr_segs; in xen_blkbk_parse_indirect()
985 pending_req->segments[n]->gref = segments[i].gref; in xen_blkbk_parse_indirect()
1051 struct pending_req *pending_req) in dispatch_other_io() argument
1053 free_req(ring, pending_req); in dispatch_other_io()
1076 static void __end_block_io_op(struct pending_req *pending_req, in __end_block_io_op() argument
1080 if (pending_req->operation == BLKIF_OP_FLUSH_DISKCACHE && in __end_block_io_op()
1083 xen_blkbk_flush_diskcache(XBT_NIL, pending_req->ring->blkif->be, 0); in __end_block_io_op()
1084 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1085 } else if (pending_req->operation == BLKIF_OP_WRITE_BARRIER && in __end_block_io_op()
1088 xen_blkbk_barrier(XBT_NIL, pending_req->ring->blkif->be, 0); in __end_block_io_op()
1089 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1093 pending_req->status = BLKIF_RSP_ERROR; in __end_block_io_op()
1101 if (atomic_dec_and_test(&pending_req->pendcnt)) in __end_block_io_op()
1102 xen_blkbk_unmap_and_respond(pending_req); in __end_block_io_op()
1126 struct pending_req *pending_req; in __do_block_io_op() local
1150 pending_req = alloc_req(ring); in __do_block_io_op()
1151 if (NULL == pending_req) { in __do_block_io_op()
1181 if (dispatch_rw_block_io(ring, &req, pending_req)) in __do_block_io_op()
1185 free_req(ring, pending_req); in __do_block_io_op()
1190 if (dispatch_other_io(ring, &req, pending_req)) in __do_block_io_op()
1224 struct pending_req *pending_req) in dispatch_rw_block_io() argument
1227 struct seg_buf *seg = pending_req->seg; in dispatch_rw_block_io()
1230 struct bio **biolist = pending_req->biolist; in dispatch_rw_block_io()
1236 struct grant_page **pages = pending_req->segments; in dispatch_rw_block_io()
1289 pending_req->ring = ring; in dispatch_rw_block_io()
1290 pending_req->id = req->u.rw.id; in dispatch_rw_block_io()
1291 pending_req->operation = req_operation; in dispatch_rw_block_io()
1292 pending_req->status = BLKIF_RSP_OKAY; in dispatch_rw_block_io()
1293 pending_req->nr_segs = nseg; in dispatch_rw_block_io()
1312 if (xen_blkbk_parse_indirect(req, pending_req, seg, &preq)) in dispatch_rw_block_io()
1342 xen_blk_drain_io(pending_req->ring); in dispatch_rw_block_io()
1350 if (xen_blkbk_map_seg(pending_req)) in dispatch_rw_block_io()
1374 bio->bi_private = pending_req; in dispatch_rw_block_io()
1393 bio->bi_private = pending_req; in dispatch_rw_block_io()
1398 atomic_set(&pending_req->pendcnt, nbio); in dispatch_rw_block_io()
1415 xen_blkbk_unmap(ring, pending_req->segments, in dispatch_rw_block_io()
1416 pending_req->nr_segs); in dispatch_rw_block_io()
1420 free_req(ring, pending_req); in dispatch_rw_block_io()
1427 atomic_set(&pending_req->pendcnt, 1); in dispatch_rw_block_io()
1428 __end_block_io_op(pending_req, BLK_STS_RESOURCE); in dispatch_rw_block_io()