mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
blockjob: Introduce block_job_ratelimit_get_delay()
This gets us rid of more direct accesses to BlockJob fields from the job drivers. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
18bb69287e
commit
dee81d5111
6 changed files with 29 additions and 19 deletions
|
@ -165,6 +165,14 @@ void block_job_sleep_ns(BlockJob *job, int64_t ns);
|
|||
*/
|
||||
void block_job_yield(BlockJob *job);
|
||||
|
||||
/**
|
||||
* block_job_ratelimit_get_delay:
|
||||
*
|
||||
* Calculate and return delay for the next request in ns. See the documentation
|
||||
* of ratelimit_calculate_delay() for details.
|
||||
*/
|
||||
int64_t block_job_ratelimit_get_delay(BlockJob *job, uint64_t n);
|
||||
|
||||
/**
|
||||
* block_job_early_fail:
|
||||
* @bs: The block device.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue