提交 999dec57 编写于 作者: A aliguori

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: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6942 c046a42c-6fe2-441c-8c8c-71466251a162
上级 41db4607
...@@ -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,
static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num, static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num,
int nb_sectors) int nb_sectors)
{ {
int64_t offset; return bdrv_check_byte_request(bs, sector_num * 512, nb_sectors * 512);
/* 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 < 0 if error. See bdrv_write() for the return codes */ /* return < 0 if error. See bdrv_write() for the return codes */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册