[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 07/14] block-backend: use bdrv_getlength instead of blk_getlen
From: |
Kevin Wolf |
Subject: |
[PATCH v2 07/14] block-backend: use bdrv_getlength instead of blk_getlength |
Date: |
Fri, 13 Jan 2023 21:42:05 +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>
---
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 6e5e2693b3..37b51f409f 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
- [PATCH v2 00/14] block: Move more functions to coroutines, Kevin Wolf, 2023/01/13
- [PATCH v2 02/14] block: Convert bdrv_io_plug() to co_wrapper, Kevin Wolf, 2023/01/13
- [PATCH v2 01/14] block-coroutine-wrapper: support void functions, Kevin Wolf, 2023/01/13
- [PATCH v2 03/14] block: Convert bdrv_io_unplug() to co_wrapper, Kevin Wolf, 2023/01/13
- [PATCH v2 04/14] block: Convert bdrv_is_inserted() to co_wrapper, Kevin Wolf, 2023/01/13
- [PATCH v2 05/14] block: Rename refresh_total_sectors to bdrv_refresh_total_sectors, Kevin Wolf, 2023/01/13
- [PATCH v2 06/14] block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed, Kevin Wolf, 2023/01/13
- [PATCH v2 07/14] block-backend: use bdrv_getlength instead of blk_getlength,
Kevin Wolf <=
- [PATCH v2 08/14] block: use bdrv_co_refresh_total_sectors when possible, Kevin Wolf, 2023/01/13
- [PATCH v2 11/14] block: Convert bdrv_eject() to co_wrapper, Kevin Wolf, 2023/01/13
- [PATCH v2 09/14] block: Convert bdrv_get_allocated_file_size() to co_wrapper, Kevin Wolf, 2023/01/13
- [PATCH v2 13/14] block: Convert bdrv_debug_event() to co_wrapper_mixed, Kevin Wolf, 2023/01/13
- [PATCH v2 10/14] block: Convert bdrv_get_info() to co_wrapper_mixed, Kevin Wolf, 2023/01/13
- [PATCH v2 12/14] block: Convert bdrv_lock_medium() to co_wrapper, Kevin Wolf, 2023/01/13
- [PATCH v2 14/14] block: Rename bdrv_load/save_vmstate() to bdrv_co_load/save_vmstate(), Kevin Wolf, 2023/01/13
- Re: [PATCH v2 00/14] block: Move more functions to coroutines, Emanuele Giuseppe Esposito, 2023/01/16