cfq.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #ifndef _CFQ_H
  2. #define _CFQ_H
  3. #include "blk-cgroup.h"
  4. #ifdef CONFIG_CFQ_GROUP_IOSCHED
  5. static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
  6. struct blkio_policy_type *pol,
  7. struct blkio_group *curr_blkg,
  8. bool direction, bool sync)
  9. {
  10. blkiocg_update_io_add_stats(blkg, pol, curr_blkg, direction, sync);
  11. }
  12. static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
  13. struct blkio_policy_type *pol, unsigned long dequeue)
  14. {
  15. blkiocg_update_dequeue_stats(blkg, pol, dequeue);
  16. }
  17. static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
  18. struct blkio_policy_type *pol, unsigned long time,
  19. unsigned long unaccounted_time)
  20. {
  21. blkiocg_update_timeslice_used(blkg, pol, time, unaccounted_time);
  22. }
  23. static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
  24. struct blkio_policy_type *pol)
  25. {
  26. blkiocg_set_start_empty_time(blkg, pol);
  27. }
  28. static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
  29. struct blkio_policy_type *pol, bool direction,
  30. bool sync)
  31. {
  32. blkiocg_update_io_remove_stats(blkg, pol, direction, sync);
  33. }
  34. static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
  35. struct blkio_policy_type *pol, bool direction,
  36. bool sync)
  37. {
  38. blkiocg_update_io_merged_stats(blkg, pol, direction, sync);
  39. }
  40. static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
  41. struct blkio_policy_type *pol)
  42. {
  43. blkiocg_update_idle_time_stats(blkg, pol);
  44. }
  45. static inline void
  46. cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
  47. struct blkio_policy_type *pol)
  48. {
  49. blkiocg_update_avg_queue_size_stats(blkg, pol);
  50. }
  51. static inline void
  52. cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
  53. struct blkio_policy_type *pol)
  54. {
  55. blkiocg_update_set_idle_time_stats(blkg, pol);
  56. }
  57. static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
  58. struct blkio_policy_type *pol, uint64_t bytes,
  59. bool direction, bool sync)
  60. {
  61. blkiocg_update_dispatch_stats(blkg, pol, bytes, direction, sync);
  62. }
  63. static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
  64. struct blkio_policy_type *pol, uint64_t start_time,
  65. uint64_t io_start_time, bool direction, bool sync)
  66. {
  67. blkiocg_update_completion_stats(blkg, pol, start_time, io_start_time,
  68. direction, sync);
  69. }
  70. static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg)
  71. {
  72. return blkiocg_del_blkio_group(blkg);
  73. }
  74. #else /* CFQ_GROUP_IOSCHED */
  75. static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
  76. struct blkio_policy_type *pol,
  77. struct blkio_group *curr_blkg, bool direction,
  78. bool sync) { }
  79. static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
  80. struct blkio_policy_type *pol, unsigned long dequeue) { }
  81. static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
  82. struct blkio_policy_type *pol, unsigned long time,
  83. unsigned long unaccounted_time) { }
  84. static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
  85. struct blkio_policy_type *pol) { }
  86. static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
  87. struct blkio_policy_type *pol, bool direction,
  88. bool sync) { }
  89. static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
  90. struct blkio_policy_type *pol, bool direction,
  91. bool sync) { }
  92. static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
  93. struct blkio_policy_type *pol) { }
  94. static inline void
  95. cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
  96. struct blkio_policy_type *pol) { }
  97. static inline void
  98. cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
  99. struct blkio_policy_type *pol) { }
  100. static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
  101. struct blkio_policy_type *pol, uint64_t bytes,
  102. bool direction, bool sync) { }
  103. static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
  104. struct blkio_policy_type *pol, uint64_t start_time,
  105. uint64_t io_start_time, bool direction, bool sync) { }
  106. static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg)
  107. {
  108. return 0;
  109. }
  110. #endif /* CFQ_GROUP_IOSCHED */
  111. #endif