Lines Matching refs:pending_req
179 struct pending_req *pending_req);
450 static struct pending_req *alloc_req(struct xen_blkif *blkif) in alloc_req()
452 struct pending_req *req = NULL; in alloc_req()
457 req = list_entry(blkif->pending_free.next, struct pending_req, in alloc_req()
469 static void free_req(struct xen_blkif *blkif, struct pending_req *req) in free_req()
703 struct pending_req* pending_req = (struct pending_req*) (data->data); in xen_blkbk_unmap_and_respond_callback() local
704 struct xen_blkif *blkif = pending_req->blkif; in xen_blkbk_unmap_and_respond_callback()
711 make_response(blkif, pending_req->id, in xen_blkbk_unmap_and_respond_callback()
712 pending_req->operation, pending_req->status); in xen_blkbk_unmap_and_respond_callback()
713 free_req(blkif, pending_req); in xen_blkbk_unmap_and_respond_callback()
732 static void xen_blkbk_unmap_and_respond(struct pending_req *req) in xen_blkbk_unmap_and_respond()
920 static int xen_blkbk_map_seg(struct pending_req *pending_req) in xen_blkbk_map_seg() argument
924 rc = xen_blkbk_map(pending_req->blkif, pending_req->segments, in xen_blkbk_map_seg()
925 pending_req->nr_segs, in xen_blkbk_map_seg()
926 (pending_req->operation != BLKIF_OP_READ)); in xen_blkbk_map_seg()
932 struct pending_req *pending_req, in xen_blkbk_parse_indirect() argument
936 struct grant_page **pages = pending_req->indirect_pages; in xen_blkbk_parse_indirect()
937 struct xen_blkif *blkif = pending_req->blkif; in xen_blkbk_parse_indirect()
941 nseg = pending_req->nr_segs; in xen_blkbk_parse_indirect()
963 pending_req->segments[n]->gref = segments[i].gref; in xen_blkbk_parse_indirect()
1028 struct pending_req *pending_req) in dispatch_other_io() argument
1030 free_req(blkif, pending_req); in dispatch_other_io()
1055 static void __end_block_io_op(struct pending_req *pending_req, int error) in __end_block_io_op() argument
1058 if ((pending_req->operation == BLKIF_OP_FLUSH_DISKCACHE) && in __end_block_io_op()
1061 xen_blkbk_flush_diskcache(XBT_NIL, pending_req->blkif->be, 0); in __end_block_io_op()
1062 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1063 } else if ((pending_req->operation == BLKIF_OP_WRITE_BARRIER) && in __end_block_io_op()
1066 xen_blkbk_barrier(XBT_NIL, pending_req->blkif->be, 0); in __end_block_io_op()
1067 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1071 pending_req->status = BLKIF_RSP_ERROR; in __end_block_io_op()
1079 if (atomic_dec_and_test(&pending_req->pendcnt)) in __end_block_io_op()
1080 xen_blkbk_unmap_and_respond(pending_req); in __end_block_io_op()
1104 struct pending_req *pending_req; in __do_block_io_op() local
1128 pending_req = alloc_req(blkif); in __do_block_io_op()
1129 if (NULL == pending_req) { in __do_block_io_op()
1159 if (dispatch_rw_block_io(blkif, &req, pending_req)) in __do_block_io_op()
1163 free_req(blkif, pending_req); in __do_block_io_op()
1168 if (dispatch_other_io(blkif, &req, pending_req)) in __do_block_io_op()
1202 struct pending_req *pending_req) in dispatch_rw_block_io() argument
1205 struct seg_buf *seg = pending_req->seg; in dispatch_rw_block_io()
1208 struct bio **biolist = pending_req->biolist; in dispatch_rw_block_io()
1213 struct grant_page **pages = pending_req->segments; in dispatch_rw_block_io()
1263 pending_req->blkif = blkif; in dispatch_rw_block_io()
1264 pending_req->id = req->u.rw.id; in dispatch_rw_block_io()
1265 pending_req->operation = req_operation; in dispatch_rw_block_io()
1266 pending_req->status = BLKIF_RSP_OKAY; in dispatch_rw_block_io()
1267 pending_req->nr_segs = nseg; in dispatch_rw_block_io()
1286 if (xen_blkbk_parse_indirect(req, pending_req, seg, &preq)) in dispatch_rw_block_io()
1316 xen_blk_drain_io(pending_req->blkif); in dispatch_rw_block_io()
1324 if (xen_blkbk_map_seg(pending_req)) in dispatch_rw_block_io()
1348 bio->bi_private = pending_req; in dispatch_rw_block_io()
1366 bio->bi_private = pending_req; in dispatch_rw_block_io()
1370 atomic_set(&pending_req->pendcnt, nbio); in dispatch_rw_block_io()
1387 xen_blkbk_unmap(blkif, pending_req->segments, in dispatch_rw_block_io()
1388 pending_req->nr_segs); in dispatch_rw_block_io()
1392 free_req(blkif, pending_req); in dispatch_rw_block_io()
1399 atomic_set(&pending_req->pendcnt, 1); in dispatch_rw_block_io()
1400 __end_block_io_op(pending_req, -EINVAL); in dispatch_rw_block_io()