0039b9f3e866739f8df4f6d250403a56d0b6f6b7
[openwrt.git] / target / linux / generic-2.6 / patches / 213-kobject_uevent.patch
1 Index: linux-2.6.21.7/lib/kobject_uevent.c
2 ===================================================================
3 --- linux-2.6.21.7.orig/lib/kobject_uevent.c
4 +++ linux-2.6.21.7/lib/kobject_uevent.c
5 @@ -30,9 +30,22 @@ u64 uevent_seqnum;
6 char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
7 static DEFINE_SPINLOCK(sequence_lock);
8 #if defined(CONFIG_NET)
9 -static struct sock *uevent_sock;
10 +struct sock *uevent_sock = NULL;
11 +EXPORT_SYMBOL_GPL(uevent_sock);
12 #endif
13
14 +u64 uevent_next_seqnum(void)
15 +{
16 + u64 seq;
17 +
18 + spin_lock(&sequence_lock);
19 + seq = ++uevent_seqnum;
20 + spin_unlock(&sequence_lock);
21 +
22 + return seq;
23 +}
24 +EXPORT_SYMBOL_GPL(uevent_next_seqnum);
25 +
26 static char *action_to_string(enum kobject_action action)
27 {
28 switch (action) {
29 @@ -171,9 +184,7 @@ int kobject_uevent_env(struct kobject *k
30 }
31
32 /* we will send an event, request a new sequence number */
33 - spin_lock(&sequence_lock);
34 - seq = ++uevent_seqnum;
35 - spin_unlock(&sequence_lock);
36 + seq = uevent_next_seqnum();
37 sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);
38
39 #if defined(CONFIG_NET)
This page took 0.037448 seconds and 3 git commands to generate.