On 6/27/23 05:24, Alberto Garcia wrote:
On Sun 25 Jun 2023 04:56:27 PM +08, zhenwei pi wrote:
Use enum ThrottleTimerType instead of number index.
+typedef enum {
+ THROTTLE_TIMER_READ = 0,
+ THROTTLE_TIMER_WRITE,
+ THROTTLE_TIMER_MAX
+} ThrottleTimerType;
If you're doing this I suppose you could also change 'bool is_write'
with something like 'ThrottleTimerType timer', i.e
static bool throttle_compute_timer(ThrottleState *ts,
ThrottleTimerType timer,
int64_t now,
int64_t *next_timestamp)
Berto
Hi,
Right, it's in my plan. But I prefer to do this in a followup patch
after this series applies. Because this API leads changes from other
subsystems.
By the way, I prepare to rename 'THROTTLE_TIMER_READ' to 'THROTTLE_READ'
in next version.
Do you have any suggestion?
--
zhenwei pi