[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/38] block: Rename refresh_total_sectors to bdrv_refresh_total_s
From: |
Kevin Wolf |
Subject: |
[PULL 16/38] block: Rename refresh_total_sectors to bdrv_refresh_total_sectors |
Date: |
Fri, 20 Jan 2023 13:26:11 +0100 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
The name is not good, not the least because we are going to convert this
to a generated co_wrapper, which adds a _co infix after the first part
of the name.
No functional change intended.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230113204212.359076-6-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/block/block_int-io.h | 2 +-
block.c | 8 ++++----
block/io.c | 8 +++++---
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index 8bc061ebb8..6b285fb520 100644
--- a/include/block/block_int-io.h
+++ b/include/block/block_int-io.h
@@ -120,7 +120,7 @@ int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src,
int64_t src_offset,
BdrvRequestFlags read_flags,
BdrvRequestFlags write_flags);
-int refresh_total_sectors(BlockDriverState *bs, int64_t hint);
+int bdrv_refresh_total_sectors(BlockDriverState *bs, int64_t hint);
BdrvChild *bdrv_cow_child(BlockDriverState *bs);
BdrvChild *bdrv_filter_child(BlockDriverState *bs);
diff --git a/block.c b/block.c
index 1bb20bbff6..6529e5a238 100644
--- a/block.c
+++ b/block.c
@@ -1034,7 +1034,7 @@ static int find_image_format(BlockBackend *file, const
char *filename,
* Set the current 'total_sectors' value
* Return 0 on success, -errno on error.
*/
-int refresh_total_sectors(BlockDriverState *bs, int64_t hint)
+int bdrv_refresh_total_sectors(BlockDriverState *bs, int64_t hint)
{
BlockDriver *drv = bs->drv;
IO_CODE();
@@ -1651,7 +1651,7 @@ static int bdrv_open_driver(BlockDriverState *bs,
BlockDriver *drv,
bs->supported_read_flags |= BDRV_REQ_REGISTERED_BUF;
bs->supported_write_flags |= BDRV_REQ_REGISTERED_BUF;
- ret = refresh_total_sectors(bs, bs->total_sectors);
+ ret = bdrv_refresh_total_sectors(bs, bs->total_sectors);
if (ret < 0) {
error_setg_errno(errp, -ret, "Could not refresh total sector count");
return ret;
@@ -5808,7 +5808,7 @@ int64_t bdrv_nb_sectors(BlockDriverState *bs)
return -ENOMEDIUM;
if (drv->has_variable_length) {
- int ret = refresh_total_sectors(bs, bs->total_sectors);
+ int ret = bdrv_refresh_total_sectors(bs, bs->total_sectors);
if (ret < 0) {
return ret;
}
@@ -6590,7 +6590,7 @@ int bdrv_activate(BlockDriverState *bs, Error **errp)
bdrv_dirty_bitmap_skip_store(bm, false);
}
- ret = refresh_total_sectors(bs, bs->total_sectors);
+ ret = bdrv_refresh_total_sectors(bs, bs->total_sectors);
if (ret < 0) {
bs->open_flags |= BDRV_O_INACTIVE;
error_setg_errno(errp, -ret, "Could not refresh total sector
count");
diff --git a/block/io.c b/block/io.c
index 03becd32d2..e5e51563a5 100644
--- a/block/io.c
+++ b/block/io.c
@@ -3473,15 +3473,17 @@ int coroutine_fn bdrv_co_truncate(BdrvChild *child,
int64_t offset, bool exact,
goto out;
}
- ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);
+ ret = bdrv_refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);
if (ret < 0) {
error_setg_errno(errp, -ret, "Could not refresh total sector count");
} else {
offset = bs->total_sectors * BDRV_SECTOR_SIZE;
}
- /* It's possible that truncation succeeded but refresh_total_sectors
+ /*
+ * It's possible that truncation succeeded but bdrv_refresh_total_sectors
* failed, but the latter doesn't affect how we should finish the request.
- * Pass 0 as the last parameter so that dirty bitmaps etc. are handled. */
+ * Pass 0 as the last parameter so that dirty bitmaps etc. are handled.
+ */
bdrv_co_write_req_finish(child, offset - new_bytes, new_bytes, &req, 0);
out:
--
2.38.1
- [PULL 11/38] qemu-iotests: Test qemu-img bitmap/commit exit code on error, (continued)
- [PULL 11/38] qemu-iotests: Test qemu-img bitmap/commit exit code on error, Kevin Wolf, 2023/01/20
- [PULL 04/38] coroutine: annotate coroutine_fn for libclang, Kevin Wolf, 2023/01/20
- [PULL 08/38] qcow2: Fix theoretical corruption in store_bitmap() error path, Kevin Wolf, 2023/01/20
- [PULL 09/38] qemu-img commit: Report errors while closing the image, Kevin Wolf, 2023/01/20
- [PULL 10/38] qemu-img bitmap: Report errors while closing the image, Kevin Wolf, 2023/01/20
- [PULL 12/38] block-coroutine-wrapper: support void functions, Kevin Wolf, 2023/01/20
- [PULL 05/38] block: Add no_coroutine_fn and coroutine_mixed_fn marker, Kevin Wolf, 2023/01/20
- [PULL 14/38] block: Convert bdrv_io_unplug() to co_wrapper, Kevin Wolf, 2023/01/20
- [PULL 13/38] block: Convert bdrv_io_plug() to co_wrapper, Kevin Wolf, 2023/01/20
- [PULL 15/38] block: Convert bdrv_is_inserted() to co_wrapper, Kevin Wolf, 2023/01/20
- [PULL 16/38] block: Rename refresh_total_sectors to bdrv_refresh_total_sectors,
Kevin Wolf <=
- [PULL 19/38] block: use bdrv_co_refresh_total_sectors when possible, Kevin Wolf, 2023/01/20
- [PULL 18/38] block-backend: use bdrv_getlength instead of blk_getlength, Kevin Wolf, 2023/01/20
- [PULL 21/38] block: Convert bdrv_get_info() to co_wrapper_mixed, Kevin Wolf, 2023/01/20
- [PULL 17/38] block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed, Kevin Wolf, 2023/01/20
- [PULL 25/38] block: Rename bdrv_load/save_vmstate() to bdrv_co_load/save_vmstate(), Kevin Wolf, 2023/01/20
- [PULL 27/38] block: Improve empty format-specific info dump, Kevin Wolf, 2023/01/20
- [PULL 29/38] block/vmdk: Change extent info type, Kevin Wolf, 2023/01/20
- [PULL 24/38] block: Convert bdrv_debug_event() to co_wrapper_mixed, Kevin Wolf, 2023/01/20
- [PULL 23/38] block: Convert bdrv_lock_medium() to co_wrapper, Kevin Wolf, 2023/01/20
- [PULL 20/38] block: Convert bdrv_get_allocated_file_size() to co_wrapper, Kevin Wolf, 2023/01/20