qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] remove dead code in bdrv_check_request


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] remove dead code in bdrv_check_request
Date: Sat, 28 Mar 2009 20:33:22 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Christoph Hellwig wrote:
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 <address@hidden>

Applied.  Thanks for resending this.

Regards,

Anthony Liguori

Index: qemu/block.c
===================================================================
--- qemu.orig/block.c   2009-03-14 14:34:49.000000000 +0100
+++ qemu/block.c        2009-03-14 14:35:12.000000000 +0100
@@ -546,15 +546,7 @@ static int bdrv_check_byte_request(Block
 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 */








reply via email to

[Prev in Thread] Current Thread [Next in Thread]