From 89e5fad91bc33f1687cca6b1bf5aa3084c424650 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 5 Mar 2012 09:21:12 +0100 Subject: [PATCH] Pass in client for thread/group status op Signed-off-by: Jens Axboe --- client.c | 12 ++++++------ client.h | 4 ++-- gfio.c | 10 ++++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/client.c b/client.c index 23c5b6cd..a65cbcba 100644 --- a/client.c +++ b/client.c @@ -22,8 +22,8 @@ #include "hash.h" static void handle_du(struct fio_client *client, struct fio_net_cmd *cmd); -static void handle_ts(struct fio_net_cmd *cmd); -static void handle_gs(struct fio_net_cmd *cmd); +static void handle_ts(struct fio_client *client, struct fio_net_cmd *cmd); +static void handle_gs(struct fio_client *client, struct fio_net_cmd *cmd); static void handle_probe(struct fio_client *client, struct fio_net_cmd *cmd); static void handle_text(struct fio_client *client, struct fio_net_cmd *cmd); @@ -621,7 +621,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src) dst->groupid = le32_to_cpu(src->groupid); } -static void handle_ts(struct fio_net_cmd *cmd) +static void handle_ts(struct fio_client *client, struct fio_net_cmd *cmd) { struct cmd_ts_pdu *p = (struct cmd_ts_pdu *) cmd->payload; @@ -642,7 +642,7 @@ static void handle_ts(struct fio_net_cmd *cmd) } } -static void handle_gs(struct fio_net_cmd *cmd) +static void handle_gs(struct fio_client *client, struct fio_net_cmd *cmd) { struct group_run_stats *gs = (struct group_run_stats *) cmd->payload; @@ -899,7 +899,7 @@ int fio_handle_client(struct fio_client *client) convert_ts(&p->ts, &p->ts); convert_gs(&p->rs, &p->rs); - ops->thread_status(cmd); + ops->thread_status(client, cmd); free(cmd); break; } @@ -908,7 +908,7 @@ int fio_handle_client(struct fio_client *client) convert_gs(gs, gs); - ops->group_stats(cmd); + ops->group_stats(client, cmd); free(cmd); break; } diff --git a/client.h b/client.h index e7a1d83f..d0f9b281 100644 --- a/client.h +++ b/client.h @@ -50,8 +50,8 @@ struct fio_client { typedef void (*client_text_op_func)(struct fio_client *client, struct fio_net_cmd *cmd); typedef void (*client_disk_util_op_func)(struct fio_client *client, struct fio_net_cmd *cmd); -typedef void (*client_thread_status_op)(struct fio_net_cmd *cmd); -typedef void (*client_group_stats_op)(struct fio_net_cmd *cmd); +typedef void (*client_thread_status_op)(struct fio_client *client, struct fio_net_cmd *cmd); +typedef void (*client_group_stats_op)(struct fio_client *client, struct fio_net_cmd *cmd); typedef void (*client_eta_op)(struct jobs_eta *je); typedef void (*client_probe_op)(struct fio_client *client, struct fio_net_cmd *cmd); typedef void (*client_thread_status_display_op)(char *status_message, double perc); diff --git a/gfio.c b/gfio.c index 157dd667..ebfa4b9d 100644 --- a/gfio.c +++ b/gfio.c @@ -154,16 +154,18 @@ static void gfio_disk_util_op(struct fio_client *client, struct fio_net_cmd *cmd fio_client_ops.disk_util(client, cmd); } -static void gfio_thread_status_op(struct fio_net_cmd *cmd) +static void gfio_thread_status_op(struct fio_client *client, + struct fio_net_cmd *cmd) { printf("gfio_thread_status_op called\n"); - fio_client_ops.thread_status(cmd); + fio_client_ops.thread_status(client, cmd); } -static void gfio_group_stats_op(struct fio_net_cmd *cmd) +static void gfio_group_stats_op(struct fio_client *client, + struct fio_net_cmd *cmd) { printf("gfio_group_stats_op called\n"); - fio_client_ops.group_stats(cmd); + fio_client_ops.group_stats(client, cmd); } static void gfio_update_eta(struct jobs_eta *je) -- 2.25.1