Lines Matching refs:tmf

457 static void vhost_scsi_release_tmf_res(struct vhost_scsi_tmf *tmf)  in vhost_scsi_release_tmf_res()  argument
459 struct vhost_scsi_inflight *inflight = tmf->inflight; in vhost_scsi_release_tmf_res()
464 kfree(tmf->tmf_log); in vhost_scsi_release_tmf_res()
465 kfree(tmf); in vhost_scsi_release_tmf_res()
482 struct vhost_scsi_tmf *tmf = container_of(se_cmd, in vhost_scsi_release_cmd() local
485 schedule_work(&tmf->flush_work); in vhost_scsi_release_cmd()
519 struct vhost_scsi_tmf *tmf = container_of(se_cmd, struct vhost_scsi_tmf, in vhost_scsi_queue_tm_rsp() local
522 tmf->scsi_resp = se_cmd->se_tmr_req->response; in vhost_scsi_queue_tm_rsp()
523 transport_generic_free_cmd(&tmf->se_cmd, 0); in vhost_scsi_queue_tm_rsp()
1107 struct virtio_scsi_ctrl_tmf_resp tmf; in vhost_scsi_send_bad_target() member
1121 rsp.tmf.response = VIRTIO_SCSI_S_BAD_TARGET; in vhost_scsi_send_bad_target()
1550 struct vhost_scsi_tmf *tmf = container_of(work, struct vhost_scsi_tmf, in vhost_scsi_tmf_resp_work() local
1554 if (tmf->scsi_resp == TMR_FUNCTION_COMPLETE) in vhost_scsi_tmf_resp_work()
1559 mutex_lock(&tmf->svq->vq.mutex); in vhost_scsi_tmf_resp_work()
1560 vhost_scsi_send_tmf_resp(tmf->vhost, &tmf->svq->vq, tmf->in_iovs, in vhost_scsi_tmf_resp_work()
1561 tmf->vq_desc, &tmf->resp_iov, resp_code); in vhost_scsi_tmf_resp_work()
1562 vhost_scsi_log_write(&tmf->svq->vq, tmf->tmf_log, in vhost_scsi_tmf_resp_work()
1563 tmf->tmf_log_num); in vhost_scsi_tmf_resp_work()
1564 mutex_unlock(&tmf->svq->vq.mutex); in vhost_scsi_tmf_resp_work()
1566 vhost_scsi_release_tmf_res(tmf); in vhost_scsi_tmf_resp_work()
1571 struct vhost_scsi_tmf *tmf = container_of(work, struct vhost_scsi_tmf, in vhost_scsi_tmf_flush_work() local
1573 struct vhost_virtqueue *vq = &tmf->svq->vq; in vhost_scsi_tmf_flush_work()
1579 if (!vhost_vq_work_queue(vq, &tmf->vwork)) in vhost_scsi_tmf_flush_work()
1580 vhost_scsi_release_tmf_res(tmf); in vhost_scsi_tmf_flush_work()
1592 struct vhost_scsi_tmf *tmf; in vhost_scsi_handle_tmf() local
1603 tmf = kzalloc(sizeof(*tmf), GFP_KERNEL); in vhost_scsi_handle_tmf()
1604 if (!tmf) in vhost_scsi_handle_tmf()
1607 INIT_WORK(&tmf->flush_work, vhost_scsi_tmf_flush_work); in vhost_scsi_handle_tmf()
1608 vhost_work_init(&tmf->vwork, vhost_scsi_tmf_resp_work); in vhost_scsi_handle_tmf()
1609 tmf->vhost = vs; in vhost_scsi_handle_tmf()
1610 tmf->svq = svq; in vhost_scsi_handle_tmf()
1611 tmf->resp_iov = vq->iov[vc->out]; in vhost_scsi_handle_tmf()
1612 tmf->vq_desc = vc->head; in vhost_scsi_handle_tmf()
1613 tmf->in_iovs = vc->in; in vhost_scsi_handle_tmf()
1614 tmf->inflight = vhost_scsi_get_inflight(vq); in vhost_scsi_handle_tmf()
1617 tmf->tmf_log = kmalloc_array(log_num, sizeof(*tmf->tmf_log), in vhost_scsi_handle_tmf()
1619 if (tmf->tmf_log) { in vhost_scsi_handle_tmf()
1620 memcpy(tmf->tmf_log, log, sizeof(*tmf->tmf_log) * log_num); in vhost_scsi_handle_tmf()
1621 tmf->tmf_log_num = log_num; in vhost_scsi_handle_tmf()
1624 vhost_scsi_release_tmf_res(tmf); in vhost_scsi_handle_tmf()
1629 if (target_submit_tmr(&tmf->se_cmd, tpg->tpg_nexus->tvn_se_sess, NULL, in vhost_scsi_handle_tmf()
1633 vhost_scsi_release_tmf_res(tmf); in vhost_scsi_handle_tmf()
1674 struct virtio_scsi_ctrl_tmf_req tmf; in vhost_scsi_ctl_handle_vq() member
1723 vc.req = &v_req.tmf; in vhost_scsi_ctl_handle_vq()
1726 vc.lunp = &v_req.tmf.lun[0]; in vhost_scsi_ctl_handle_vq()
1727 vc.target = &v_req.tmf.lun[1]; in vhost_scsi_ctl_handle_vq()
1762 vhost_scsi_handle_tmf(vs, tpg, vq, &v_req.tmf, &vc, in vhost_scsi_ctl_handle_vq()