Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Apr 2016 05:10:39 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298037 - in head/sys/cam: ata scsi
Message-ID:  <201604150510.u3F5AdwY083815@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Apr 15 05:10:39 2016
New Revision: 298037
URL: https://svnweb.freebsd.org/changeset/base/298037

Log:
  Expand CAM_IO_STATS #ifdef to logical unit.

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

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Fri Apr 15 05:10:32 2016	(r298036)
+++ head/sys/cam/ata/ata_da.c	Fri Apr 15 05:10:39 2016	(r298037)
@@ -2175,6 +2175,7 @@ out:
 static int
 adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
 {
+#ifdef CAM_IO_STATS
 	struct ada_softc *softc;
 	struct cam_periph *periph;
 
@@ -2183,9 +2184,7 @@ adaerror(union ccb *ccb, u_int32_t cam_f
 
 	switch (ccb->ccb_h.status & CAM_STATUS_MASK) {
 	case CAM_CMD_TIMEOUT:
-#ifdef CAM_IO_STATS
 		softc->timeouts++;
-#endif
 		break;
 	case CAM_REQ_ABORTED:
 	case CAM_REQ_CMP_ERR:
@@ -2193,13 +2192,12 @@ adaerror(union ccb *ccb, u_int32_t cam_f
 	case CAM_UNREC_HBA_ERROR:
 	case CAM_DATA_RUN_ERR:
 	case CAM_ATA_STATUS_ERROR:
-#ifdef CAM_IO_STATS
 		softc->errors++;
-#endif
 		break;
 	default:
 		break;
 	}
+#endif
 
 	return(cam_periph_error(ccb, cam_flags, sense_flags, NULL));
 }

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Apr 15 05:10:32 2016	(r298036)
+++ head/sys/cam/scsi/scsi_da.c	Fri Apr 15 05:10:39 2016	(r298037)
@@ -3773,24 +3773,22 @@ daerror(union ccb *ccb, u_int32_t cam_fl
 	if (error == ERESTART)
 		return (ERESTART);
 
+#ifdef CAM_IO_STATS
 	switch (ccb->ccb_h.status & CAM_STATUS_MASK) {
 	case CAM_CMD_TIMEOUT:
-#ifdef CAM_IO_STATS
 		softc->timeouts++;
-#endif
 		break;
 	case CAM_REQ_ABORTED:
 	case CAM_REQ_CMP_ERR:
 	case CAM_REQ_TERMIO:
 	case CAM_UNREC_HBA_ERROR:
 	case CAM_DATA_RUN_ERR:
-#ifdef CAM_IO_STATS
 		softc->errors++;
-#endif
 		break;
 	default:
 		break;
 	}
+#endif
 
 	/*
 	 * XXX



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