scsi: libiscsi: Improve conn_send_pdu API
authorMike Christie <michael.christie@oracle.com>
Thu, 16 Jun 2022 22:45:57 +0000 (17:45 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Jun 2022 01:19:23 +0000 (21:19 -0400)
commit6e637b723d8277cac4d347ea671ab798b70d8fc9
treee26b11105965a47d7dcdb3c71d8d650f20c11f14
parent6d626150d6d1c14f2f3d4f907fd0d4381f2c0d35
scsi: libiscsi: Improve conn_send_pdu API

The conn_send_pdu API is evil in that it returns a pointer to an
iscsi_task, but that task might have been freed already so you can't touch
it. This patch splits the task allocation and transmission, so functions
like iscsi_send_nopout() can access the task before its sent and do
whatever bookkeeping is needed before it is sent.

Link: https://lore.kernel.org/r/20220616224557.115234-10-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c
include/scsi/libiscsi.h