diff options
author | Peter Lieven <pl@kamp.de> | 2013-10-08 14:43:14 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-10-11 16:49:59 +0200 |
commit | 92bc50a5ad7fbc9a0bd17240eaea5027a100ca79 (patch) | |
tree | 105ca03529f39cc6d27eb0a89c36e498c61890f2 /block/raw_bsd.c | |
parent | 88fb15351284868b70fa1d5b101e809057fcc5aa (diff) |
block/get_block_status: avoid redundant callouts on raw devices
if a raw device like an iscsi target or host device is used
the current implementation makes a second call out to get
the block status of bs->file.
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/raw_bsd.c')
-rw-r--r-- | block/raw_bsd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/raw_bsd.c b/block/raw_bsd.c index d4ace6020b..d61906bcc2 100644 --- a/block/raw_bsd.c +++ b/block/raw_bsd.c @@ -62,7 +62,9 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum) { - return bdrv_get_block_status(bs->file, sector_num, nb_sectors, pnum); + *pnum = nb_sectors; + return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA | + (sector_num << BDRV_SECTOR_BITS); } static int coroutine_fn raw_co_write_zeroes(BlockDriverState *bs, |