[8.09] kernel: refresh patches
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / patches-2.6.23 / 213-kobject_uevent.patch
1 --- a/lib/kobject_uevent.c
2 +++ b/lib/kobject_uevent.c
3 @@ -40,9 +40,22 @@ u64 uevent_seqnum;
4 char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
5 static DEFINE_SPINLOCK(sequence_lock);
6 #if defined(CONFIG_NET)
7 -static struct sock *uevent_sock;
8 +struct sock *uevent_sock = NULL;
9 +EXPORT_SYMBOL_GPL(uevent_sock);
10 #endif
11
12 +u64 uevent_next_seqnum(void)
13 +{
14 + u64 seq;
15 +
16 + spin_lock(&sequence_lock);
17 + seq = ++uevent_seqnum;
18 + spin_unlock(&sequence_lock);
19 +
20 + return seq;
21 +}
22 +EXPORT_SYMBOL_GPL(uevent_next_seqnum);
23 +
24 /**
25 * kobject_uevent_env - send an uevent with environmental data
26 *
27 @@ -159,9 +172,7 @@ int kobject_uevent_env(struct kobject *k
28 }
29
30 /* we will send an event, request a new sequence number */
31 - spin_lock(&sequence_lock);
32 - seq = ++uevent_seqnum;
33 - spin_unlock(&sequence_lock);
34 + seq = uevent_next_seqnum();
35 sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);
36
37 #if defined(CONFIG_NET)