Skip to content

Commit 7803696

Browse files
danielhbkevmw
authored andcommitted
block-backend: simplify blk_get_aio_context
blk_get_aio_context verifies if BlockDriverState bs is not NULL, return bdrv_get_aio_context(bs) if true or qemu_get_aio_context() otherwise. However, bdrv_get_aio_context from block.c already does this verification itself, also returning qemu_get_aio_context() if bs is NULL: AioContext *bdrv_get_aio_context(BlockDriverState *bs) { return bs ? bs->aio_context : qemu_get_aio_context(); } This patch simplifies blk_get_aio_context to simply call bdrv_get_aio_context instead of replicating the same logic. Signed-off-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Darren Kenny <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
1 parent ad1b4ec commit 7803696

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

block/block-backend.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -1865,13 +1865,7 @@ void blk_op_unblock_all(BlockBackend *blk, Error *reason)
18651865

18661866
AioContext *blk_get_aio_context(BlockBackend *blk)
18671867
{
1868-
BlockDriverState *bs = blk_bs(blk);
1869-
1870-
if (bs) {
1871-
return bdrv_get_aio_context(bs);
1872-
} else {
1873-
return qemu_get_aio_context();
1874-
}
1868+
return bdrv_get_aio_context(blk_bs(blk));
18751869
}
18761870

18771871
static AioContext *blk_aiocb_get_aio_context(BlockAIOCB *acb)

0 commit comments

Comments
 (0)