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

scsi: target: core: Move core_alua_check_nonop_delay() call

Move core_alua_check_nonop_delay() to transport_handle_cdb_direct() so the
iSCSI target driver doesn't have to call as many core functions
directly. We will eventually merge transport_handle_cdb_direct and
target_submit so iSCSI and the other drivers call a common function.

It will also be helpful as preparation for future changes which allow the
iSCSI target to defer command submission to the LIO submission workqueue,
because we will have a common submission function for that which will be
based on transport_handle_cdb_direct()/target_submit().

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

authored by

Mike Christie and committed by
Martin K. Petersen
ee48345e 194605d4

+6 -15
-6
drivers/target/iscsi/iscsi_target.c
··· 1234 1234 spin_lock_bh(&conn->cmd_lock); 1235 1235 list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); 1236 1236 spin_unlock_bh(&conn->cmd_lock); 1237 - /* 1238 - * Check if we need to delay processing because of ALUA 1239 - * Active/NonOptimized primary access state.. 1240 - */ 1241 - core_alua_check_nonop_delay(&cmd->se_cmd); 1242 - 1243 1237 return 0; 1244 1238 } 1245 1239 EXPORT_SYMBOL(iscsit_setup_scsi_cmd);
-1
drivers/target/target_core_alua.c
··· 850 850 msleep_interruptible(cmd->alua_nonop_delay); 851 851 return 0; 852 852 } 853 - EXPORT_SYMBOL(core_alua_check_nonop_delay); 854 853 855 854 static int core_alua_write_tpg_metadata( 856 855 const char *path,
+6 -6
drivers/target/target_core_transport.c
··· 1586 1586 1587 1587 might_sleep(); 1588 1588 1589 + /* 1590 + * Check if we need to delay processing because of ALUA 1591 + * Active/NonOptimized primary access state.. 1592 + */ 1593 + core_alua_check_nonop_delay(cmd); 1594 + 1589 1595 if (!cmd->se_lun) { 1590 1596 dump_stack(); 1591 1597 pr_err("cmd->se_lun is NULL\n"); ··· 1822 1816 } 1823 1817 1824 1818 } 1825 - 1826 - /* 1827 - * Check if we need to delay processing because of ALUA 1828 - * Active/NonOptimized primary access state.. 1829 - */ 1830 - core_alua_check_nonop_delay(se_cmd); 1831 1819 1832 1820 transport_handle_cdb_direct(se_cmd); 1833 1821 }
-2
include/target/target_core_fabric.h
··· 206 206 void target_wait_for_sess_cmds(struct se_session *); 207 207 void target_show_cmd(const char *pfx, struct se_cmd *cmd); 208 208 209 - int core_alua_check_nonop_delay(struct se_cmd *); 210 - 211 209 int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); 212 210 void core_tmr_release_req(struct se_tmr_req *); 213 211 int transport_generic_handle_tmr(struct se_cmd *);