mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
dlm: use spin_lock_bh for message processing
Use spin_lock_bh for all spinlocks involved in message processing, in preparation for softirq message processing. DLM lock requests from user space involve dlm processing in user context, in addition to the standard kernel context, necessitating bh variants. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
committed by
David Teigland
parent
308533b4b1
commit
578acf9a87
@@ -867,36 +867,36 @@ static void process_dlm_messages(struct work_struct *work)
|
||||
{
|
||||
struct processqueue_entry *pentry;
|
||||
|
||||
spin_lock(&processqueue_lock);
|
||||
spin_lock_bh(&processqueue_lock);
|
||||
pentry = list_first_entry_or_null(&processqueue,
|
||||
struct processqueue_entry, list);
|
||||
if (WARN_ON_ONCE(!pentry)) {
|
||||
process_dlm_messages_pending = false;
|
||||
spin_unlock(&processqueue_lock);
|
||||
spin_unlock_bh(&processqueue_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
list_del(&pentry->list);
|
||||
atomic_dec(&processqueue_count);
|
||||
spin_unlock(&processqueue_lock);
|
||||
spin_unlock_bh(&processqueue_lock);
|
||||
|
||||
for (;;) {
|
||||
dlm_process_incoming_buffer(pentry->nodeid, pentry->buf,
|
||||
pentry->buflen);
|
||||
free_processqueue_entry(pentry);
|
||||
|
||||
spin_lock(&processqueue_lock);
|
||||
spin_lock_bh(&processqueue_lock);
|
||||
pentry = list_first_entry_or_null(&processqueue,
|
||||
struct processqueue_entry, list);
|
||||
if (!pentry) {
|
||||
process_dlm_messages_pending = false;
|
||||
spin_unlock(&processqueue_lock);
|
||||
spin_unlock_bh(&processqueue_lock);
|
||||
break;
|
||||
}
|
||||
|
||||
list_del(&pentry->list);
|
||||
atomic_dec(&processqueue_count);
|
||||
spin_unlock(&processqueue_lock);
|
||||
spin_unlock_bh(&processqueue_lock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -966,14 +966,14 @@ again:
|
||||
memmove(con->rx_leftover_buf, pentry->buf + ret,
|
||||
con->rx_leftover);
|
||||
|
||||
spin_lock(&processqueue_lock);
|
||||
spin_lock_bh(&processqueue_lock);
|
||||
ret = atomic_inc_return(&processqueue_count);
|
||||
list_add_tail(&pentry->list, &processqueue);
|
||||
if (!process_dlm_messages_pending) {
|
||||
process_dlm_messages_pending = true;
|
||||
queue_work(process_workqueue, &process_work);
|
||||
}
|
||||
spin_unlock(&processqueue_lock);
|
||||
spin_unlock_bh(&processqueue_lock);
|
||||
|
||||
if (ret > DLM_MAX_PROCESS_BUFFERS)
|
||||
return DLM_IO_FLUSH;
|
||||
|
||||
Reference in New Issue
Block a user