[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/15] block-backend: use bdrv_getlength instead of blk_getlength
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH 03/15] block-backend: use bdrv_getlength instead of blk_getlength |
Date: |
Wed, 16 Nov 2022 09:07:18 -0500 |
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>
---
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 6f0dd15808..4af9a3179e 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.31.1
- [PATCH 00/15] Protect the block layer with a rwlock: part 3, 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 05/15] block: use bdrv_co_refresh_total_sectors when possible, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 03/15] block-backend: use bdrv_getlength instead of blk_getlength,
Emanuele Giuseppe Esposito <=
- [PATCH 11/15] block: convert bdrv_lock_medium in generated_co_wrapper_simple, 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 02/15] block: rename refresh_total_sectors in bdrv_refresh_total_sectors, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 07/15] block: convert bdrv_get_info in generated_co_wrapper, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 12/15] block: convert bdrv_debug_event in generated_co_wrapper, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 15/15] block: rename newly converted BlockDriver IO coroutine functions, 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 01/15] block/qed: add missing graph rdlock in qed_need_check_timer_entry, Emanuele Giuseppe Esposito, 2022/11/16
- [PATCH 10/15] block: convert bdrv_eject in generated_co_wrapper_simple, Emanuele Giuseppe Esposito, 2022/11/16