svn commit: r237311 - in stable/9/sys/cam: ata scsi
Alexander Motin
mav at FreeBSD.org
Wed Jun 20 14:19:56 UTC 2012
Author: mav
Date: Wed Jun 20 14:19:55 2012
New Revision: 237311
URL: http://svn.freebsd.org/changeset/base/237311
Log:
MFC r236604, r236639:
Do not reinvent a wheel and let default error handler do its job.
Modified:
stable/9/sys/cam/ata/ata_da.c
stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/cam/ata/ata_da.c
==============================================================================
--- stable/9/sys/cam/ata/ata_da.c Wed Jun 20 14:15:39 2012 (r237310)
+++ stable/9/sys/cam/ata/ata_da.c Wed Jun 20 14:19:55 2012 (r237311)
@@ -490,7 +490,7 @@ adaclose(struct disk *dp)
ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0);
else
ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0);
- cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
+ cam_periph_runccb(ccb, adaerror, /*cam_flags*/0,
/*sense_flags*/0, softc->disk->d_devstat);
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c Wed Jun 20 14:15:39 2012 (r237310)
+++ stable/9/sys/cam/scsi/scsi_da.c Wed Jun 20 14:19:55 2012 (r237311)
@@ -1017,30 +1017,9 @@ daclose(struct disk *dp)
SSD_FULL_SIZE,
5 * 60 * 1000);
- cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
- /*sense_flags*/SF_RETRY_UA,
+ cam_periph_runccb(ccb, daerror, /*cam_flags*/0,
+ /*sense_flags*/SF_RETRY_UA | SF_QUIET_IR,
softc->disk->d_devstat);
-
- if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
- if ((ccb->ccb_h.status & CAM_STATUS_MASK) ==
- CAM_SCSI_STATUS_ERROR) {
- int asc, ascq;
- int sense_key, error_code;
-
- scsi_extract_sense_len(&ccb->csio.sense_data,
- ccb->csio.sense_len - ccb->csio.sense_resid,
- &error_code, &sense_key, &asc, &ascq,
- /*show_errors*/ 1);
- if (sense_key != SSD_KEY_ILLEGAL_REQUEST)
- scsi_sense_print(&ccb->csio);
- } else {
- xpt_print(periph->path, "Synchronize cache "
- "failed, status == 0x%x, scsi status == "
- "0x%x\n", ccb->csio.ccb_h.status,
- ccb->csio.scsi_status);
- }
- }
-
xpt_release_ccb(ccb);
}
@@ -2498,8 +2477,8 @@ daprevent(struct cam_periph *periph, int
SSD_FULL_SIZE,
5000);
- error = cam_periph_runccb(ccb, /*error_routine*/NULL, CAM_RETRY_SELTO,
- SF_RETRY_UA, softc->disk->d_devstat);
+ error = cam_periph_runccb(ccb, daerror, CAM_RETRY_SELTO,
+ SF_RETRY_UA | SF_QUIET_IR, softc->disk->d_devstat);
if (error == 0) {
if (action == PR_ALLOW)
More information about the svn-src-stable-9
mailing list