Don't scramble buffers if compression is enabled
[fio.git] / init.c
diff --git a/init.c b/init.c
index 5fc3b224f2d4c766a8a8cd07574fe24120cd173d..0a872c0f1eed90eb05c05b89abeaab5a7fa104a7 100644 (file)
--- a/init.c
+++ b/init.c
@@ -856,6 +856,11 @@ int ioengine_load(struct thread_data *td)
        return 0;
 }
 
+static int compression_enabled(struct thread_options *o)
+{
+       return o->compress_percentage || o->compress_chunk;
+}
+
 static void init_flags(struct thread_data *td)
 {
        struct thread_options *o = &td->o;
@@ -868,8 +873,14 @@ static void init_flags(struct thread_data *td)
                td->flags |= TD_F_READ_IOLOG;
        if (o->refill_buffers)
                td->flags |= TD_F_REFILL_BUFFERS;
-       if (o->scramble_buffers)
+
+       /*
+        * Don't scramble buffers if we set any of the compression
+        * settings
+        */
+       if (o->scramble_buffers && !compression_enabled(o))
                td->flags |= TD_F_SCRAMBLE_BUFFERS;
+
        if (o->verify != VERIFY_NONE)
                td->flags |= TD_F_VER_NONE;
 }
@@ -1026,10 +1037,10 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
                file_alloced = 1;
 
                if (o->nr_files == 1 && exists_and_not_file(jobname))
-                       add_file(td, jobname, job_add_num);
+                       add_file(td, jobname, job_add_num, 0);
                else {
                        for (i = 0; i < o->nr_files; i++)
-                               add_file(td, make_filename(fname, o, jobname, job_add_num, i), job_add_num);
+                               add_file(td, make_filename(fname, o, jobname, job_add_num, i), job_add_num, 0);
                }
        }
 
@@ -1773,7 +1784,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                case 'E': {
                        long long t = 0;
 
-                       if (str_to_decimal(optarg, &t, 0, NULL)) {
+                       if (str_to_decimal(optarg, &t, 0, NULL, 1)) {
                                log_err("fio: failed parsing eta time %s\n", optarg);
                                exit_val = 1;
                                do_exit++;
@@ -1933,7 +1944,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                case 'L': {
                        long long val;
 
-                       if (check_str_time(optarg, &val)) {
+                       if (check_str_time(optarg, &val, 1)) {
                                log_err("fio: failed parsing time %s\n", optarg);
                                do_exit++;
                                exit_val = 1;