target: Split transport_send_check_condition_and_sense()
authorBart Van Assche <bart.vanassche@sandisk.com>
Wed, 8 Jul 2015 14:58:51 +0000 (17:58 +0300)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 24 Jul 2015 05:09:28 +0000 (22:09 -0700)
commitab78fef4d5f79134042ae0e1e2c259e1226aa5bd
treea4a1c6a4f79878c412692842c8c278dc29263592
parent46d5bd62ef9e3d6e2018963cbb725c91f864922d
target: Split transport_send_check_condition_and_sense()

Move the code for translating a sense_reason_t code into a SCSI status
ASC and ASCQ codes from transport_send_check_condition_and_sense() into
the new function translate_sense_reason(). Convert the switch statement
that performs the translation into table-driven code.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c