[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 11/11] qcow2: do encryption in threads
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-block] [PATCH 11/11] qcow2: do encryption in threads |
Date: |
Fri, 23 Nov 2018 19:55:11 +0300 |
Do encryption/decryption in threads, like it is already done for
compression. This improves asynchronous encrypted io.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block/qcow2.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 3fa7e3ea27..a7d77a2178 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2007,13 +2007,8 @@ static coroutine_fn int qcow2_co_preadv(BlockDriverState
*bs, uint64_t offset,
assert(s->crypto);
assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0);
assert((cur_bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
- if (qcrypto_block_decrypt(s->crypto,
- (s->crypt_physical_offset ?
- cluster_offset + offset_in_cluster :
- offset),
- cluster_data,
- cur_bytes,
- NULL) < 0) {
+ if (qcow2_co_decrypt(bs, cluster_offset, offset,
+ cluster_data, cur_bytes) < 0) {
ret = -EIO;
goto fail;
}
@@ -2151,12 +2146,8 @@ static coroutine_fn int
qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset,
QCOW_MAX_CRYPT_CLUSTERS * s->cluster_size);
qemu_iovec_to_buf(&hd_qiov, 0, cluster_data, hd_qiov.size);
- if (qcrypto_block_encrypt(s->crypto,
- (s->crypt_physical_offset ?
- cluster_offset + offset_in_cluster :
- offset),
- cluster_data,
- cur_bytes, NULL) < 0) {
+ if (qcow2_co_encrypt(bs, cluster_offset, offset,
+ cluster_data, cur_bytes) < 0) {
ret = -EIO;
goto out_unlocked;
}
--
2.18.0
- [Qemu-block] [PATCH 00/11] qcow2: encryption threads, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 07/11] qcow2-threads: add encryption, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 01/11] qcow2.h: add missing include, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 05/11] qcow2-threads: split out generic path, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 08/11] qcow2: bdrv_co_preadv: improve locking, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 03/11] qcow2-threads: use thread_pool_submit_co, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 06/11] qcow2-threads: add per-thread data, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 11/11] qcow2: do encryption in threads,
Vladimir Sementsov-Ogievskiy <=
- [Qemu-block] [PATCH 04/11] qcow2: split out data processing threads state from BDRVQcow2State, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 02/11] qcow2: add separate file for threaded data processing functions, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 09/11] qcow2: qcow2_co_preadv: skip using hd_qiov when possible, Vladimir Sementsov-Ogievskiy, 2018/11/23
- [Qemu-block] [PATCH 10/11] qcow2: bdrv_co_pwritev: move encryption code out of the lock, Vladimir Sementsov-Ogievskiy, 2018/11/23
- Re: [Qemu-block] [PATCH 00/11] qcow2: encryption threads, Daniel P . Berrangé, 2018/11/27