cfq.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. #else /* CFQ_GROUP_IOSCHED */
  71. static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
  72. struct blkio_policy_type *pol,
  73. struct blkio_group *curr_blkg, bool direction,
  74. bool sync) { }
  75. static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
  76. struct blkio_policy_type *pol, unsigned long dequeue) { }
  77. static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
  78. struct blkio_policy_type *pol, unsigned long time,
  79. unsigned long unaccounted_time) { }
  80. static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg,
  81. struct blkio_policy_type *pol) { }
  82. static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
  83. struct blkio_policy_type *pol, bool direction,
  84. bool sync) { }
  85. static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
  86. struct blkio_policy_type *pol, bool direction,
  87. bool sync) { }
  88. static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg,
  89. struct blkio_policy_type *pol) { }
  90. static inline void
  91. cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg,
  92. struct blkio_policy_type *pol) { }
  93. static inline void
  94. cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg,
  95. struct blkio_policy_type *pol) { }
  96. static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
  97. struct blkio_policy_type *pol, uint64_t bytes,
  98. bool direction, bool sync) { }
  99. static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg,
  100. struct blkio_policy_type *pol, uint64_t start_time,
  101. uint64_t io_start_time, bool direction, bool sync) { }
  102. #endif /* CFQ_GROUP_IOSCHED */
  103. #endif