Index: sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
===================================================================
--- sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c	(revision 261962)
+++ sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c	(working copy)
@@ -669,22 +669,6 @@
 }
 
 /**
- * @brief callback function for completing a single LUN scan
- *
- * This function is responsible for waking up the executer of
- * the scan LUN CCB action (cam_periph_runccb.)  cam_periph_ccbwait
- * sleeps on the mutex being signaled.
- *
- * @param periph a pointer to a CAM peripheral
- * @param done_ccb pointer to CAM control block
- */
-static void
-storvsc_xptdone(struct cam_periph *periph, union ccb *done_ccb)
-{
-	wakeup(&done_ccb->ccb_h.cbfcnp);
-}
-
-/**
  * @brief scan for attached logical unit numbers (LUNs)
  *
  * In Hyper-V there is no backend changed device operation which
@@ -698,52 +682,25 @@
 static void
 scan_for_luns(struct storvsc_softc *sc)
 {
-	union ccb *request_ccb;
-	struct cam_path *path = sc->hs_path;
-	struct cam_path *my_path = NULL;
-	cam_status status;
+	union ccb *ccb;
 	int lun_nb = 0;
-	int error;
 
-	request_ccb = malloc(sizeof(union ccb), M_CAMXPT, M_WAITOK);
-	my_path = malloc(sizeof(*my_path), M_CAMXPT, M_WAITOK);
-
 	mtx_lock(&sc->hs_lock);
 	do {
 		/*
 		 * Scan the next LUN. Reuse path and ccb structs.
 		 */
-		bzero(my_path, sizeof(*my_path));
-		bzero(request_ccb, sizeof(*request_ccb));
-		status = xpt_compile_path(my_path,
-				  xpt_periph,
-				  path->bus->path_id,
-				  0,
-				  lun_nb);
-
-		if (status != CAM_REQ_CMP) {
-			mtx_unlock(&sc->hs_lock);
-	       		xpt_print(path, "scan_for_lunYYY: can't compile"
-					 " path, 0x%p can't continue\n",
-					 sc->hs_path);
-			free(request_ccb, M_CAMXPT);
-			free(my_path, M_CAMXPT);
-			return;
-		}
-
-		xpt_setup_ccb(&request_ccb->ccb_h, my_path, 5);
-		request_ccb->ccb_h.func_code = XPT_SCAN_LUN;
-		request_ccb->ccb_h.cbfcnp    = storvsc_xptdone;
-		request_ccb->crcn.flags	     = CAM_FLAG_NONE;
-
-		error = cam_periph_runccb(request_ccb, NULL, 
-						CAM_FLAG_NONE, 0, NULL);
-		KASSERT(error == 0, ("cam_periph_runccb failed %d\n", error));
-		xpt_release_path(my_path);
+                if ((ccb = xpt_alloc_ccb()) == NULL)
+                        return;
+                if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+                    sc->hs_path->bus->path_id,
+                    0, lun_nb) != CAM_REQ_CMP) {
+                        xpt_free_ccb(ccb);
+                        return;
+                }
+                xpt_rescan(ccb);
 	} while ( ++lun_nb < sc->hs_drv_props->drv_max_luns_per_target);
 	mtx_unlock(&sc->hs_lock);
-	free(request_ccb, M_CAMXPT);
-	free(my_path, M_CAMXPT);
 }
 
 /**
