Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156450666
D44367.id144780.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44367.id144780.diff
View Options
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -166,6 +166,7 @@
struct cam_doneq {
struct mtx_padalign cam_doneq_mtx;
STAILQ_HEAD(, ccb_hdr) cam_doneq;
+ STAILQ_HEAD(, ccb_hdr) tmp;
int cam_doneq_sleep;
};
@@ -5384,19 +5385,18 @@
{
struct cam_doneq *queue = arg;
struct ccb_hdr *ccb_h;
- STAILQ_HEAD(, ccb_hdr) doneq;
- STAILQ_INIT(&doneq);
+ STAILQ_INIT(&queue->tmp);
mtx_lock(&queue->cam_doneq_mtx);
while (1) {
while (STAILQ_EMPTY(&queue->cam_doneq))
msleep(&queue->cam_doneq, &queue->cam_doneq_mtx,
PRIBIO, "-", 0);
- STAILQ_CONCAT(&doneq, &queue->cam_doneq);
+ STAILQ_CONCAT(&queue->tmp, &queue->cam_doneq);
mtx_unlock(&queue->cam_doneq_mtx);
- while ((ccb_h = STAILQ_FIRST(&doneq)) != NULL) {
- STAILQ_REMOVE_HEAD(&doneq, sim_links.stqe);
+ while ((ccb_h = STAILQ_FIRST(&queue->tmp)) != NULL) {
+ STAILQ_REMOVE_HEAD(&queue->tmp, sim_links.stqe);
xpt_done_process(ccb_h);
}
@@ -5409,9 +5409,8 @@
{
struct cam_doneq *queue = arg;
struct ccb_hdr *ccb_h;
- STAILQ_HEAD(, ccb_hdr) doneq;
- STAILQ_INIT(&doneq);
+ STAILQ_INIT(&queue->tmp);
mtx_lock(&queue->cam_doneq_mtx);
while (1) {
while (STAILQ_EMPTY(&queue->cam_doneq)) {
@@ -5420,12 +5419,12 @@
PRIBIO, "-", 0);
queue->cam_doneq_sleep = 0;
}
- STAILQ_CONCAT(&doneq, &queue->cam_doneq);
+ STAILQ_CONCAT(&queue->tmp, &queue->cam_doneq);
mtx_unlock(&queue->cam_doneq_mtx);
THREAD_NO_SLEEPING();
- while ((ccb_h = STAILQ_FIRST(&doneq)) != NULL) {
- STAILQ_REMOVE_HEAD(&doneq, sim_links.stqe);
+ while ((ccb_h = STAILQ_FIRST(&queue->tmp)) != NULL) {
+ STAILQ_REMOVE_HEAD(&queue->tmp, sim_links.stqe);
xpt_done_process(ccb_h);
}
THREAD_SLEEPING_OK();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 14, 6:46 PM (17 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33046757
Default Alt Text
D44367.id144780.diff (1 KB)
Attached To
Mode
D44367: cam: Move temporary queue from stack to softc
Attached
Detach File
Event Timeline
Log In to Comment