qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 6/9] throttle: use enum ThrottleDirection instead of bool


From: Hanna Czenczek
Subject: Re: [PATCH v4 6/9] throttle: use enum ThrottleDirection instead of bool is_write
Date: Thu, 27 Jul 2023 17:41:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

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 <pizhenwei@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 <hreitz@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

[Prev in Thread] Current Thread [Next in Thread]