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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to