Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: target: core: Kill transport_handle_cdb_direct()

Move the code from transport_handle_cdb_direct() to target_submit() and
have iSCSI call target_submit().

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20230928020907.5730-5-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Mike Christie and committed by
Martin K. Petersen
42892679 5c48a4ea

+11 -23
+1 -1
drivers/target/iscsi/iscsi_target_erl1.c
··· 948 948 949 949 iscsit_set_unsolicited_dataout(cmd); 950 950 } 951 - return transport_handle_cdb_direct(&cmd->se_cmd); 951 + return target_submit(&cmd->se_cmd); 952 952 953 953 case ISCSI_OP_NOOP_OUT: 954 954 case ISCSI_OP_TEXT:
+1 -1
drivers/target/iscsi/iscsi_target_tmr.c
··· 318 318 pr_debug("READ ITT: 0x%08x: t_state: %d never sent to" 319 319 " transport\n", cmd->init_task_tag, 320 320 cmd->se_cmd.t_state); 321 - transport_handle_cdb_direct(se_cmd); 321 + target_submit(se_cmd); 322 322 return 0; 323 323 } 324 324
+8 -19
drivers/target/target_core_transport.c
··· 1575 1575 } 1576 1576 EXPORT_SYMBOL(target_cmd_parse_cdb); 1577 1577 1578 - /* 1579 - * Used by fabric module frontends to queue tasks directly. 1580 - * May only be used from process context. 1578 + /** 1579 + * target_submit - perform final initialization and submit cmd to LIO core 1580 + * @cmd: command descriptor to submit 1581 + * 1582 + * target_submit_prep or something similar must have been called on the cmd, 1583 + * and this must be called from process context. 1581 1584 */ 1582 - int transport_handle_cdb_direct( 1583 - struct se_cmd *cmd) 1585 + int target_submit(struct se_cmd *cmd) 1584 1586 { 1585 1587 sense_reason_t ret; 1586 1588 ··· 1642 1640 transport_generic_request_failure(cmd, ret); 1643 1641 return 0; 1644 1642 } 1645 - EXPORT_SYMBOL(transport_handle_cdb_direct); 1643 + EXPORT_SYMBOL_GPL(target_submit); 1646 1644 1647 1645 sense_reason_t 1648 1646 transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl, ··· 1808 1806 return -EIO; 1809 1807 } 1810 1808 EXPORT_SYMBOL_GPL(target_submit_prep); 1811 - 1812 - /** 1813 - * target_submit - perform final initialization and submit cmd to LIO core 1814 - * @se_cmd: command descriptor to submit 1815 - * 1816 - * target_submit_prep must have been called on the cmd, and this must be 1817 - * called from process context. 1818 - */ 1819 - void target_submit(struct se_cmd *se_cmd) 1820 - { 1821 - transport_handle_cdb_direct(se_cmd); 1822 - } 1823 - EXPORT_SYMBOL_GPL(target_submit); 1824 1809 1825 1810 /** 1826 1811 * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd
+1 -2
include/target/target_core_fabric.h
··· 175 175 struct scatterlist *sgl, u32 sgl_count, 176 176 struct scatterlist *sgl_bidi, u32 sgl_bidi_count, 177 177 struct scatterlist *sgl_prot, u32 sgl_prot_count, gfp_t gfp); 178 - void target_submit(struct se_cmd *se_cmd); 178 + int target_submit(struct se_cmd *se_cmd); 179 179 sense_reason_t transport_lookup_cmd_lun(struct se_cmd *); 180 180 sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb, 181 181 gfp_t gfp); ··· 188 188 unsigned char *sense, u64 unpacked_lun, 189 189 void *fabric_tmr_ptr, unsigned char tm_type, 190 190 gfp_t, u64, int); 191 - int transport_handle_cdb_direct(struct se_cmd *); 192 191 sense_reason_t transport_generic_new_cmd(struct se_cmd *); 193 192 194 193 void target_put_cmd_and_wait(struct se_cmd *cmd);