Commit 999dec57f6c7d75176f981d4b5e4df8c30c1c723
1 parent
41db4607
remove dead code in bdrv_check_request (Christoph Hellwig)
Remove code dealing with negative sector numbers for byte access in bdrv_check_request as sector numbers can't ever be negative. Previously we supported negative sector counts for byte access, but never sector numbers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6942 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
1 additions
and
9 deletions
block.c
| @@ -569,15 +569,7 @@ static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, | @@ -569,15 +569,7 @@ static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, | ||
| 569 | static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num, | 569 | static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num, |
| 570 | int nb_sectors) | 570 | int nb_sectors) |
| 571 | { | 571 | { |
| 572 | - int64_t offset; | ||
| 573 | - | ||
| 574 | - /* Deal with byte accesses */ | ||
| 575 | - if (sector_num < 0) | ||
| 576 | - offset = -sector_num; | ||
| 577 | - else | ||
| 578 | - offset = sector_num * 512; | ||
| 579 | - | ||
| 580 | - return bdrv_check_byte_request(bs, offset, nb_sectors * 512); | 572 | + return bdrv_check_byte_request(bs, sector_num * 512, nb_sectors * 512); |
| 581 | } | 573 | } |
| 582 | 574 | ||
| 583 | /* return < 0 if error. See bdrv_write() for the return codes */ | 575 | /* return < 0 if error. See bdrv_write() for the return codes */ |