block-backend: Make blk_inc/dec_in_flight public
For some users of BlockBackends, just increasing the in_flight counter is easier than implementing separate handlers in BlockDevOps. Make the helper functions for this public. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
334c43e2c3
commit
c90e2a9cfd
@ -1262,12 +1262,12 @@ int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags)
|
||||
return bdrv_make_zero(blk->root, flags);
|
||||
}
|
||||
|
||||
static void blk_inc_in_flight(BlockBackend *blk)
|
||||
void blk_inc_in_flight(BlockBackend *blk)
|
||||
{
|
||||
atomic_inc(&blk->in_flight);
|
||||
}
|
||||
|
||||
static void blk_dec_in_flight(BlockBackend *blk)
|
||||
void blk_dec_in_flight(BlockBackend *blk)
|
||||
{
|
||||
atomic_dec(&blk->in_flight);
|
||||
aio_wait_kick();
|
||||
|
@ -156,6 +156,8 @@ int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes);
|
||||
int blk_co_flush(BlockBackend *blk);
|
||||
int blk_flush(BlockBackend *blk);
|
||||
int blk_commit_all(void);
|
||||
void blk_inc_in_flight(BlockBackend *blk);
|
||||
void blk_dec_in_flight(BlockBackend *blk);
|
||||
void blk_drain(BlockBackend *blk);
|
||||
void blk_drain_all(void);
|
||||
void blk_set_on_error(BlockBackend *blk, BlockdevOnError on_read_error,
|
||||
|
Loading…
Reference in New Issue
Block a user