client/server: fixup missing TRIM conversions
authorJens Axboe <axboe@kernel.dk>
Tue, 29 Jan 2013 19:53:52 +0000 (20:53 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Jan 2013 19:53:52 +0000 (20:53 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
client.c
server.c

index 83cb57ea033ecd039a1c1331b27178d1a77bd9cc..6021e4a5810568015be5c259bd1a78627c02d23e 100644 (file)
--- a/client.c
+++ b/client.c
@@ -596,7 +596,7 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
        dst->pid        = le32_to_cpu(src->pid);
        dst->members    = le32_to_cpu(src->members);
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                convert_io_stat(&dst->clat_stat[i], &src->clat_stat[i]);
                convert_io_stat(&dst->slat_stat[i], &src->slat_stat[i]);
                convert_io_stat(&dst->lat_stat[i], &src->lat_stat[i]);
@@ -628,11 +628,11 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
                dst->io_u_lat_m[i]      = le32_to_cpu(src->io_u_lat_m[i]);
        }
 
-       for (i = 0; i < 2; i++)
+       for (i = 0; i < DDIR_RWDIR_CNT; i++)
                for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
                        dst->io_u_plat[i][j] = le32_to_cpu(src->io_u_plat[i][j]);
 
-       for (i = 0; i < 3; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                dst->total_io_u[i]      = le64_to_cpu(src->total_io_u[i]);
                dst->short_io_u[i]      = le64_to_cpu(src->short_io_u[i]);
        }
@@ -640,7 +640,7 @@ static void convert_ts(struct thread_stat *dst, struct thread_stat *src)
        dst->total_submit       = le64_to_cpu(src->total_submit);
        dst->total_complete     = le64_to_cpu(src->total_complete);
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                dst->io_bytes[i]        = le64_to_cpu(src->io_bytes[i]);
                dst->runtime[i]         = le64_to_cpu(src->runtime[i]);
        }
@@ -656,7 +656,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src)
 {
        int i;
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                dst->max_run[i]         = le64_to_cpu(src->max_run[i]);
                dst->min_run[i]         = le64_to_cpu(src->min_run[i]);
                dst->max_bw[i]          = le64_to_cpu(src->max_bw[i]);
@@ -763,7 +763,7 @@ static void convert_jobs_eta(struct jobs_eta *je)
        je->m_iops              = le32_to_cpu(je->m_iops);
        je->t_iops              = le32_to_cpu(je->t_iops);
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                je->rate[i]     = le32_to_cpu(je->rate[i]);
                je->iops[i]     = le32_to_cpu(je->iops[i]);
        }
@@ -786,7 +786,7 @@ static void sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je)
        dst->m_iops             += je->m_iops;
        dst->t_iops             += je->t_iops;
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                dst->rate[i]    += je->rate[i];
                dst->iops[i]    += je->iops[i];
        }
index 3607ee81f5b21d2a9ca3b99f5bdd0e1849d247c7..0cc3fad02674eb270d1c5675ad0c643988e172fb 100644 (file)
--- a/server.c
+++ b/server.c
@@ -445,7 +445,7 @@ static int handle_send_eta_cmd(struct fio_net_cmd *cmd)
        je->m_iops              = cpu_to_le32(je->m_iops);
        je->t_iops              = cpu_to_le32(je->t_iops);
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                je->rate[i]     = cpu_to_le32(je->rate[i]);
                je->iops[i]     = cpu_to_le32(je->iops[i]);
        }
@@ -637,7 +637,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src)
 {
        int i;
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                dst->max_run[i]         = cpu_to_le64(src->max_run[i]);
                dst->min_run[i]         = cpu_to_le64(src->min_run[i]);
                dst->max_bw[i]          = cpu_to_le64(src->max_bw[i]);
@@ -672,7 +672,7 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
        p.ts.pid        = cpu_to_le32(ts->pid);
        p.ts.members    = cpu_to_le32(ts->members);
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                convert_io_stat(&p.ts.clat_stat[i], &ts->clat_stat[i]);
                convert_io_stat(&p.ts.slat_stat[i], &ts->slat_stat[i]);
                convert_io_stat(&p.ts.lat_stat[i], &ts->lat_stat[i]);
@@ -704,11 +704,11 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
                p.ts.io_u_lat_m[i]      = cpu_to_le32(ts->io_u_lat_m[i]);
        }
 
-       for (i = 0; i < 2; i++)
+       for (i = 0; i < DDIR_RWDIR_CNT; i++)
                for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
                        p.ts.io_u_plat[i][j] = cpu_to_le32(ts->io_u_plat[i][j]);
 
-       for (i = 0; i < 3; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                p.ts.total_io_u[i]      = cpu_to_le64(ts->total_io_u[i]);
                p.ts.short_io_u[i]      = cpu_to_le64(ts->short_io_u[i]);
        }
@@ -716,7 +716,7 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
        p.ts.total_submit       = cpu_to_le64(ts->total_submit);
        p.ts.total_complete     = cpu_to_le64(ts->total_complete);
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                p.ts.io_bytes[i]        = cpu_to_le64(ts->io_bytes[i]);
                p.ts.runtime[i]         = cpu_to_le64(ts->runtime[i]);
        }