kernel: split patches folder up into backport, pending and hack folders
[openwrt/staging/wigyori.git] / target / linux / generic / hack-4.9 / 910-kobject_uevent.patch
1 From 0d37e6edc09c99e683dd91ca0e83bbc0df8477b3 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Sun, 16 Jul 2017 16:56:10 +0200
4 Subject: lib: add uevent_next_seqnum()
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8 include/linux/kobject.h | 5 +++++
9 lib/kobject_uevent.c | 37 +++++++++++++++++++++++++++++++++++++
10 2 files changed, 42 insertions(+)
11
12 diff --git a/include/linux/kobject.h b/include/linux/kobject.h
13 --- a/lib/kobject_uevent.c
14 +++ b/lib/kobject_uevent.c
15 @@ -52,6 +52,18 @@ static const char *kobject_actions[] = {
16 [KOBJ_OFFLINE] = "offline",
17 };
18
19 +u64 uevent_next_seqnum(void)
20 +{
21 + u64 seq;
22 +
23 + mutex_lock(&uevent_sock_mutex);
24 + seq = ++uevent_seqnum;
25 + mutex_unlock(&uevent_sock_mutex);
26 +
27 + return seq;
28 +}
29 +EXPORT_SYMBOL_GPL(uevent_next_seqnum);
30 +
31 /**
32 * kobject_action_type - translate action string to numeric type
33 *--- a/include/linux/kobject.h
34 --
35 2.11.0
36