/* scsi_noretry_cmd - determinte if command should be failed fast @scmd: SCSI cmd to examine.  */
int scsi_noretry_cmd(struct scsi_cmnd *scmd)
/* scsi_noretry_cmd - determinte if command should be failed fast @scmd: SCSI cmd to examine.  */
int scsi_noretry_cmd(struct scsi_cmnd *scmd)
{
	switch (host_byte(scmd->result)) {
	case DID_OK:
		break;
	case DID_BUS_BUSY:
		return blk_failfast_transport(scmd->request);
	case DID_PARITY:
		return blk_failfast_dev(scmd->request);
	case DID_ERROR:
		if (msg_byte(scmd->result) == COMMAND_COMPLETE &&
		    status_byte(scmd->result) == RESERVATION_CONFLICT)
			return 0;
	case DID_SOFT_ERROR:
		return blk_failfast_driver(scmd->request);
	}
	switch (status_byte(scmd->result)) {
	case CHECK_CONDITION:
		return blk_failfast_dev(scmd->request);
	}
	return 0;
}