[Midnightbsd-cvs] src [9127] trunk/sys/cam: use wrappers for mutex ops

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Oct 1 20:38:54 EDT 2016


Revision: 9127
          http://svnweb.midnightbsd.org/src/?rev=9127
Author:   laffer1
Date:     2016-10-01 20:38:54 -0400 (Sat, 01 Oct 2016)
Log Message:
-----------
use wrappers for mutex ops

Modified Paths:
--------------
    trunk/sys/cam/ata/ata_da.c
    trunk/sys/cam/scsi/scsi_cd.c
    trunk/sys/cam/scsi/scsi_da.c
    trunk/sys/cam/scsi/scsi_pass.c

Modified: trunk/sys/cam/ata/ata_da.c
===================================================================
--- trunk/sys/cam/ata/ata_da.c	2016-10-02 00:38:35 UTC (rev 9126)
+++ trunk/sys/cam/ata/ata_da.c	2016-10-02 00:38:54 UTC (rev 9127)
@@ -1250,7 +1250,7 @@
 	 * Register this media as a disk
 	 */
 	(void)cam_periph_hold(periph, PRIBIO);
-	mtx_unlock(periph->sim->mtx);
+	cam_periph_unlock(periph);
 	snprintf(announce_buf, sizeof(announce_buf),
 	    "kern.cam.ada.%d.quirks", periph->unit_number);
 	quirks = softc->quirks;
@@ -1341,7 +1341,7 @@
 	} else
 		legacy_id = -1;
 	disk_create(softc->disk, DISK_VERSION);
-	mtx_lock(periph->sim->mtx);
+	cam_periph_lock(periph);
 	cam_periph_unhold(periph);
 
 	dp = &softc->params;

Modified: trunk/sys/cam/scsi/scsi_cd.c
===================================================================
--- trunk/sys/cam/scsi/scsi_cd.c	2016-10-02 00:38:35 UTC (rev 9126)
+++ trunk/sys/cam/scsi/scsi_cd.c	2016-10-02 00:38:54 UTC (rev 9127)
@@ -1446,7 +1446,7 @@
 				softc->changer->flags |= CHANGER_MANUAL_CALL;
 				cdrunchangerqueue(softc->changer);
 			} else
-				msleep(&softc->changer, periph->sim->mtx,
+				cam_periph_sleep(periph, &softc->changer,
 				    PRIBIO, "cgticb", 0);
 		}
 	}

Modified: trunk/sys/cam/scsi/scsi_da.c
===================================================================
--- trunk/sys/cam/scsi/scsi_da.c	2016-10-02 00:38:35 UTC (rev 9126)
+++ trunk/sys/cam/scsi/scsi_da.c	2016-10-02 00:38:54 UTC (rev 9127)
@@ -985,7 +985,7 @@
 	dareprobe(periph);
 
 	/* Wait for the disk size update.  */
-	error = msleep(&softc->disk->d_mediasize, periph->sim->mtx, PRIBIO,
+	error = cam_periph_sleep(periph, &softc->disk->d_mediasize, PRIBIO,
 	    "dareprobe", 0);
 	if (error != 0)
 		xpt_print(periph->path, "unable to retrieve capacity data");
@@ -1676,7 +1676,7 @@
 	    (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL,
 	    dasendorderedtag, softc);
 
-	mtx_unlock(periph->sim->mtx);
+	cam_periph_unlock(periph);
 	/*
 	 * RBC devices don't have to support READ(6), only READ(10).
 	 */
@@ -1759,12 +1759,12 @@
 	if (cam_periph_acquire(periph) != CAM_REQ_CMP) {
 		xpt_print(periph->path, "%s: lost periph during "
 			  "registration!\n", __func__);
-		mtx_lock(periph->sim->mtx);
+		cam_periph_lock(periph);
 		return (CAM_REQ_CMP_ERR);
 	}
 
 	disk_create(softc->disk, DISK_VERSION);
-	mtx_lock(periph->sim->mtx);
+	cam_periph_lock(periph);
 
 	/*
 	 * Add async callbacks for events of interest.

Modified: trunk/sys/cam/scsi/scsi_pass.c
===================================================================
--- trunk/sys/cam/scsi/scsi_pass.c	2016-10-02 00:38:35 UTC (rev 9126)
+++ trunk/sys/cam/scsi/scsi_pass.c	2016-10-02 00:38:54 UTC (rev 9127)
@@ -381,7 +381,7 @@
 	 * know what the blocksize of this device is, if 
 	 * it even has a blocksize.
 	 */
-	mtx_unlock(periph->sim->mtx);
+	cam_periph_unlock(periph);
 	no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0;
 	softc->device_stats = devstat_new_entry("pass",
 			  periph->unit_number, 0,
@@ -417,7 +417,7 @@
 	 */
 	dev_ref(softc->dev);
 
-	mtx_lock(periph->sim->mtx);
+	cam_periph_lock(periph);
 	softc->dev->si_drv1 = periph;
 
 	TASK_INIT(&softc->add_physpath_task, /*priority*/0,



More information about the Midnightbsd-cvs mailing list