git: 5932b2611341 - stable/13 - cam: Unbreak CAM_IO_STATS build

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 06 Dec 2021 15:56:34 UTC
The branch stable/13 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5932b26113418379d9c4d6d0c1ba6536394931f9

commit 5932b26113418379d9c4d6d0c1ba6536394931f9
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-11-24 09:10:53 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-12-06 15:55:58 +0000

    cam: Unbreak CAM_IO_STATS build
    
    Fixes:          6637b7460066
    Sponsored by:   Netflix
    
    (cherry picked from commit 1bc9ca3b35d280cdb0dbefa69bebf687970d1ef6)
---
 sys/cam/nvme/nvme_da.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index f1c9a9ec9fea..7a489afdb993 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -1267,6 +1267,13 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb)
 static int
 ndaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
 {
+#ifdef CAM_IO_STATS
+	struct nda_softc *softc;
+	struct cam_periph *periph;
+
+	periph = xpt_path_periph(ccb->ccb_h.path);
+	softc = (struct nda_softc *)periph->softc;
+#endif
 
 	switch (ccb->ccb_h.status & CAM_STATUS_MASK) {
 	case CAM_CMD_TIMEOUT: