• Home
  • Raw
  • Download

Lines Matching refs:pending_req

219 					struct vscsibk_pend *pending_req)  in scsiback_print_status()  argument
221 struct scsiback_tpg *tpg = pending_req->v2p->tpg; in scsiback_print_status()
224 tpg->tport->tport_name, pending_req->v2p->lun, in scsiback_print_status()
225 pending_req->cmnd[0], errors & 0xff, COMMAND_COMPLETE, in scsiback_print_status()
322 uint32_t resid, struct vscsibk_pend *pending_req) in scsiback_do_resp_with_sense() argument
324 scsiback_send_response(pending_req->info, sense_buffer, result, in scsiback_do_resp_with_sense()
325 resid, pending_req->rqid); in scsiback_do_resp_with_sense()
327 if (pending_req->v2p) in scsiback_do_resp_with_sense()
328 kref_put(&pending_req->v2p->kref, in scsiback_do_resp_with_sense()
332 static void scsiback_cmd_done(struct vscsibk_pend *pending_req) in scsiback_cmd_done() argument
334 struct vscsibk_info *info = pending_req->info; in scsiback_cmd_done()
339 sense_buffer = pending_req->sense_buffer; in scsiback_cmd_done()
340 resid = pending_req->se_cmd.residual_count; in scsiback_cmd_done()
341 errors = pending_req->result; in scsiback_cmd_done()
344 scsiback_print_status(sense_buffer, errors, pending_req); in scsiback_cmd_done()
346 scsiback_fast_flush_area(pending_req); in scsiback_cmd_done()
347 scsiback_do_resp_with_sense(sense_buffer, errors, resid, pending_req); in scsiback_cmd_done()
354 target_put_sess_cmd(&pending_req->se_cmd); in scsiback_cmd_done()
357 static void scsiback_cmd_exec(struct vscsibk_pend *pending_req) in scsiback_cmd_exec() argument
359 struct se_cmd *se_cmd = &pending_req->se_cmd; in scsiback_cmd_exec()
360 struct se_session *sess = pending_req->v2p->tpg->tpg_nexus->tvn_se_sess; in scsiback_cmd_exec()
362 scsiback_get(pending_req->info); in scsiback_cmd_exec()
363 se_cmd->tag = pending_req->rqid; in scsiback_cmd_exec()
364 target_init_cmd(se_cmd, sess, pending_req->sense_buffer, in scsiback_cmd_exec()
365 pending_req->v2p->lun, pending_req->data_len, 0, in scsiback_cmd_exec()
366 pending_req->sc_data_direction, TARGET_SCF_ACK_KREF); in scsiback_cmd_exec()
368 if (target_submit_prep(se_cmd, pending_req->cmnd, pending_req->sgl, in scsiback_cmd_exec()
369 pending_req->n_sg, NULL, 0, NULL, 0, GFP_KERNEL)) in scsiback_cmd_exec()
398 static int scsiback_gnttab_data_map_list(struct vscsibk_pend *pending_req, in scsiback_gnttab_data_map_list() argument
404 struct vscsibk_info *info = pending_req->info; in scsiback_gnttab_data_map_list()
420 pending_req->n_grants += mapcount; in scsiback_gnttab_data_map_list()
426 pending_req->n_grants += mapcount; in scsiback_gnttab_data_map_list()
431 struct vscsibk_pend *pending_req) in scsiback_gnttab_data_map() argument
443 pending_req->n_sg = 0; in scsiback_gnttab_data_map()
444 pending_req->n_grants = 0; in scsiback_gnttab_data_map()
445 pending_req->data_len = 0; in scsiback_gnttab_data_map()
458 err = scsiback_gnttab_data_map_list(pending_req, ring_req->seg, in scsiback_gnttab_data_map()
459 pending_req->pages, pending_req->grant_handles, in scsiback_gnttab_data_map()
482 pending_req->sgl = kmalloc_array(nr_segments, in scsiback_gnttab_data_map()
484 if (!pending_req->sgl) in scsiback_gnttab_data_map()
487 sg_init_table(pending_req->sgl, nr_segments); in scsiback_gnttab_data_map()
488 pending_req->n_sg = nr_segments; in scsiback_gnttab_data_map()
491 if (pending_req->sc_data_direction == DMA_TO_DEVICE) in scsiback_gnttab_data_map()
494 pg = pending_req->pages + nr_sgl; in scsiback_gnttab_data_map()
495 grant = pending_req->grant_handles + nr_sgl; in scsiback_gnttab_data_map()
498 err = scsiback_gnttab_data_map_list(pending_req, seg, in scsiback_gnttab_data_map()
505 vaddr(pending_req, i) + ring_req->seg[i].offset); in scsiback_gnttab_data_map()
508 err = scsiback_gnttab_data_map_list(pending_req, seg, in scsiback_gnttab_data_map()
515 end_seg = vaddr(pending_req, 0) + ring_req->seg[0].offset; in scsiback_gnttab_data_map()
518 pg = pending_req->pages + nr_sgl; in scsiback_gnttab_data_map()
521 for_each_sg(pending_req->sgl, sg, nr_segments, i) { in scsiback_gnttab_data_map()
523 pending_req->data_len += seg->length; in scsiback_gnttab_data_map()
527 end_seg = vaddr(pending_req, i_seg) + in scsiback_gnttab_data_map()
551 static void scsiback_device_action(struct vscsibk_pend *pending_req, in scsiback_device_action() argument
554 struct scsiback_tpg *tpg = pending_req->v2p->tpg; in scsiback_device_action()
556 struct se_cmd *se_cmd = &pending_req->se_cmd; in scsiback_device_action()
557 u64 unpacked_lun = pending_req->v2p->lun; in scsiback_device_action()
560 init_completion(&pending_req->tmr_done); in scsiback_device_action()
562 rc = target_submit_tmr(&pending_req->se_cmd, nexus->tvn_se_sess, in scsiback_device_action()
563 &pending_req->sense_buffer[0], in scsiback_device_action()
569 wait_for_completion(&pending_req->tmr_done); in scsiback_device_action()
574 scsiback_do_resp_with_sense(NULL, err, 0, pending_req); in scsiback_device_action()
575 transport_generic_free_cmd(&pending_req->se_cmd, 0); in scsiback_device_action()
579 scsiback_do_resp_with_sense(NULL, err, 0, pending_req); in scsiback_device_action()
638 struct vscsibk_pend *pending_req; in prepare_pending_reqs() local
668 pending_req = scsiback_get_pend_req(ring, v2p); in prepare_pending_reqs()
669 if (IS_ERR(pending_req)) { in prepare_pending_reqs()
673 pending_req->rqid = ring_req->rqid; in prepare_pending_reqs()
674 pending_req->info = info; in prepare_pending_reqs()
675 pending_req->v2p = v2p; in prepare_pending_reqs()
676 pending_req->sc_data_direction = ring_req->sc_data_direction; in prepare_pending_reqs()
677 pending_req->cmd_len = ring_req->cmd_len; in prepare_pending_reqs()
678 memcpy(pending_req->cmnd, ring_req->cmnd, pending_req->cmd_len); in prepare_pending_reqs()
680 return pending_req; in prepare_pending_reqs()
688 struct vscsibk_pend *pending_req; in scsiback_do_cmd_fn() local
713 pending_req = prepare_pending_reqs(info, ring, &ring_req); in scsiback_do_cmd_fn()
714 if (IS_ERR(pending_req)) { in scsiback_do_cmd_fn()
715 switch (PTR_ERR(pending_req)) { in scsiback_do_cmd_fn()
730 if (scsiback_gnttab_data_map(&ring_req, pending_req)) { in scsiback_do_cmd_fn()
731 scsiback_fast_flush_area(pending_req); in scsiback_do_cmd_fn()
733 DID_ERROR << 16, 0, pending_req); in scsiback_do_cmd_fn()
734 transport_generic_free_cmd(&pending_req->se_cmd, 0); in scsiback_do_cmd_fn()
736 scsiback_cmd_exec(pending_req); in scsiback_do_cmd_fn()
740 scsiback_device_action(pending_req, TMR_ABORT_TASK, in scsiback_do_cmd_fn()
744 scsiback_device_action(pending_req, TMR_LUN_RESET, 0); in scsiback_do_cmd_fn()
749 pending_req); in scsiback_do_cmd_fn()
750 transport_generic_free_cmd(&pending_req->se_cmd, 0); in scsiback_do_cmd_fn()
1386 struct vscsibk_pend *pending_req = container_of(se_cmd, in scsiback_queue_data_in() local
1389 pending_req->result = SAM_STAT_GOOD; in scsiback_queue_data_in()
1390 scsiback_cmd_done(pending_req); in scsiback_queue_data_in()
1396 struct vscsibk_pend *pending_req = container_of(se_cmd, in scsiback_queue_status() local
1402 pending_req->result = SAM_STAT_CHECK_CONDITION; in scsiback_queue_status()
1404 pending_req->result = se_cmd->scsi_status; in scsiback_queue_status()
1406 scsiback_cmd_done(pending_req); in scsiback_queue_status()
1412 struct vscsibk_pend *pending_req = container_of(se_cmd, in scsiback_queue_tm_rsp() local
1415 complete(&pending_req->tmr_done); in scsiback_queue_tm_rsp()