Skip to content

Commit a77b32d

Browse files
KAGA-KOKOmartinkpetersen
authored andcommitted
scsi: core: Rename __scsi_error_from_host_byte() into scsi_result_to_blk_status()
Since the next patch will modify this function such that it checks more than just the host byte of the SCSI result, rename __scsi_error_from_host_byte() into scsi_result_to_blk_status(). This patch does not change any functionality. Signed-off-by: Bart Van Assche <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Damien Le Moal <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Lee Duncan <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent cbe095e commit a77b32d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -723,14 +723,14 @@ static bool scsi_end_request(struct request *req, blk_status_t error,
723723
}
724724

725725
/**
726-
* __scsi_error_from_host_byte - translate SCSI error code into errno
727-
* @cmd: SCSI command (unused)
726+
* scsi_result_to_blk_status - translate a SCSI result code into blk_status_t
727+
* @cmd: SCSI command
728728
* @result: scsi error code
729729
*
730-
* Translate SCSI error code into block errors.
730+
* Translate a SCSI result code into a blk_status_t value. May reset the host
731+
* byte of @cmd->result.
731732
*/
732-
static blk_status_t __scsi_error_from_host_byte(struct scsi_cmnd *cmd,
733-
int result)
733+
static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result)
734734
{
735735
switch (host_byte(result)) {
736736
case DID_TRANSPORT_FAILFAST:
@@ -810,10 +810,10 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
810810
SCSI_SENSE_BUFFERSIZE);
811811
}
812812
if (!sense_deferred)
813-
error = __scsi_error_from_host_byte(cmd, result);
813+
error = scsi_result_to_blk_status(cmd, result);
814814
}
815815
/*
816-
* __scsi_error_from_host_byte may have reset the host_byte
816+
* scsi_result_to_blk_status may have reset the host_byte
817817
*/
818818
scsi_req(req)->result = cmd->result;
819819
scsi_req(req)->resid_len = scsi_get_resid(cmd);
@@ -835,7 +835,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
835835
* good_bytes != blk_rq_bytes(req) as the signal for an error.
836836
* This sets the error explicitly for the problem case.
837837
*/
838-
error = __scsi_error_from_host_byte(cmd, result);
838+
error = scsi_result_to_blk_status(cmd, result);
839839
}
840840

841841
/* no bidi support for !blk_rq_is_passthrough yet */
@@ -905,7 +905,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
905905
if (result == 0)
906906
goto requeue;
907907

908-
error = __scsi_error_from_host_byte(cmd, result);
908+
error = scsi_result_to_blk_status(cmd, result);
909909

910910
if (host_byte(result) == DID_RESET) {
911911
/* Third party bus reset or reset for error recovery

0 commit comments

Comments
 (0)