Lines Matching refs:bs

234     BlockDriverState *bs = opaque;  in blkio_completion_fd_read()  local
235 BDRVBlkioState *s = bs->opaque; in blkio_completion_fd_read()
279 BlockDriverState *bs = opaque; in blkio_completion_fd_poll() local
280 BDRVBlkioState *s = bs->opaque; in blkio_completion_fd_poll()
299 static void blkio_attach_aio_context(BlockDriverState *bs, in blkio_attach_aio_context() argument
302 BDRVBlkioState *s = bs->opaque; in blkio_attach_aio_context()
307 blkio_completion_fd_poll_ready, bs); in blkio_attach_aio_context()
310 static void blkio_detach_aio_context(BlockDriverState *bs) in blkio_detach_aio_context() argument
312 BDRVBlkioState *s = bs->opaque; in blkio_detach_aio_context()
314 aio_set_fd_handler(bdrv_get_aio_context(bs), s->completion_fd, NULL, NULL, in blkio_detach_aio_context()
335 static void blkio_submit_io(BlockDriverState *bs) in blkio_submit_io() argument
337 BDRVBlkioState *s = bs->opaque; in blkio_submit_io()
343 blkio_co_pdiscard(BlockDriverState *bs, int64_t offset, int64_t bytes) in blkio_co_pdiscard() argument
345 BDRVBlkioState *s = bs->opaque; in blkio_co_pdiscard()
354 blkio_submit_io(bs); in blkio_co_pdiscard()
360 blkio_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, in blkio_co_preadv() argument
366 BDRVBlkioState *s = bs->opaque; in blkio_co_preadv()
387 blkio_submit_io(bs); in blkio_co_preadv()
403 static int coroutine_fn blkio_co_pwritev(BlockDriverState *bs, int64_t offset, in blkio_co_pwritev() argument
410 BDRVBlkioState *s = bs->opaque; in blkio_co_pwritev()
432 blkio_submit_io(bs); in blkio_co_pwritev()
442 static int coroutine_fn blkio_co_flush(BlockDriverState *bs) in blkio_co_flush() argument
444 BDRVBlkioState *s = bs->opaque; in blkio_co_flush()
453 blkio_submit_io(bs); in blkio_co_flush()
458 static int coroutine_fn blkio_co_pwrite_zeroes(BlockDriverState *bs, in blkio_co_pwrite_zeroes() argument
461 BDRVBlkioState *s = bs->opaque; in blkio_co_pwrite_zeroes()
481 blkio_submit_io(bs); in blkio_co_pwrite_zeroes()
501 blkio_mem_region_from_host(BlockDriverState *bs, in blkio_mem_region_from_host() argument
506 BDRVBlkioState *s = bs->opaque; in blkio_mem_region_from_host()
556 static bool blkio_register_buf(BlockDriverState *bs, void *host, size_t size, in blkio_register_buf() argument
559 BDRVBlkioState *s = bs->opaque; in blkio_register_buf()
572 region_result = blkio_mem_region_from_host(bs, host, size, &region, errp); in blkio_register_buf()
591 static void blkio_unregister_buf(BlockDriverState *bs, void *host, size_t size) in blkio_unregister_buf() argument
593 BDRVBlkioState *s = bs->opaque; in blkio_unregister_buf()
601 if (blkio_mem_region_from_host(bs, host, size, &region, NULL) != BMRR_OK) { in blkio_unregister_buf()
610 static int blkio_io_uring_connect(BlockDriverState *bs, QDict *options, in blkio_io_uring_connect() argument
614 BDRVBlkioState *s = bs->opaque; in blkio_io_uring_connect()
644 static int blkio_nvme_io_uring_connect(BlockDriverState *bs, QDict *options, in blkio_nvme_io_uring_connect() argument
648 BDRVBlkioState *s = bs->opaque; in blkio_nvme_io_uring_connect()
679 static int blkio_virtio_blk_connect(BlockDriverState *bs, QDict *options, in blkio_virtio_blk_connect() argument
683 BDRVBlkioState *s = bs->opaque; in blkio_virtio_blk_connect()
794 static int blkio_open(BlockDriverState *bs, QDict *options, int flags, in blkio_open() argument
797 const char *blkio_driver = bs->drv->protocol_name; in blkio_open()
798 BDRVBlkioState *s = bs->opaque; in blkio_open()
819 ret = blkio_io_uring_connect(bs, options, flags, errp); in blkio_open()
821 ret = blkio_nvme_io_uring_connect(bs, options, flags, errp); in blkio_open()
823 ret = blkio_virtio_blk_connect(bs, options, flags, errp); in blkio_open()
825 ret = blkio_virtio_blk_connect(bs, options, flags, errp); in blkio_open()
827 ret = blkio_virtio_blk_connect(bs, options, flags, errp); in blkio_open()
901 bs->supported_write_flags = BDRV_REQ_FUA | BDRV_REQ_REGISTERED_BUF; in blkio_open()
902 bs->supported_zero_flags = BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK; in blkio_open()
904 bs->supported_zero_flags |= BDRV_REQ_FUA; in blkio_open()
915 blkio_attach_aio_context(bs, bdrv_get_aio_context(bs)); in blkio_open()
919 static void blkio_close(BlockDriverState *bs) in blkio_close() argument
921 BDRVBlkioState *s = bs->opaque; in blkio_close()
926 blkio_detach_aio_context(bs); in blkio_close()
934 static int64_t coroutine_fn blkio_co_getlength(BlockDriverState *bs) in blkio_co_getlength() argument
936 BDRVBlkioState *s = bs->opaque; in blkio_co_getlength()
950 static int coroutine_fn blkio_truncate(BlockDriverState *bs, int64_t offset, in blkio_truncate() argument
962 current_length = blkio_co_getlength(bs); in blkio_truncate()
976 blkio_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) in blkio_co_get_info() argument
981 static void blkio_refresh_limits(BlockDriverState *bs, Error **errp) in blkio_refresh_limits() argument
983 BDRVBlkioState *s = bs->opaque; in blkio_refresh_limits()
994 bs->bl.request_alignment = value; in blkio_refresh_limits()
995 if (bs->bl.request_alignment < 1 || in blkio_refresh_limits()
996 bs->bl.request_alignment >= INT_MAX || in blkio_refresh_limits()
997 !is_power_of_2(bs->bl.request_alignment)) { in blkio_refresh_limits()
1000 bs->bl.request_alignment); in blkio_refresh_limits()
1010 bs->bl.opt_transfer = value; in blkio_refresh_limits()
1011 if (bs->bl.opt_transfer > INT_MAX || in blkio_refresh_limits()
1012 (bs->bl.opt_transfer % bs->bl.request_alignment)) { in blkio_refresh_limits()
1014 "be a multiple of %" PRIu32, bs->bl.opt_transfer, in blkio_refresh_limits()
1015 bs->bl.request_alignment); in blkio_refresh_limits()
1025 bs->bl.max_transfer = value; in blkio_refresh_limits()
1026 if ((bs->bl.max_transfer % bs->bl.request_alignment) || in blkio_refresh_limits()
1027 (bs->bl.opt_transfer && (bs->bl.max_transfer % bs->bl.opt_transfer))) { in blkio_refresh_limits()
1030 bs->bl.max_transfer, bs->bl.request_alignment, in blkio_refresh_limits()
1031 bs->bl.opt_transfer); in blkio_refresh_limits()
1046 bs->bl.min_mem_alignment = value; in blkio_refresh_limits()
1060 bs->bl.opt_mem_alignment = value; in blkio_refresh_limits()
1073 bs->bl.max_iov = value; in blkio_refresh_limits()