Lines Matching refs:bs

66     BlockDriverState *bs = opaque;  in block_crypto_read_func()  local
67 BlockCrypto *crypto = bs->opaque; in block_crypto_read_func()
73 ret = bdrv_pread(crypto->header ? crypto->header : bs->file, in block_crypto_read_func()
89 BlockDriverState *bs = opaque; in block_crypto_write_func() local
90 BlockCrypto *crypto = bs->opaque; in block_crypto_write_func()
96 ret = bdrv_pwrite(crypto->header ? crypto->header : bs->file, in block_crypto_write_func()
169 BlockDriverState *bs = NULL; in block_crypto_co_format_luks_payload() local
178 bs = bdrv_co_open_blockdev_ref(luks_opts->file, errp); in block_crypto_co_format_luks_payload()
179 if (bs == NULL) { in block_crypto_co_format_luks_payload()
183 blk = blk_co_new_with_bs(bs, BLK_PERM_WRITE | BLK_PERM_RESIZE, in block_crypto_co_format_luks_payload()
204 bdrv_co_unref(bs); in block_crypto_co_format_luks_payload()
308 BlockDriverState *bs, in block_crypto_open_generic() argument
315 BlockCrypto *crypto = bs->opaque; in block_crypto_open_generic()
324 ret = bdrv_open_file_child(NULL, options, "file", bs, errp); in block_crypto_open_generic()
329 crypto->header = bdrv_open_child(NULL, options, "header", bs, in block_crypto_open_generic()
338 bs->supported_write_flags = BDRV_REQ_FUA & in block_crypto_open_generic()
339 bs->file->bs->supported_write_flags; in block_crypto_open_generic()
364 bs, in block_crypto_open_generic()
373 bs->encrypted = true; in block_crypto_open_generic()
384 block_crypto_co_create_generic(BlockDriverState *bs, int64_t size, in block_crypto_co_create_generic() argument
395 blk = blk_co_new_with_bs(bs, BLK_PERM_WRITE | BLK_PERM_RESIZE, BLK_PERM_ALL, in block_crypto_co_create_generic()
432 block_crypto_co_truncate(BlockDriverState *bs, int64_t offset, bool exact, in block_crypto_co_truncate() argument
436 BlockCrypto *crypto = bs->opaque; in block_crypto_co_truncate()
447 return bdrv_co_truncate(bs->file, offset, exact, prealloc, 0, errp); in block_crypto_co_truncate()
450 static void block_crypto_close(BlockDriverState *bs) in block_crypto_close() argument
452 BlockCrypto *crypto = bs->opaque; in block_crypto_close()
470 block_crypto_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, in block_crypto_co_preadv() argument
473 BlockCrypto *crypto = bs->opaque; in block_crypto_co_preadv()
492 qemu_try_blockalign(bs->file->bs, MIN(BLOCK_CRYPTO_MAX_IO_SIZE, in block_crypto_co_preadv()
505 ret = bdrv_co_preadv(bs->file, payload_offset + offset + bytes_done, in block_crypto_co_preadv()
532 block_crypto_co_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, in block_crypto_co_pwritev() argument
535 BlockCrypto *crypto = bs->opaque; in block_crypto_co_pwritev()
556 qemu_try_blockalign(bs->file->bs, MIN(BLOCK_CRYPTO_MAX_IO_SIZE, in block_crypto_co_pwritev()
577 ret = bdrv_co_pwritev(bs->file, payload_offset + offset + bytes_done, in block_crypto_co_pwritev()
594 static void block_crypto_refresh_limits(BlockDriverState *bs, Error **errp) in block_crypto_refresh_limits() argument
596 BlockCrypto *crypto = bs->opaque; in block_crypto_refresh_limits()
598 bs->bl.request_alignment = sector_size; /* No sub-sector I/O */ in block_crypto_refresh_limits()
603 block_crypto_co_getlength(BlockDriverState *bs) in block_crypto_co_getlength() argument
605 BlockCrypto *crypto = bs->opaque; in block_crypto_co_getlength()
606 int64_t len = bdrv_co_getlength(bs->file->bs); in block_crypto_co_getlength()
689 static int block_crypto_open_luks(BlockDriverState *bs, in block_crypto_open_luks() argument
696 bs, options, flags, errp); in block_crypto_open_luks()
704 BlockDriverState *bs = NULL; in block_crypto_co_create_luks() local
760 bs = bdrv_co_open_blockdev_ref(luks_opts->file, errp); in block_crypto_co_create_luks()
761 if (bs == NULL) { in block_crypto_co_create_luks()
765 ret = block_crypto_co_create_generic(bs, luks_opts->size, &create_opts, in block_crypto_co_create_luks()
778 if (bs != NULL) { in block_crypto_co_create_luks()
779 bdrv_co_unref(bs); in block_crypto_co_create_luks()
789 BlockDriverState *bs = NULL; in block_crypto_co_create_opts_luks() local
829 bs = bdrv_co_open(filename, NULL, NULL, in block_crypto_co_create_opts_luks()
831 if (!bs) { in block_crypto_co_create_opts_luks()
841 ret = block_crypto_co_create_generic(bs, size, create_opts, in block_crypto_co_create_opts_luks()
855 bdrv_co_delete_file_noerr(bs); in block_crypto_co_create_opts_luks()
859 bdrv_co_unref(bs); in block_crypto_co_create_opts_luks()
866 block_crypto_co_get_info_luks(BlockDriverState *bs, BlockDriverInfo *bdi) in block_crypto_co_get_info_luks() argument
871 ret = bdrv_co_get_info(bs->file->bs, &subbdi); in block_crypto_co_get_info_luks()
882 block_crypto_get_specific_info_luks(BlockDriverState *bs, Error **errp) in block_crypto_get_specific_info_luks() argument
884 BlockCrypto *crypto = bs->opaque; in block_crypto_get_specific_info_luks()
908 block_crypto_amend_prepare(BlockDriverState *bs, Error **errp) in block_crypto_amend_prepare() argument
910 BlockCrypto *crypto = bs->opaque; in block_crypto_amend_prepare()
915 ret = bdrv_child_refresh_perms(bs, bs->file, errp); in block_crypto_amend_prepare()
924 block_crypto_amend_cleanup(BlockDriverState *bs) in block_crypto_amend_cleanup() argument
926 BlockCrypto *crypto = bs->opaque; in block_crypto_amend_cleanup()
931 bdrv_child_refresh_perms(bs, bs->file, &errp); in block_crypto_amend_cleanup()
939 block_crypto_amend_options_generic_luks(BlockDriverState *bs, in block_crypto_amend_options_generic_luks() argument
944 BlockCrypto *crypto = bs->opaque; in block_crypto_amend_options_generic_luks()
952 bs, in block_crypto_amend_options_generic_luks()
959 block_crypto_amend_options_luks(BlockDriverState *bs, in block_crypto_amend_options_luks() argument
966 BlockCrypto *crypto = bs->opaque; in block_crypto_amend_options_luks()
982 ret = block_crypto_amend_prepare(bs, errp); in block_crypto_amend_options_luks()
986 ret = block_crypto_amend_options_generic_luks(bs, amend_options, in block_crypto_amend_options_luks()
990 block_crypto_amend_cleanup(bs); in block_crypto_amend_options_luks()
997 coroutine_fn block_crypto_co_amend_luks(BlockDriverState *bs, in block_crypto_co_amend_luks() argument
1008 return block_crypto_amend_options_generic_luks(bs, &amend_opts, in block_crypto_co_amend_luks()
1013 block_crypto_child_perms(BlockDriverState *bs, BdrvChild *c, in block_crypto_child_perms() argument
1020 BlockCrypto *crypto = bs->opaque; in block_crypto_child_perms()
1022 bdrv_default_perms(bs, c, role, reopen_queue, perm, shared, nperm, nshared); in block_crypto_child_perms()