1
0

910-kobject_uevent.patch 744 B

1234567891011121314151617181920212223242526272829303132
  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. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  6. ---
  7. include/linux/kobject.h | 5 +++++
  8. lib/kobject_uevent.c | 37 +++++++++++++++++++++++++++++++++++++
  9. 2 files changed, 42 insertions(+)
  10. --- a/lib/kobject_uevent.c
  11. +++ b/lib/kobject_uevent.c
  12. @@ -176,6 +176,18 @@ out:
  13. return r;
  14. }
  15. +u64 uevent_next_seqnum(void)
  16. +{
  17. + u64 seq;
  18. +
  19. + mutex_lock(&uevent_sock_mutex);
  20. + seq = ++uevent_seqnum;
  21. + mutex_unlock(&uevent_sock_mutex);
  22. +
  23. + return seq;
  24. +}
  25. +EXPORT_SYMBOL_GPL(uevent_next_seqnum);
  26. +
  27. /**
  28. * kobject_synth_uevent - send synthetic uevent with arguments
  29. *