scsi_lib.c (a9d6ceb838755c24dde8a0ca02c3378926fc63db) | scsi_lib.c (7e782af57649f8a8e943d80104c946a5cd7af7cc) |
---|---|
1/* 2 * scsi_lib.c Copyright (C) 1999 Eric Youngdale 3 * 4 * SCSI queueing library. 5 * Initial versions: Eric Youngdale (eric@andante.org). 6 * Based upon conversations with large numbers 7 * of people at Linux Expo. 8 */ --- 713 unchanged lines hidden (view full) --- 722 * @result: scsi error code 723 * 724 * Translate SCSI error code into standard UNIX errno. 725 * Return values: 726 * -ENOLINK temporary transport failure 727 * -EREMOTEIO permanent target failure, do not retry 728 * -EBADE permanent nexus failure, retry on other path 729 * -ENOSPC No write space available | 1/* 2 * scsi_lib.c Copyright (C) 1999 Eric Youngdale 3 * 4 * SCSI queueing library. 5 * Initial versions: Eric Youngdale (eric@andante.org). 6 * Based upon conversations with large numbers 7 * of people at Linux Expo. 8 */ --- 713 unchanged lines hidden (view full) --- 722 * @result: scsi error code 723 * 724 * Translate SCSI error code into standard UNIX errno. 725 * Return values: 726 * -ENOLINK temporary transport failure 727 * -EREMOTEIO permanent target failure, do not retry 728 * -EBADE permanent nexus failure, retry on other path 729 * -ENOSPC No write space available |
730 * -ENODATA Medium error |
|
730 * -EIO unspecified I/O error 731 */ 732static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result) 733{ 734 int error = 0; 735 736 switch(host_byte(result)) { 737 case DID_TRANSPORT_FAILFAST: --- 6 unchanged lines hidden (view full) --- 744 case DID_NEXUS_FAILURE: 745 set_host_byte(cmd, DID_OK); 746 error = -EBADE; 747 break; 748 case DID_ALLOC_FAILURE: 749 set_host_byte(cmd, DID_OK); 750 error = -ENOSPC; 751 break; | 731 * -EIO unspecified I/O error 732 */ 733static int __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result) 734{ 735 int error = 0; 736 737 switch(host_byte(result)) { 738 case DID_TRANSPORT_FAILFAST: --- 6 unchanged lines hidden (view full) --- 745 case DID_NEXUS_FAILURE: 746 set_host_byte(cmd, DID_OK); 747 error = -EBADE; 748 break; 749 case DID_ALLOC_FAILURE: 750 set_host_byte(cmd, DID_OK); 751 error = -ENOSPC; 752 break; |
753 case DID_MEDIUM_ERROR: 754 set_host_byte(cmd, DID_OK); 755 error = -ENODATA; 756 break; |
|
752 default: 753 error = -EIO; 754 break; 755 } 756 757 return error; 758} 759 --- 1912 unchanged lines hidden --- | 757 default: 758 error = -EIO; 759 break; 760 } 761 762 return error; 763} 764 --- 1912 unchanged lines hidden --- |