cfq.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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_group *curr_blkg, bool direction, bool sync)
  7. {
  8. blkiocg_update_io_add_stats(blkg, curr_blkg, direction, sync);
  9. }
  10. static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
  11. unsigned long dequeue)
  12. {
  13. blkiocg_update_dequeue_stats(blkg, dequeue);
  14. }
  15. static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
  16. unsigned long time, unsigned long unaccounted_time)
  17. {
  18. blkiocg_update_timeslice_used(blkg, time, unaccounted_time);
  19. }
  20. static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg)
  21. {
  22. blkiocg_set_start_empty_time(blkg);
  23. }
  24. static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
  25. bool direction, bool sync)
  26. {
  27. blkiocg_update_io_remove_stats(blkg, direction, sync);
  28. }
  29. static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
  30. bool direction, bool sync)
  31. {
  32. blkiocg_update_io_merged_stats(blkg, direction, sync);
  33. }
  34. static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg)
  35. {
  36. blkiocg_update_idle_time_stats(blkg);
  37. }
  38. static inline void
  39. cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg)
  40. {
  41. blkiocg_update_avg_queue_size_stats(blkg);
  42. }
  43. static inline void
  44. cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg)
  45. {
  46. blkiocg_update_set_idle_time_stats(blkg);
  47. }
  48. static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
  49. uint64_t bytes, bool direction, bool sync)
  50. {
  51. blkiocg_update_dispatch_stats(blkg, bytes, direction, sync);
  52. }
  53. static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg, uint64_t start_time, uint64_t io_start_time, bool direction, bool sync)
  54. {
  55. blkiocg_update_completion_stats(blkg, start_time, io_start_time,
  56. direction, sync);
  57. }
  58. static inline void cfq_blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
  59. struct blkio_group *blkg, void *key, dev_t dev) {
  60. blkiocg_add_blkio_group(blkcg, blkg, key, dev, BLKIO_POLICY_PROP);
  61. }
  62. static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg)
  63. {
  64. return blkiocg_del_blkio_group(blkg);
  65. }
  66. #else /* CFQ_GROUP_IOSCHED */
  67. static inline void cfq_blkiocg_update_io_add_stats(struct blkio_group *blkg,
  68. struct blkio_group *curr_blkg, bool direction, bool sync) {}
  69. static inline void cfq_blkiocg_update_dequeue_stats(struct blkio_group *blkg,
  70. unsigned long dequeue) {}
  71. static inline void cfq_blkiocg_update_timeslice_used(struct blkio_group *blkg,
  72. unsigned long time, unsigned long unaccounted_time) {}
  73. static inline void cfq_blkiocg_set_start_empty_time(struct blkio_group *blkg) {}
  74. static inline void cfq_blkiocg_update_io_remove_stats(struct blkio_group *blkg,
  75. bool direction, bool sync) {}
  76. static inline void cfq_blkiocg_update_io_merged_stats(struct blkio_group *blkg,
  77. bool direction, bool sync) {}
  78. static inline void cfq_blkiocg_update_idle_time_stats(struct blkio_group *blkg)
  79. {
  80. }
  81. static inline void
  82. cfq_blkiocg_update_avg_queue_size_stats(struct blkio_group *blkg) {}
  83. static inline void
  84. cfq_blkiocg_update_set_idle_time_stats(struct blkio_group *blkg) {}
  85. static inline void cfq_blkiocg_update_dispatch_stats(struct blkio_group *blkg,
  86. uint64_t bytes, bool direction, bool sync) {}
  87. static inline void cfq_blkiocg_update_completion_stats(struct blkio_group *blkg, uint64_t start_time, uint64_t io_start_time, bool direction, bool sync) {}
  88. static inline void cfq_blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
  89. struct blkio_group *blkg, void *key, dev_t dev) {}
  90. static inline int cfq_blkiocg_del_blkio_group(struct blkio_group *blkg)
  91. {
  92. return 0;
  93. }
  94. #endif /* CFQ_GROUP_IOSCHED */
  95. #endif