aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-29 01:31:48 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-03-29 01:31:48 +0000
commit999dec57f6c7d75176f981d4b5e4df8c30c1c723 (patch)
tree9dcca74ef7ac511d77fa2fc2d7dbefd2ff1b0343 /block.c
parent41db460791c2d6a5d59a39614f2f63a5fca6d73e (diff)
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
Diffstat (limited to 'block.c')
-rw-r--r--block.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/block.c b/block.c
index 823841df03..a9523ed5b5 100644
--- a/block.c
+++ b/block.c
@@ -569,15 +569,7 @@ static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num,
int nb_sectors)
{
- int64_t offset;
-
- /* Deal with byte accesses */
- if (sector_num < 0)
- offset = -sector_num;
- else
- offset = sector_num * 512;
-
- return bdrv_check_byte_request(bs, offset, nb_sectors * 512);
+ return bdrv_check_byte_request(bs, sector_num * 512, nb_sectors * 512);
}
/* return < 0 if error. See bdrv_write() for the return codes */