summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-04-16 19:42:23 +0000
committerscottl <scottl@FreeBSD.org>2007-04-16 19:42:23 +0000
commit0fb3bd60b327b9fcc42f733529ae14d675207734 (patch)
tree41dea5683155fb4f2c32592d2e847279ba8ec4d8 /sys/cam
parent2cbe46fbfa2cd6c2c57c3e2d707e365829d31f72 (diff)
downloadFreeBSD-src-0fb3bd60b327b9fcc42f733529ae14d675207734.zip
FreeBSD-src-0fb3bd60b327b9fcc42f733529ae14d675207734.tar.gz
Drop the topology lock before calling the periph oninvalidate and dtor
vectors.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_periph.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index c0feec6..e2e5303 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -501,7 +501,6 @@ cam_periph_invalidate(struct cam_periph *periph)
static void
camperiphfree(struct cam_periph *periph)
{
- int s;
struct periph_driver **p_drv;
for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {
@@ -512,15 +511,13 @@ camperiphfree(struct cam_periph *periph)
printf("camperiphfree: attempt to free non-existant periph\n");
return;
}
-
- if (periph->periph_dtor != NULL)
- periph->periph_dtor(periph);
-
- s = splsoftcam();
+
TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links);
(*p_drv)->generation++;
- splx(s);
+ xpt_unlock_buses();
+ if (periph->periph_dtor != NULL)
+ periph->periph_dtor(periph);
xpt_remove_periph(periph);
if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) {
@@ -549,6 +546,7 @@ camperiphfree(struct cam_periph *periph)
}
xpt_free_path(periph->path);
free(periph, M_CAMPERIPH);
+ xpt_lock_buses();
}
/*
OpenPOWER on IntegriCloud