diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2023-01-13 21:42:05 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2023-02-01 16:52:32 +0100 |
commit | d886257d84dd7c3d3f04c3b1e2e4749b47541ee5 (patch) | |
tree | 1c86a35f8dee384dbf08f42d0afbb378d354ea05 | |
parent | c86422c5549c0983b4b4525b8f56a1c69dd67aa1 (diff) | |
download | qemu-d886257d84dd7c3d3f04c3b1e2e4749b47541ee5.zip qemu-d886257d84dd7c3d3f04c3b1e2e4749b47541ee5.tar.gz qemu-d886257d84dd7c3d3f04c3b1e2e4749b47541ee5.tar.bz2 |
block-backend: use bdrv_getlength instead of blk_getlength
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>
-rw-r--r-- | block/block-backend.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index d698cc3..7d4b08e 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; } |