]> Git Repo - qemu.git/commitdiff
block: drop duplicated slice extension code
authorStefan Hajnoczi <[email protected]>
Fri, 5 Apr 2013 09:32:21 +0000 (11:32 +0200)
committerKevin Wolf <[email protected]>
Fri, 5 Apr 2013 16:58:05 +0000 (18:58 +0200)
The current slice is extended when an I/O request exceeds the limit.
There is no need to extend the slice every time we check a request.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Tested-By: Benoit Canet <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block.c

diff --git a/block.c b/block.c
index 00eca275ba629b1ecbc55dd30f0b6bbd4462f435..aa16fc4c6863b8d10edc94495bf7994eaf734af9 100644 (file)
--- a/block.c
+++ b/block.c
@@ -3867,10 +3867,7 @@ static bool bdrv_exceed_io_limits(BlockDriverState *bs, int nb_sectors,
     int      bps_ret, iops_ret;
 
     now = qemu_get_clock_ns(vm_clock);
-    if ((bs->slice_start < now)
-        && (bs->slice_end > now)) {
-        bs->slice_end = now + BLOCK_IO_SLICE_TIME;
-    } else {
+    if (now > bs->slice_end) {
         bs->slice_start = now;
         bs->slice_end   = now + BLOCK_IO_SLICE_TIME;
         memset(&bs->slice_submitted, 0, sizeof(bs->slice_submitted));
This page took 0.032204 seconds and 4 git commands to generate.