aboutsummaryrefslogtreecommitdiff
path: root/sys/cam
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2009-01-10 17:22:49 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2009-01-10 17:22:49 +0000
commit5f3fed855cdbc29ea2af23035888640dd076773b (patch)
tree2833ce928c34d516f5e2377915e4c8e225deee22 /sys/cam
parenta9ebb311831b25896b6bd0f5d0cbb41fdff84095 (diff)
Notes
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_ch.c4
-rw-r--r--sys/cam/scsi/scsi_pass.c9
-rw-r--r--sys/cam/scsi/scsi_pt.c6
-rw-r--r--sys/cam/scsi/scsi_sa.c7
-rw-r--r--sys/cam/scsi/scsi_ses.c5
-rw-r--r--sys/cam/scsi/scsi_sg.c7
6 files changed, 20 insertions, 18 deletions
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index ca4a365da7f8..892deac9b7c0 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -262,9 +262,11 @@ chcleanup(struct cam_periph *periph)
softc = (struct ch_softc *)periph->softc;
+ xpt_print(periph->path, "removing device entry\n");
devstat_remove_entry(softc->device_stats);
+ cam_periph_unlock(periph);
destroy_dev(softc->dev);
- xpt_print(periph->path, "removing device entry\n");
+ cam_periph_lock(periph);
free(softc, M_DEVBUF);
}
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 16ecec4106fd..4dc86de19949 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -165,13 +165,12 @@ passcleanup(struct cam_periph *periph)
softc = (struct pass_softc *)periph->softc;
+ if (bootverbose)
+ xpt_print(periph->path, "removing device entry\n");
devstat_remove_entry(softc->device_stats);
-
+ cam_periph_unlock(periph);
destroy_dev(softc->dev);
-
- if (bootverbose) {
- xpt_print(periph->path, "removing device entry\n");
- }
+ cam_periph_lock(periph);
free(softc, M_DEVBUF);
}
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index d70972e7771b..c41d5e9079b5 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -342,11 +342,11 @@ ptdtor(struct cam_periph *periph)
softc = (struct pt_softc *)periph->softc;
+ xpt_print(periph->path, "removing device entry\n");
devstat_remove_entry(softc->device_stats);
-
+ cam_periph_unlock(periph);
destroy_dev(softc->dev);
-
- xpt_print(periph->path, "removing device entry\n");
+ cam_periph_lock(periph);
free(softc, M_DEVBUF);
}
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index b775cc1cdde8..ef76a9031bcf 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -1377,17 +1377,16 @@ sacleanup(struct cam_periph *periph)
softc = (struct sa_softc *)periph->softc;
+ xpt_print(periph->path, "removing device entry\n");
devstat_remove_entry(softc->device_stats);
-
+ cam_periph_unlock(periph);
destroy_dev(softc->devs.ctl_dev);
-
for (i = 0; i < SA_NUM_MODES; i++) {
destroy_dev(softc->devs.mode_devs[i].r_dev);
destroy_dev(softc->devs.mode_devs[i].nr_dev);
destroy_dev(softc->devs.mode_devs[i].er_dev);
}
-
- xpt_print(periph->path, "removing device entry\n");
+ cam_periph_lock(periph);
free(softc, M_SCSISA);
}
diff --git a/sys/cam/scsi/scsi_ses.c b/sys/cam/scsi/scsi_ses.c
index acd6e514d7d6..14bcc77609d8 100644
--- a/sys/cam/scsi/scsi_ses.c
+++ b/sys/cam/scsi/scsi_ses.c
@@ -227,9 +227,10 @@ sescleanup(struct cam_periph *periph)
softc = (struct ses_softc *)periph->softc;
- destroy_dev(softc->ses_dev);
-
xpt_print(periph->path, "removing device entry\n");
+ cam_periph_unlock(periph);
+ destroy_dev(softc->ses_dev);
+ cam_periph_lock(periph);
free(softc, M_SCSISES);
}
diff --git a/sys/cam/scsi/scsi_sg.c b/sys/cam/scsi/scsi_sg.c
index 6daf6ffd5a26..76ee5fa24baf 100644
--- a/sys/cam/scsi/scsi_sg.c
+++ b/sys/cam/scsi/scsi_sg.c
@@ -200,11 +200,12 @@ sgcleanup(struct cam_periph *periph)
struct sg_softc *softc;
softc = (struct sg_softc *)periph->softc;
+ if (bootverbose)
+ xpt_print(periph->path, "removing device entry\n");
devstat_remove_entry(softc->device_stats);
+ cam_periph_unlock(periph);
destroy_dev(softc->dev);
- if (bootverbose) {
- xpt_print(periph->path, "removing device entry\n");
- }
+ cam_periph_lock(periph);
free(softc, M_DEVBUF);
}