aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2013-04-05 11:32:21 +0200
committerKevin Wolf <kwolf@redhat.com>2013-04-05 18:58:05 +0200
commite660fb8b3ccc94652774d5895d122c0f13aecb89 (patch)
tree2920792d5bfd08f2aa6cebbe900796fa5dcf0f0d /block.c
parentae29d6c64bd8d55873a2cb1df50ae4321b497447 (diff)
block: drop duplicated slice extension code
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 <stefanha@redhat.com> Tested-By: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/block.c b/block.c
index 00eca275ba..aa16fc4c68 100644
--- 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));