Lines Matching refs:tcmd
84 struct scsi_tgt_cmd *tcmd; in scsi_host_get_command() local
90 tcmd = kmem_cache_alloc(scsi_tgt_cmd_cache, GFP_ATOMIC); in scsi_host_get_command()
91 if (!tcmd) in scsi_host_get_command()
116 rq->end_io_data = tcmd; in scsi_host_get_command()
118 tcmd->rq = rq; in scsi_host_get_command()
125 kmem_cache_free(scsi_tgt_cmd_cache, tcmd); in scsi_host_get_command()
149 struct scsi_tgt_cmd *tcmd = rq->end_io_data; in scsi_host_put_command() local
152 kmem_cache_free(scsi_tgt_cmd_cache, tcmd); in scsi_host_put_command()
167 struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data; in cmd_hashlist_del() local
170 list_del(&tcmd->hash_list); in cmd_hashlist_del()
174 static void scsi_unmap_user_pages(struct scsi_tgt_cmd *tcmd) in scsi_unmap_user_pages() argument
176 blk_rq_unmap_user(tcmd->bio); in scsi_unmap_user_pages()
181 struct scsi_tgt_cmd *tcmd = in scsi_tgt_cmd_destroy() local
183 struct scsi_cmnd *cmd = tcmd->rq->special; in scsi_tgt_cmd_destroy()
187 scsi_unmap_user_pages(tcmd); in scsi_tgt_cmd_destroy()
188 tcmd->rq->bio = NULL; in scsi_tgt_cmd_destroy()
192 static void init_scsi_tgt_cmd(struct request *rq, struct scsi_tgt_cmd *tcmd, in init_scsi_tgt_cmd() argument
199 tcmd->itn_id = itn_id; in init_scsi_tgt_cmd()
200 tcmd->tag = tag; in init_scsi_tgt_cmd()
201 tcmd->bio = NULL; in init_scsi_tgt_cmd()
202 INIT_WORK(&tcmd->work, scsi_tgt_cmd_destroy); in init_scsi_tgt_cmd()
205 list_add(&tcmd->hash_list, head); in init_scsi_tgt_cmd()
271 struct scsi_tgt_cmd *tcmd, *n; in scsi_tgt_free_queue() local
277 list_for_each_entry_safe(tcmd, n, &qdata->cmd_hash[i], in scsi_tgt_free_queue()
279 list_del(&tcmd->hash_list); in scsi_tgt_free_queue()
280 list_add(&tcmd->hash_list, &cmds); in scsi_tgt_free_queue()
287 tcmd = list_entry(cmds.next, struct scsi_tgt_cmd, hash_list); in scsi_tgt_free_queue()
288 list_del(&tcmd->hash_list); in scsi_tgt_free_queue()
289 cmd = tcmd->rq->special; in scsi_tgt_free_queue()
292 scsi_tgt_cmd_destroy(&tcmd->work); in scsi_tgt_free_queue()
313 struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data; in scsi_tgt_queue_command() local
316 init_scsi_tgt_cmd(cmd->request, tcmd, itn_id, tag); in scsi_tgt_queue_command()
331 struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data; in scsi_tgt_cmd_done() local
335 scsi_tgt_uspace_send_status(cmd, tcmd->itn_id, tcmd->tag); in scsi_tgt_cmd_done()
339 queue_work(scsi_tgtd, &tcmd->work); in scsi_tgt_cmd_done()
359 static int scsi_map_user_pages(struct scsi_tgt_cmd *tcmd, struct scsi_cmnd *cmd, in scsi_map_user_pages() argument
382 tcmd->bio = rq->bio; in scsi_map_user_pages()
397 scsi_unmap_user_pages(tcmd); in scsi_map_user_pages()
416 struct scsi_tgt_cmd *tcmd; in scsi_tgt_abort_cmd() local
423 tcmd = cmd->request->end_io_data; in scsi_tgt_abort_cmd()
424 scsi_tgt_cmd_destroy(&tcmd->work); in scsi_tgt_abort_cmd()
433 struct scsi_tgt_cmd *tcmd; in tgt_cmd_hash_lookup() local
438 list_for_each_entry(tcmd, head, hash_list) { in tgt_cmd_hash_lookup()
439 if (tcmd->tag == tag) { in tgt_cmd_hash_lookup()
440 rq = tcmd->rq; in tgt_cmd_hash_lookup()
441 list_del(&tcmd->hash_list); in tgt_cmd_hash_lookup()
457 struct scsi_tgt_cmd *tcmd; in scsi_tgt_kspace_exec() local
496 tcmd = cmd->request->end_io_data; in scsi_tgt_kspace_exec()
517 head = &qdata->cmd_hash[cmd_hashfn(tcmd->tag)]; in scsi_tgt_kspace_exec()
520 list_add(&tcmd->hash_list, head); in scsi_tgt_kspace_exec()