Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2018 21:23:16 +0000 (UTC)
From:      Scott Long <scottl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327741 - head/sys/cam
Message-ID:  <201801092123.w09LNGV1011539@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scottl
Date: Tue Jan  9 21:23:16 2018
New Revision: 327741
URL: https://svnweb.freebsd.org/changeset/base/327741

Log:
  Hold a refcount on the periph while running the allocation
  queue.  This will allow sub-transports to release their
  probe pseudo-device with fewer convoluted restrictions.
  
  Obtained from:	Netflix

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Tue Jan  9 21:12:53 2018	(r327740)
+++ head/sys/cam/cam_xpt.c	Tue Jan  9 21:23:16 2018	(r327741)
@@ -3383,6 +3383,7 @@ xpt_run_allocq(struct cam_periph *periph, int sleep)
 	cam_periph_assert(periph, MA_OWNED);
 	if (periph->periph_allocating)
 		return;
+	cam_periph_doacquire(periph);
 	periph->periph_allocating = 1;
 	CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_allocq(%p)\n", periph));
 	device = periph->path->device;
@@ -3426,6 +3427,7 @@ restart:
 	if (ccb != NULL)
 		xpt_release_ccb(ccb);
 	periph->periph_allocating = 0;
+	cam_periph_release_locked(periph);
 }
 
 static void



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