Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Sep 2019 19:48:36 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r352773 - stable/11/sys/cam/scsi
Message-ID:  <201909261948.x8QJma1w008618@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Sep 26 19:48:36 2019
New Revision: 352773
URL: https://svnweb.freebsd.org/changeset/base/352773

Log:
  MFC r349342 (by imp):
  Use the cam_ed copy of ata_params rather than malloc and freeing
  memory for it. This reaches into internal bits of xpt a little, and
  I'll clean that up later.

Modified:
  stable/11/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/11/sys/cam/scsi/scsi_da.c	Thu Sep 26 19:47:54 2019	(r352772)
+++ stable/11/sys/cam/scsi/scsi_da.c	Thu Sep 26 19:48:36 2019	(r352773)
@@ -60,6 +60,9 @@ __FBSDID("$FreeBSD$");
 #include <cam/cam_ccb.h>
 #include <cam/cam_periph.h>
 #include <cam/cam_xpt_periph.h>
+#ifdef _KERNEL
+#include <cam/cam_xpt_internal.h>
+#endif /* _KERNEL */
 #include <cam/cam_sim.h>
 #include <cam/cam_iosched.h>
 
@@ -3373,16 +3376,8 @@ out:
 			break;
 		}
 
-		ata_params = (struct ata_params*)
-			malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO);
+		ata_params = &periph->path->device->ident_data;
 
-		if (ata_params == NULL) {
-			xpt_print(periph->path, "Couldn't malloc ata_params "
-			    "data\n");
-			/* da_free_periph??? */
-			break;
-		}
-
 		scsi_ata_identify(&start_ccb->csio,
 				  /*retries*/da_retry_count,
 				  /*cbfcnp*/dadone,
@@ -4961,7 +4956,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
 			}
 		}
 
-		free(ata_params, M_SCSIDA);
 		if ((softc->zone_mode == DA_ZONE_HOST_AWARE)
 		 || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) {
 			/*



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