From: Jens Axboe Date: Tue, 29 Jan 2013 19:53:52 +0000 (+0100) Subject: client/server: fixup missing TRIM conversions X-Git-Tag: fio-2.0.14~65 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=78799debc66f717469e751b3b9eb5dfa48cc547b;p=fio.git client/server: fixup missing TRIM conversions Signed-off-by: Jens Axboe --- diff --git a/client.c b/client.c index 83cb57ea..6021e4a5 100644 --- 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]; } diff --git a/server.c b/server.c index 3607ee81..0cc3fad0 100644 --- 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]); }