summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2008-12-17 10:49:03 +0000
committertrasz <trasz@FreeBSD.org>2008-12-17 10:49:03 +0000
commitbaed8aaae54e47b5ef994a307febc994595b0e50 (patch)
treeadd6f77bf4268f51f0c1d29280a3956466d5fb4b /sys/cam
parent3d8066935651e8c54e600a1b763b99b916115e44 (diff)
downloadFreeBSD-src-baed8aaae54e47b5ef994a307febc994595b0e50.zip
FreeBSD-src-baed8aaae54e47b5ef994a307febc994595b0e50.tar.gz
Revert r186186 for now; it breaks stuff.
Approved by: rwatson (mentor)
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_periph.c4
-rw-r--r--sys/cam/cam_xpt.c3
-rw-r--r--sys/cam/scsi/scsi_da.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 907c801..26fbc6e 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -311,6 +311,8 @@ cam_periph_hold(struct cam_periph *periph, int priority)
struct mtx *mtx;
int error;
+ mtx_assert(periph->sim->mtx, MA_OWNED);
+
/*
* Increment the reference count on the peripheral
* while we wait for our lock attempt to succeed
@@ -322,8 +324,6 @@ cam_periph_hold(struct cam_periph *periph, int priority)
return (ENXIO);
mtx = periph->sim->mtx;
- mtx_assert(mtx, MA_OWNED);
-
if (mtx == &Giant)
mtx = NULL;
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 755a798..cf3fa2c 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1595,7 +1595,7 @@ xpt_remove_periph(struct cam_periph *periph)
{
struct cam_ed *device;
- cam_periph_lock(periph);
+ mtx_assert(periph->sim->mtx, MA_OWNED);
device = periph->path->device;
@@ -1615,7 +1615,6 @@ xpt_remove_periph(struct cam_periph *periph)
mtx_lock(&xsoftc.xpt_topo_lock);
xsoftc.xpt_generation++;
mtx_unlock(&xsoftc.xpt_topo_lock);
- cam_periph_unlock(periph);
}
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 3e1b233..f63a9b0 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -772,8 +772,8 @@ daclose(struct disk *dp)
softc->flags &= ~DA_FLAG_OPEN;
cam_periph_unhold(periph);
- cam_periph_unlock(periph);
cam_periph_release(periph);
+ cam_periph_unlock(periph);
return (0);
}
@@ -995,8 +995,10 @@ dacleanup(struct cam_periph *periph)
xpt_print(periph->path, "can't remove sysctl context\n");
}
+ cam_periph_unlock(periph);
disk_destroy(softc->disk);
callout_drain(&softc->sendordered_c);
+ cam_periph_lock(periph);
free(softc, M_DEVBUF);
}
OpenPOWER on IntegriCloud