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_move(&tcmd->hash_list, &cmds); in scsi_tgt_free_queue()
285 tcmd = list_entry(cmds.next, struct scsi_tgt_cmd, hash_list); in scsi_tgt_free_queue()
286 list_del(&tcmd->hash_list); in scsi_tgt_free_queue()
287 cmd = tcmd->rq->special; in scsi_tgt_free_queue()
290 scsi_tgt_cmd_destroy(&tcmd->work); in scsi_tgt_free_queue()
311 struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data; in scsi_tgt_queue_command() local
314 init_scsi_tgt_cmd(cmd->request, tcmd, itn_id, tag); in scsi_tgt_queue_command()
329 struct scsi_tgt_cmd *tcmd = cmd->request->end_io_data; in scsi_tgt_cmd_done() local
333 scsi_tgt_uspace_send_status(cmd, tcmd->itn_id, tcmd->tag); in scsi_tgt_cmd_done()
337 queue_work(scsi_tgtd, &tcmd->work); in scsi_tgt_cmd_done()
357 static int scsi_map_user_pages(struct scsi_tgt_cmd *tcmd, struct scsi_cmnd *cmd, in scsi_map_user_pages() argument
380 tcmd->bio = rq->bio; in scsi_map_user_pages()
395 scsi_unmap_user_pages(tcmd); in scsi_map_user_pages()
414 struct scsi_tgt_cmd *tcmd; in scsi_tgt_abort_cmd() local
421 tcmd = cmd->request->end_io_data; in scsi_tgt_abort_cmd()
422 scsi_tgt_cmd_destroy(&tcmd->work); in scsi_tgt_abort_cmd()
431 struct scsi_tgt_cmd *tcmd; in tgt_cmd_hash_lookup() local
436 list_for_each_entry(tcmd, head, hash_list) { in tgt_cmd_hash_lookup()
437 if (tcmd->tag == tag) { in tgt_cmd_hash_lookup()
438 rq = tcmd->rq; in tgt_cmd_hash_lookup()
439 list_del(&tcmd->hash_list); in tgt_cmd_hash_lookup()
455 struct scsi_tgt_cmd *tcmd; in scsi_tgt_kspace_exec() local
494 tcmd = cmd->request->end_io_data; in scsi_tgt_kspace_exec()
515 head = &qdata->cmd_hash[cmd_hashfn(tcmd->tag)]; in scsi_tgt_kspace_exec()
518 list_add(&tcmd->hash_list, head); in scsi_tgt_kspace_exec()