int j;
struct sdebug_queue *sqp;
+ lockdep_assert_held(&sdebug_host_list_mutex);
+
for (j = 0, sqp = sdebug_q_arr; j < submit_queues; ++j, ++sqp)
atomic_set(&sqp->blocked, (int)block);
}
modulo = abs(sdebug_every_nth);
if (modulo < 2)
return;
+
+ mutex_lock(&sdebug_host_list_mutex);
block_unblock_all_queues(true);
count = atomic_read(&sdebug_cmnd_count);
atomic_set(&sdebug_cmnd_count, (count / modulo) * modulo);
block_unblock_all_queues(false);
+ mutex_unlock(&sdebug_host_list_mutex);
}
static void clear_queue_stats(void)
int j, k;
struct sdebug_queue *sqp;
+ mutex_lock(&sdebug_host_list_mutex);
block_unblock_all_queues(true);
for (j = 0, sqp = sdebug_q_arr; j < submit_queues;
++j, ++sqp) {
sdebug_ndelay = 0;
}
block_unblock_all_queues(false);
+ mutex_unlock(&sdebug_host_list_mutex);
}
return res;
}
int j, k;
struct sdebug_queue *sqp;
+ mutex_lock(&sdebug_host_list_mutex);
block_unblock_all_queues(true);
for (j = 0, sqp = sdebug_q_arr; j < submit_queues;
++j, ++sqp) {
: DEF_JDELAY;
}
block_unblock_all_queues(false);
+ mutex_unlock(&sdebug_host_list_mutex);
}
return res;
}
if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n > 0) &&
(n <= SDEBUG_CANQUEUE) &&
(sdebug_host_max_queue == 0)) {
+ mutex_lock(&sdebug_host_list_mutex);
block_unblock_all_queues(true);
k = 0;
for (j = 0, sqp = sdebug_q_arr; j < submit_queues;
else
atomic_set(&retired_max_queue, 0);
block_unblock_all_queues(false);
+ mutex_unlock(&sdebug_host_list_mutex);
return count;
}
return -EINVAL;
if (!devip)
return -ENODEV;
+ mutex_lock(&sdebug_host_list_mutex);
block_unblock_all_queues(true);
+
if (qdepth > SDEBUG_CANQUEUE) {
qdepth = SDEBUG_CANQUEUE;
pr_warn("%s: requested qdepth [%d] exceeds canqueue [%d], trim\n", __func__,
if (qdepth != sdev->queue_depth)
scsi_change_queue_depth(sdev, qdepth);
+ block_unblock_all_queues(false);
+ mutex_unlock(&sdebug_host_list_mutex);
+
if (SDEBUG_OPT_Q_NOISE & sdebug_opts)
sdev_printk(KERN_INFO, sdev, "%s: qdepth=%d\n", __func__, qdepth);
- block_unblock_all_queues(false);
+
return sdev->queue_depth;
}