Lines Matching refs:pending_req

172 				struct pending_req *pending_req);
443 static struct pending_req *alloc_req(struct xen_blkif *blkif) in alloc_req()
445 struct pending_req *req = NULL; in alloc_req()
450 req = list_entry(blkif->pending_free.next, struct pending_req, in alloc_req()
462 static void free_req(struct xen_blkif *blkif, struct pending_req *req) in free_req()
696 struct pending_req* pending_req = (struct pending_req*) (data->data); in xen_blkbk_unmap_and_respond_callback() local
697 struct xen_blkif *blkif = pending_req->blkif; in xen_blkbk_unmap_and_respond_callback()
704 make_response(blkif, pending_req->id, in xen_blkbk_unmap_and_respond_callback()
705 pending_req->operation, pending_req->status); in xen_blkbk_unmap_and_respond_callback()
706 free_req(blkif, pending_req); in xen_blkbk_unmap_and_respond_callback()
725 static void xen_blkbk_unmap_and_respond(struct pending_req *req) in xen_blkbk_unmap_and_respond()
913 static int xen_blkbk_map_seg(struct pending_req *pending_req) in xen_blkbk_map_seg() argument
917 rc = xen_blkbk_map(pending_req->blkif, pending_req->segments, in xen_blkbk_map_seg()
918 pending_req->nr_pages, in xen_blkbk_map_seg()
919 (pending_req->operation != BLKIF_OP_READ)); in xen_blkbk_map_seg()
925 struct pending_req *pending_req, in xen_blkbk_parse_indirect() argument
929 struct grant_page **pages = pending_req->indirect_pages; in xen_blkbk_parse_indirect()
930 struct xen_blkif *blkif = pending_req->blkif; in xen_blkbk_parse_indirect()
934 nseg = pending_req->nr_pages; in xen_blkbk_parse_indirect()
953 pending_req->segments[n]->gref = segments[i].gref; in xen_blkbk_parse_indirect()
1016 struct pending_req *pending_req) in dispatch_other_io() argument
1018 free_req(blkif, pending_req); in dispatch_other_io()
1043 static void __end_block_io_op(struct pending_req *pending_req, int error) in __end_block_io_op() argument
1046 if ((pending_req->operation == BLKIF_OP_FLUSH_DISKCACHE) && in __end_block_io_op()
1049 xen_blkbk_flush_diskcache(XBT_NIL, pending_req->blkif->be, 0); in __end_block_io_op()
1050 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1051 } else if ((pending_req->operation == BLKIF_OP_WRITE_BARRIER) && in __end_block_io_op()
1054 xen_blkbk_barrier(XBT_NIL, pending_req->blkif->be, 0); in __end_block_io_op()
1055 pending_req->status = BLKIF_RSP_EOPNOTSUPP; in __end_block_io_op()
1059 pending_req->status = BLKIF_RSP_ERROR; in __end_block_io_op()
1067 if (atomic_dec_and_test(&pending_req->pendcnt)) in __end_block_io_op()
1068 xen_blkbk_unmap_and_respond(pending_req); in __end_block_io_op()
1092 struct pending_req *pending_req; in __do_block_io_op() local
1116 pending_req = alloc_req(blkif); in __do_block_io_op()
1117 if (NULL == pending_req) { in __do_block_io_op()
1147 if (dispatch_rw_block_io(blkif, &req, pending_req)) in __do_block_io_op()
1151 free_req(blkif, pending_req); in __do_block_io_op()
1156 if (dispatch_other_io(blkif, &req, pending_req)) in __do_block_io_op()
1190 struct pending_req *pending_req) in dispatch_rw_block_io() argument
1193 struct seg_buf *seg = pending_req->seg; in dispatch_rw_block_io()
1196 struct bio **biolist = pending_req->biolist; in dispatch_rw_block_io()
1201 struct grant_page **pages = pending_req->segments; in dispatch_rw_block_io()
1250 pending_req->blkif = blkif; in dispatch_rw_block_io()
1251 pending_req->id = req->u.rw.id; in dispatch_rw_block_io()
1252 pending_req->operation = req_operation; in dispatch_rw_block_io()
1253 pending_req->status = BLKIF_RSP_OKAY; in dispatch_rw_block_io()
1254 pending_req->nr_pages = nseg; in dispatch_rw_block_io()
1273 if (xen_blkbk_parse_indirect(req, pending_req, seg, &preq)) in dispatch_rw_block_io()
1303 xen_blk_drain_io(pending_req->blkif); in dispatch_rw_block_io()
1311 if (xen_blkbk_map_seg(pending_req)) in dispatch_rw_block_io()
1335 bio->bi_private = pending_req; in dispatch_rw_block_io()
1353 bio->bi_private = pending_req; in dispatch_rw_block_io()
1357 atomic_set(&pending_req->pendcnt, nbio); in dispatch_rw_block_io()
1374 xen_blkbk_unmap(blkif, pending_req->segments, in dispatch_rw_block_io()
1375 pending_req->nr_pages); in dispatch_rw_block_io()
1379 free_req(blkif, pending_req); in dispatch_rw_block_io()
1386 atomic_set(&pending_req->pendcnt, 1); in dispatch_rw_block_io()
1387 __end_block_io_op(pending_req, -EINVAL); in dispatch_rw_block_io()