t/run-fio-tests: rename FioJobTest to FioJobFileTest
[fio.git] / cconv.c
diff --git a/cconv.c b/cconv.c
index bb1af4970e975850a07c4e2ab57bc879686801d4..9095d5195eb2d1c4592e27f0b87cd0adaa925fba 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -48,6 +48,9 @@ static void free_thread_options_to_cpu(struct thread_options *o)
        free(o->profile);
        free(o->cgroup);
 
+       free(o->verify_pattern);
+       free(o->buffer_pattern);
+
        for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                free(o->bssplit[i]);
                free(o->zone_split[i]);
@@ -185,6 +188,10 @@ int convert_thread_options_to_cpu(struct thread_options *o,
            thread_options_pack_size(o) > top_sz)
                return -EINVAL;
 
+       o->verify_pattern = realloc(o->verify_pattern,
+                                   o->verify_pattern_bytes);
+       o->buffer_pattern = realloc(o->buffer_pattern,
+                                   o->buffer_pattern_bytes);
        memcpy(o->verify_pattern, top->patterns, o->verify_pattern_bytes);
        memcpy(o->buffer_pattern, &top->patterns[o->verify_pattern_bytes],
               o->buffer_pattern_bytes);
@@ -199,7 +206,6 @@ int convert_thread_options_to_cpu(struct thread_options *o,
        o->do_disk_util = le32_to_cpu(top->do_disk_util);
        o->override_sync = le32_to_cpu(top->override_sync);
        o->rand_repeatable = le32_to_cpu(top->rand_repeatable);
-       o->allrand_repeatable = le32_to_cpu(top->allrand_repeatable);
        o->rand_seed = le64_to_cpu(top->rand_seed);
        o->log_entries = le32_to_cpu(top->log_entries);
        o->log_avg_msec = le32_to_cpu(top->log_avg_msec);
@@ -245,6 +251,7 @@ int convert_thread_options_to_cpu(struct thread_options *o,
        o->ss_ramp_time = le64_to_cpu(top->ss_ramp_time);
        o->ss_state = le32_to_cpu(top->ss_state);
        o->ss_limit.u.f = fio_uint64_to_double(le64_to_cpu(top->ss_limit.u.i));
+       o->ss_check_interval = le64_to_cpu(top->ss_check_interval);
        o->zone_range = le64_to_cpu(top->zone_range);
        o->zone_size = le64_to_cpu(top->zone_size);
        o->zone_capacity = le64_to_cpu(top->zone_capacity);
@@ -342,6 +349,11 @@ int convert_thread_options_to_cpu(struct thread_options *o,
 
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                o->merge_blktrace_iters[i].u.f = fio_uint64_to_double(le64_to_cpu(top->merge_blktrace_iters[i].u.i));
+
+       o->fdp = le32_to_cpu(top->fdp);
+       o->fdp_nrpli = le32_to_cpu(top->fdp_nrpli);
+       for (i = 0; i < o->fdp_nrpli; i++)
+               o->fdp_plis[i] = le32_to_cpu(top->fdp_plis[i]);
 #if 0
        uint8_t cpumask[FIO_TOP_STR_MAX];
        uint8_t verify_cpumask[FIO_TOP_STR_MAX];
@@ -433,7 +445,6 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        top->do_disk_util = cpu_to_le32(o->do_disk_util);
        top->override_sync = cpu_to_le32(o->override_sync);
        top->rand_repeatable = cpu_to_le32(o->rand_repeatable);
-       top->allrand_repeatable = cpu_to_le32(o->allrand_repeatable);
        top->rand_seed = __cpu_to_le64(o->rand_seed);
        top->log_entries = cpu_to_le32(o->log_entries);
        top->log_avg_msec = cpu_to_le32(o->log_avg_msec);
@@ -602,6 +613,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        top->ss_ramp_time = __cpu_to_le64(top->ss_ramp_time);
        top->ss_state = cpu_to_le32(top->ss_state);
        top->ss_limit.u.i = __cpu_to_le64(fio_double_to_uint64(o->ss_limit.u.f));
+       top->ss_check_interval = __cpu_to_le64(top->ss_check_interval);
        top->zone_range = __cpu_to_le64(o->zone_range);
        top->zone_size = __cpu_to_le64(o->zone_size);
        top->zone_capacity = __cpu_to_le64(o->zone_capacity);
@@ -631,6 +643,11 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
 
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                top->merge_blktrace_iters[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->merge_blktrace_iters[i].u.f));
+
+       top->fdp = cpu_to_le32(o->fdp);
+       top->fdp_nrpli = cpu_to_le32(o->fdp_nrpli);
+       for (i = 0; i < o->fdp_nrpli; i++)
+               top->fdp_plis[i] = cpu_to_le32(o->fdp_plis[i]);
 #if 0
        uint8_t cpumask[FIO_TOP_STR_MAX];
        uint8_t verify_cpumask[FIO_TOP_STR_MAX];
@@ -651,8 +668,10 @@ int fio_test_cconv(struct thread_options *__o)
        int ret;
 
        o1.verify_pattern_bytes = 61;
+       o1.verify_pattern = malloc(o1.verify_pattern_bytes);
        memset(o1.verify_pattern, 'V', o1.verify_pattern_bytes);
        o1.buffer_pattern_bytes = 15;
+       o1.buffer_pattern = malloc(o1.buffer_pattern_bytes);
        memset(o1.buffer_pattern, 'B', o1.buffer_pattern_bytes);
 
        top_sz = thread_options_pack_size(&o1);
@@ -672,5 +691,7 @@ out:
        free_thread_options_to_cpu(&o2);
        free(top2);
        free(top1);
+       free(o1.buffer_pattern);
+       free(o1.verify_pattern);
        return ret;
 }