• Nicholas Bellinger's avatar
    target: Convert ->transport_wait_for_tasks usage to transport_generic_free_cmd · d14921d6
    Nicholas Bellinger authored
    This patch converts se_cmd->transport_wait_for_tasks(se_cmd, 1) usage to use
    transport_generic_free_cmd() directly in target-core and iscsi-target fabric
    usage.  The includes:
    
    *) Removal of the optional transport_generic_free_cmd() call from within
       transport_generic_wait_for_tasks()
    *) Usage of existing SCF_SUPPORTED_SAM_OPCODE to determine when
       transport_generic_wait_for_tasks() processing may occur instead of
       checking se_cmd->transport_wait_for_tasks()
    *) Move transport_generic_wait_for_tasks() call ahead of core_dec_lacl_count()
       and transport_lun_remove_cmd() in transport_generic_free_cmd() to follow
       existing logic for iscsi-target w/ se_cmd->transport_wait_for_tasks(se_cmd, 1)
    *) Removal of se_cmd->transport_wait_for_tasks() function pointer
    *) Rename transport_generic_wait_for_tasks() -> transport_wait_for_tasks(), and
       add docbook comment.
    *) Add EXPORT_SYMBOL for transport_wait_for_tasks()
    
    For the case in iscsi_target_erl2.c:iscsit_prepare_cmds_for_realligance()
    where se_cmd->transport_wait_for_tasks(se_cmd, 0) is called, this patch
    adds a direct call to transport_wait_for_tasks().
    
    (hch: Fix transport_generic_free_cmd() usage in iscsit_release_commands_from_conn)
    (nab: Add patch: Ensure that TMRs hit wait_for_tasks logic during release)
    Reported-by: default avatarChristoph Hellwig <hch@lst.de>
    Cc: Christoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    d14921d6
iscsi_target.c 124 KB