On 24.07.23 12:09, zhenwei pi wrote:
enum ThrottleDirection is already there, use ThrottleDirection instead
of 'bool is_write' for throttle API, also modify related codes from
block, fsdev, cryptodev and tests.

Signed-off-by: zhenwei pi <pizhen...@bytedance.com>
---
  backends/cryptodev.c        |  9 +++++----
  block/throttle-groups.c     |  6 ++++--
  fsdev/qemu-fsdev-throttle.c |  8 +++++---
  include/qemu/throttle.h     |  5 +++--
  tests/unit/test-throttle.c  |  4 ++--
  util/throttle.c             | 31 +++++++++++++++++--------------
  6 files changed, 36 insertions(+), 27 deletions(-)

[...]

diff --git a/util/throttle.c b/util/throttle.c
index 0439028d21..9a37209bb8 100644
--- a/util/throttle.c
+++ b/util/throttle.c
@@ -136,11 +136,11 @@ int64_t throttle_compute_wait(LeakyBucket *bkt)
/* This function compute the time that must be waited while this IO
   *
- * @is_write:   true if the current IO is a write, false if it's a read
+ * @throttle:   throttle direction

The parameter is now named @direction, so this should be changed. (Same in all other comments describing functions in this patch.)

With that done (in all 4 places):

Reviewed-by: Hanna Czenczek <hre...@redhat.com>

   * @ret:        time to wait
   */
  static int64_t throttle_compute_wait_for(ThrottleState *ts,
-                                         bool is_write)
+                                         ThrottleDirection direction)
  {
      BucketType to_check[2][4] = { {THROTTLE_BPS_TOTAL,
                                     THROTTLE_OPS_TOTAL,


Reply via email to