[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/38] block-backend: use bdrv_getlength instead of blk_getlength
From: |
Kevin Wolf |
Subject: |
[PULL 18/38] block-backend: use bdrv_getlength instead of blk_getlength |
Date: |
Fri, 20 Jan 2023 13:26:13 +0100 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
The only difference is that blk_ checks if the block is available,
but this check is already performed above in blk_check_byte_request().
This is in preparation for the graph rdlock, which will be taken
by both the callers of blk_check_byte_request() and blk_getlength().
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230113204212.359076-8-kwolf@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/block-backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index d698cc3f33..7d4b08ee45 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1253,7 +1253,7 @@ static int blk_check_byte_request(BlockBackend *blk,
int64_t offset,
}
if (!blk->allow_write_beyond_eof) {
- len = blk_getlength(blk);
+ len = bdrv_getlength(blk_bs(blk));
if (len < 0) {
return len;
}
--
2.38.1
- [PULL 08/38] qcow2: Fix theoretical corruption in store_bitmap() error path, (continued)
- [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, 2023/01/20
- [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 <=
- [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
- [PULL 22/38] block: Convert bdrv_eject() to co_wrapper, Kevin Wolf, 2023/01/20
- [PULL 28/38] block/file: Add file-specific image info, Kevin Wolf, 2023/01/20