scsi: target/core: Inline transport_lun_remove_cmd()
authorBart Van Assche <bvanassche@acm.org>
Fri, 25 Jan 2019 18:34:46 +0000 (10:34 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Feb 2019 02:27:20 +0000 (21:27 -0500)
commit83f85b8ec305be9d65284de2921d8eeb6c7fcf12
tree5e889ea7a3879544765763b18202a8364adfd7a6
parent2281c95fe751325874d135b237ecdcd3bc34cc26
scsi: target/core: Inline transport_lun_remove_cmd()

Remove the code that clears .se_lun from transport_cmd_check_stop_to_fabric()
such that the transport_lun_remove_cmd() call can be moved into
target_release_cmd_kref(). Because this guarantees that
transport_lun_remove_cmd() will be called exactly once, it is safe to change
the cmpxchg() call into a test of se_cmd.lun_ref_active. Inline
transport_lun_remove_cmd() because it is not worth to keep it as a separate
function.

Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_transport.c