throttle: support read-only and write-only
authorzhenwei pi <pizhenwei@bytedance.com>
Fri, 28 Jul 2023 02:20:00 +0000 (10:20 +0800)
committerHanna Czenczek <hreitz@redhat.com>
Tue, 29 Aug 2023 08:49:24 +0000 (10:49 +0200)
commitd85b08c6e27d796dbb653b8ae9584080361c1498
tree62dc1302719515bedc05930a114af33012d981ee
parent1322f63df52e23ecf47cc9a5842ec3099c517183
throttle: support read-only and write-only

Only one direction is necessary in several scenarios:
- a read-only disk
- operations on a device are considered as *write* only. For example,
  encrypt/decrypt/sign/verify operations on a cryptodev use a single
  *write* timer(read timer callback is defined, but never invoked).

Allow a single direction in throttle, this reduces memory, and uplayer
does not need a dummy callback any more.

Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20230728022006.1098509-4-pizhenwei@bytedance.com>
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
util/throttle.c