Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jun 2012 10:08:22 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236604 - head/sys/cam/scsi
Message-ID:  <201206051008.q55A8MIR003692@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Jun  5 10:08:22 2012
New Revision: 236604
URL: http://svn.freebsd.org/changeset/base/236604

Log:
  Do not reinvent a wheel and let default error handler do its job.

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Tue Jun  5 09:49:31 2012	(r236603)
+++ head/sys/cam/scsi/scsi_da.c	Tue Jun  5 10:08:22 2012	(r236604)
@@ -1016,30 +1016,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);
 
 	}
@@ -2541,8 +2520,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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206051008.q55A8MIR003692>