[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/15] block: rename refresh_total_sectors in bdrv_refresh_total_
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH 02/15] block: rename refresh_total_sectors in bdrv_refresh_total_sectors |
Date: |
Wed, 16 Nov 2022 09:07:17 -0500 |
Name is not right, since we are going to convert this in
a generated_co_wrapper.
No functional change intended.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block.c | 8 ++++----
block/io.c | 8 +++++---
include/block/block_int-io.h | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index 1a6ae08879..ba4bbb42aa 100644
--- a/block.c
+++ b/block.c
@@ -1044,7 +1044,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();
@@ -1662,7 +1662,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;
@@ -5783,7 +5783,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;
}
@@ -6565,7 +6565,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 7d1d0c48b0..99867fe148 100644
--- a/block/io.c
+++ b/block/io.c
@@ -3411,15 +3411,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:
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index ac6ad3b3ff..453855e651 100644
--- a/include/block/block_int-io.h
+++ b/include/block/block_int-io.h
@@ -122,7 +122,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);
--
2.31.1
- [PATCH 00/15] Protect the block layer with a rwlock: part 3, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 01/15] block/qed: add missing graph rdlock in qed_need_check_timer_entry, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 06/15] block: convert bdrv_get_allocated_file_size in generated_co_wrapper_simple, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 02/15] block: rename refresh_total_sectors in bdrv_refresh_total_sectors,
Emanuele Giuseppe Esposito <=
- [PATCH 07/15] block: convert bdrv_get_info in generated_co_wrapper, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 03/15] block-backend: use bdrv_getlength instead of blk_getlength, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 10/15] block: convert bdrv_eject in generated_co_wrapper_simple, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 11/15] block: convert bdrv_lock_medium in generated_co_wrapper_simple, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 13/15] block: convert bdrv_io_plug in generated_co_wrapper_simple, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 04/15] block: convert bdrv_refresh_total_sectors in generated_co_wrapper, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 05/15] block: use bdrv_co_refresh_total_sectors when possible, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 08/15] block: convert bdrv_is_inserted in generated_co_wrapper_simple, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 09/15] block-coroutine-wrapper: support void functions, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 12/15] block: convert bdrv_debug_event in generated_co_wrapper, Emanuele Giuseppe Esposito, 2022/11/16