options: set 'refill_buffers' for compress_percentage != 0
authorJens Axboe <axboe@fb.com>
Mon, 23 Nov 2015 19:28:11 +0000 (12:28 -0700)
committerJens Axboe <axboe@fb.com>
Mon, 23 Nov 2015 19:28:11 +0000 (12:28 -0700)
Only do it if the user hasn't set it.

Signed-off-by: Jens Axboe <axboe@fb.com>
init.c

diff --git a/init.c b/init.c
index af35ee6810eefdc1828bbb688b6802cd951c309d..b7945cf35e81f0a4a1321268e55f6efd00505eee 100644 (file)
--- a/init.c
+++ b/init.c
@@ -737,11 +737,16 @@ static int fixup_options(struct thread_data *td)
 
        /*
         * For fully compressible data, just zero them at init time.
 
        /*
         * For fully compressible data, just zero them at init time.
-        * It's faster than repeatedly filling it.
+        * It's faster than repeatedly filling it. For non-zero
+        * compression, we should have refill_buffers set. Set it, unless
+        * the job file already changed it.
         */
         */
-       if (td->o.compress_percentage == 100) {
-               td->o.zero_buffers = 1;
-               td->o.compress_percentage = 0;
+       if (o->compress_percentage) {
+               if (o->compress_percentage == 100) {
+                       o->zero_buffers = 1;
+                       o->compress_percentage = 0;
+               } else if (!fio_option_is_set(o, refill_buffers))
+                       o->refill_buffers = 1;
        }
 
        /*
        }
 
        /*