Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Nov 2020 13:05:11 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367953 - head/sys/dev/firewire
Message-ID:  <202011231305.0AND5Be3044222@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Nov 23 13:05:11 2020
New Revision: 367953
URL: https://svnweb.freebsd.org/changeset/base/367953

Log:
  Make sbp(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.
  
  Reviewed by:	imp, mav
  MFC after:	2 weeks
  Sponsored by:	NetApp, Inc.
  Sponsored by:	Klara, Inc.
  Differential Revision:	https://reviews.freebsd.org/D26843

Modified:
  head/sys/dev/firewire/sbp.c

Modified: head/sys/dev/firewire/sbp.c
==============================================================================
--- head/sys/dev/firewire/sbp.c	Mon Nov 23 13:02:23 2020	(r367952)
+++ head/sys/dev/firewire/sbp.c	Mon Nov 23 13:05:11 2020	(r367953)
@@ -987,7 +987,7 @@ END_DEBUG
 	sdev = sbp_next_dev(target, sdev->lun_id + 1);
 	if (sdev == NULL) {
 		SBP_UNLOCK(sbp);
-		free(ccb, M_SBP);
+		xpt_free_ccb(ccb);
 		return;
 	}
 	/* reuse ccb */
@@ -1019,9 +1019,9 @@ SBP_DEBUG(0)
 	device_printf(sdev->target->sbp->fd.dev,
 		"%s:%s\n", __func__, sdev->bustgtlun);
 END_DEBUG
-	ccb = malloc(sizeof(union ccb), M_SBP, M_NOWAIT | M_ZERO);
+	ccb = xpt_alloc_ccb_nowait();
 	if (ccb == NULL) {
-		printf("sbp_cam_scan_target: malloc failed\n");
+		printf("sbp_cam_scan_target: xpt_alloc_ccb_nowait() failed\n");
 		return;
 	}
 	SBP_UNLOCK(target->sbp);



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