File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 32
32
#include <linux/pid_namespace.h>
33
33
34
34
#include <linux/cn_proc.h>
35
+ #include <linux/locallock.h>
35
36
36
37
/*
37
38
* Size of a cn_msg followed by a proc_event structure. Since the
@@ -54,10 +55,11 @@ static struct cb_id cn_proc_event_id = { CN_IDX_PROC, CN_VAL_PROC };
54
55
55
56
/* proc_event_counts is used as the sequence number of the netlink message */
56
57
static DEFINE_PER_CPU (__u32 , proc_event_counts ) = { 0 };
58
+ static DEFINE_LOCAL_IRQ_LOCK (send_msg_lock );
57
59
58
60
static inline void send_msg (struct cn_msg * msg )
59
61
{
60
- preempt_disable ( );
62
+ local_lock ( send_msg_lock );
61
63
62
64
msg -> seq = __this_cpu_inc_return (proc_event_counts ) - 1 ;
63
65
((struct proc_event * )msg -> data )-> cpu = smp_processor_id ();
@@ -70,7 +72,7 @@ static inline void send_msg(struct cn_msg *msg)
70
72
*/
71
73
cn_netlink_send (msg , 0 , CN_IDX_PROC , GFP_NOWAIT );
72
74
73
- preempt_enable ( );
75
+ local_unlock ( send_msg_lock );
74
76
}
75
77
76
78
void proc_fork_connector (struct task_struct * task )
You can’t perform that action at this time.
0 commit comments