2
0

910-kobject_uevent.patch 903 B

1234567891011121314151617181920212223242526272829303132333435
  1. From 0d37e6edc09c99e683dd91ca0e83bbc0df8477b3 Mon Sep 17 00:00:00 2001
  2. From: Felix Fietkau <[email protected]>
  3. Date: Sun, 16 Jul 2017 16:56:10 +0200
  4. Subject: lib: add uevent_next_seqnum()
  5. Signed-off-by: Felix Fietkau <[email protected]>
  6. ---
  7. include/linux/kobject.h | 2 ++
  8. lib/kobject_uevent.c | 6 ++++++
  9. 2 files changed, 8 insertions(+)
  10. --- a/include/linux/kobject.h
  11. +++ b/include/linux/kobject.h
  12. @@ -219,4 +219,6 @@ int kobject_synth_uevent(struct kobject
  13. __printf(2, 3)
  14. int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
  15. +u64 uevent_next_seqnum(void);
  16. +
  17. #endif /* _KOBJECT_H_ */
  18. --- a/lib/kobject_uevent.c
  19. +++ b/lib/kobject_uevent.c
  20. @@ -178,6 +178,12 @@ out:
  21. return r;
  22. }
  23. +u64 uevent_next_seqnum(void)
  24. +{
  25. + return atomic64_inc_return(&uevent_seqnum);
  26. +}
  27. +EXPORT_SYMBOL_GPL(uevent_next_seqnum);
  28. +
  29. /**
  30. * kobject_synth_uevent - send synthetic uevent with arguments
  31. *