mirror of
https://github.com/qemu/qemu.git
synced 2024-12-12 13:13:51 +08:00
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>
This commit is contained in:
parent
c86422c554
commit
d886257d84
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user