mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-05 22:25:16 +00:00
audit: flatten kauditd_thread wait queue code
The wait queue control code in kauditd_thread() was nested deeper than necessary. The function has been flattened for better legibility. Signed-off-by: Richard Guy Briggs <rbriggs@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
b551d1d981
commit
3320c5133d
1 changed files with 14 additions and 14 deletions
|
@ -458,10 +458,11 @@ static void flush_hold_queue(void)
|
||||||
|
|
||||||
static int kauditd_thread(void *dummy)
|
static int kauditd_thread(void *dummy)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
|
||||||
|
|
||||||
set_freezable();
|
set_freezable();
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
|
struct sk_buff *skb;
|
||||||
|
DECLARE_WAITQUEUE(wait, current);
|
||||||
|
|
||||||
flush_hold_queue();
|
flush_hold_queue();
|
||||||
|
|
||||||
skb = skb_dequeue(&audit_skb_queue);
|
skb = skb_dequeue(&audit_skb_queue);
|
||||||
|
@ -471,8 +472,8 @@ static int kauditd_thread(void *dummy)
|
||||||
kauditd_send_skb(skb);
|
kauditd_send_skb(skb);
|
||||||
else
|
else
|
||||||
audit_printk_skb(skb);
|
audit_printk_skb(skb);
|
||||||
} else {
|
continue;
|
||||||
DECLARE_WAITQUEUE(wait, current);
|
}
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
add_wait_queue(&kauditd_wait, &wait);
|
add_wait_queue(&kauditd_wait, &wait);
|
||||||
|
|
||||||
|
@ -484,7 +485,6 @@ static int kauditd_thread(void *dummy)
|
||||||
__set_current_state(TASK_RUNNING);
|
__set_current_state(TASK_RUNNING);
|
||||||
remove_wait_queue(&kauditd_wait, &wait);
|
remove_wait_queue(&kauditd_wait, &wait);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue