Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. /* Backport some stuff if needed.
  2. */
  3. #if KERNEL_VERSION(3, 14, 0) > LINUX_VERSION_CODE
  4.  
  5. static inline u32 reciprocal_scale(u32 val, u32 ep_ro)
  6. {
  7. return (u32)(((u64) val * ep_ro) >> 32);
  8. }
  9.  
  10. #endif
  11.  
  12. #if KERNEL_VERSION(3, 15, 0) > LINUX_VERSION_CODE
  13.  
  14. static inline void kvfree(const void *addr)
  15. {
  16. if (is_vmalloc_addr(addr))
  17. vfree(addr);
  18. else
  19. kfree(addr);
  20. }
  21.  
  22. #endif
  23.  
  24. #if KERNEL_VERSION(3, 15, 0) > LINUX_VERSION_CODE
  25.  
  26. #define ktime_get_ns() ktime_to_ns(ktime_get())
  27.  
  28. #endif
  29.  
  30. #if KERNEL_VERSION(3, 18, 0) > LINUX_VERSION_CODE
  31. static inline void qdisc_qstats_backlog_dec(struct Qdisc *sch,
  32. const struct sk_buff *skb)
  33. {
  34. sch->qstats.backlog -= qdisc_pkt_len(skb);
  35. }
  36.  
  37. static inline void qdisc_qstats_backlog_inc(struct Qdisc *sch,
  38. const struct sk_buff *skb)
  39. {
  40. sch->qstats.backlog += qdisc_pkt_len(skb);
  41. }
  42.  
  43. static inline void __qdisc_qstats_drop(struct Qdisc *sch, int count)
  44. {
  45. sch->qstats.drops += count;
  46. }
  47.  
  48. static inline void qdisc_qstats_drop(struct Qdisc *sch)
  49. {
  50. sch->qstats.drops++;
  51. }
  52.  
  53. #define codel_stats_copy_queue(a, b, c, d) gnet_stats_copy_queue(a, c)
  54. #define codel_watchdog_schedule_ns(a, b, c) qdisc_watchdog_schedule_ns(a, b)
  55. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement