[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/15] block-backend: convert blk_co_copy_range to int64_t bytes
From: |
Eric Blake |
Subject: |
[PULL 10/15] block-backend: convert blk_co_copy_range to int64_t bytes |
Date: |
Fri, 15 Oct 2021 16:10:05 -0500 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Function is updated so that parameter type becomes wider, so all
callers should be OK with it.
Look at blk_co_copy_range() itself: bytes is passed only to
blk_check_byte_request() and bdrv_co_copy_range(), which already have
int64_t bytes parameter, so we are OK.
Note that requests exceeding INT_MAX are still restricted by
blk_check_byte_request().
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006131718.214235-10-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
---
include/sysemu/block-backend.h | 2 +-
block/block-backend.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 3294d1b07a33..9ccf9f1a8025 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -270,7 +270,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host);
int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
BlockBackend *blk_out, int64_t off_out,
- int bytes, BdrvRequestFlags read_flags,
+ int64_t bytes, BdrvRequestFlags read_flags,
BdrvRequestFlags write_flags);
const BdrvChild *blk_root(BlockBackend *blk);
diff --git a/block/block-backend.c b/block/block-backend.c
index ee20ae5f0f28..0746be89842b 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -2418,7 +2418,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host)
int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
BlockBackend *blk_out, int64_t off_out,
- int bytes, BdrvRequestFlags read_flags,
+ int64_t bytes, BdrvRequestFlags read_flags,
BdrvRequestFlags write_flags)
{
int r;
--
2.31.1
- [PULL 00/15] NBD patches through 2021-10-15, Eric Blake, 2021/10/15
- [PULL 05/15] block-backend: convert blk_co_pdiscard to int64_t bytes, Eric Blake, 2021/10/15
- [PULL 01/15] qcow2: Silence clang -m32 compiler warning, Eric Blake, 2021/10/15
- [PULL 04/15] block-backend: convert blk_co_pwritev_part to int64_t bytes, Eric Blake, 2021/10/15
- [PULL 02/15] block-backend: blk_check_byte_request(): int64_t bytes, Eric Blake, 2021/10/15
- [PULL 06/15] block-backend: rename _do_ helper functions to _co_do_, Eric Blake, 2021/10/15
- [PULL 03/15] block-backend: make blk_co_preadv() 64bit, Eric Blake, 2021/10/15
- [PULL 08/15] block-backend: drop blk_prw, use block-coroutine-wrapper, Eric Blake, 2021/10/15
- [PULL 11/15] block-backend: convert blk_aio_ functions to int64_t bytes paramter, Eric Blake, 2021/10/15
- [PULL 09/15] block-backend: convert blk_foo wrappers to use int64_t bytes parameter, Eric Blake, 2021/10/15
- [PULL 10/15] block-backend: convert blk_co_copy_range to int64_t bytes,
Eric Blake <=
- [PULL 07/15] block-coroutine-wrapper.py: support BlockBackend first argument, Eric Blake, 2021/10/15
- [PULL 12/15] block-backend: blk_pread, blk_pwrite: rename count parameter to bytes, Eric Blake, 2021/10/15
- [PULL 14/15] block-backend: fix blk_co_flush prototype to mention coroutine_fn, Eric Blake, 2021/10/15
- [PULL 15/15] block-backend: update blk_co_pwrite() and blk_co_pread() wrappers, Eric Blake, 2021/10/15
- [PULL 13/15] block-backend: drop INT_MAX restriction from blk_check_byte_request(), Eric Blake, 2021/10/15
- Re: [PULL 00/15] NBD patches through 2021-10-15, Richard Henderson, 2021/10/15