summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-04-04 19:07:37 +0000
committermav <mav@FreeBSD.org>2013-04-04 19:07:37 +0000
commita67b1a1c2d9e83d48f0fd06931aa167550184a7f (patch)
tree6dada72fabb1da5bfd56b4cd52ecedc765a36625 /sys/cam
parent422504f32b7ec8ce754481ac2371bd8711af7c2c (diff)
downloadFreeBSD-src-a67b1a1c2d9e83d48f0fd06931aa167550184a7f.zip
FreeBSD-src-a67b1a1c2d9e83d48f0fd06931aa167550184a7f.tar.gz
MFprojects/camlock r248931:
Replace some direct mutex operations with wrappers. MFC after: 2 weeks
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ata/ata_da.c4
-rw-r--r--sys/cam/scsi/scsi_cd.c2
-rw-r--r--sys/cam/scsi/scsi_da.c8
-rw-r--r--sys/cam/scsi/scsi_pass.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index d80e483..13a442f 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -1114,7 +1114,7 @@ adaregister(struct cam_periph *periph, void *arg)
* 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;
@@ -1208,7 +1208,7 @@ adaregister(struct cam_periph *periph, void *arg)
} 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;
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 4d536da..8e698cf 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -1446,7 +1446,7 @@ cdgetccb(struct cam_periph *periph, u_int32_t priority)
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);
}
}
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index ed8106b..a7a5db5 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -988,7 +988,7 @@ daopen(struct disk *dp)
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");
@@ -1688,7 +1688,7 @@ daregister(struct cam_periph *periph, void *arg)
(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).
*/
@@ -1773,12 +1773,12 @@ daregister(struct cam_periph *periph, void *arg)
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.
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index f3710c8..cd4182b 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -381,7 +381,7 @@ passregister(struct cam_periph *periph, void *arg)
* 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 @@ passregister(struct cam_periph *periph, void *arg)
*/
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,
OpenPOWER on IntegriCloud