From: Jens Axboe Date: Mon, 22 Sep 2014 20:20:05 +0000 (-0600) Subject: dedupe: if percentage is 100, don't go through random + math X-Git-Tag: fio-2.1.13~57 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c0b69b92fb155424946b19228da9be0924e9e96c dedupe: if percentage is 100, don't go through random + math Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index af3b4151..eac871bf 100644 --- a/io_u.c +++ b/io_u.c @@ -1838,6 +1838,8 @@ static struct frand_state *get_buf_state(struct thread_data *td) if (!td->o.dedupe_percentage) return &td->buf_state; + else if (td->o.dedupe_percentage == 100) + return &td->buf_state_prev; r = __rand(&td->dedupe_state); v = 1 + (int) (100.0 * (r / (FRAND_MAX + 1.0)));