On 10/03/2012 09:58 AM, Christoph Hellwig wrote: > On Tue, Oct 02, 2012 at 12:24:26AM -0700, Nicholas A. Bellinger wrote: >> For iscsi-target this ends up being overly complicated with the multiple >> combinations of immediate data + unsolicited data-out in the existing >> code paths. Andy mentioned doing this once before and I thought it >> would end up adding too much complexity to target_submit_cmd() for the >> benefit, but am still happy to be proved wrong here. ;) > > It seems like we could just delay the submission long enough to always > be able to use target_submit_cmd, but I'll let Andy speak if he's deeper > into this. I was trying to refactor iscsit_handle_scsi_cmd until the following functions were called in order: transport_init_se_cmd target_get_sess_cmd transport_lookup_cmd_lun transport_generic_setup_cmd_from_cdb core_alua_check_nonop_delay; transport_handle_cdb_direct and then these could all be replaced by one call to target_submit_cmd. I got hung up on refactoring, while also keeping the error cases the same as the existing code. Damn gotos threw me, and combining immediate vs non-immediate paths. Also, there are some intermingled iscsi-only calls that would need to be hoisted out of the 6-call sequence above. HTH -- Andy -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html