Pass in client for thread/group status op
authorJens Axboe <axboe@kernel.dk>
Mon, 5 Mar 2012 08:21:12 +0000 (09:21 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 5 Mar 2012 08:21:12 +0000 (09:21 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
client.c
client.h
gfio.c

index 23c5b6cd2c8fe5d0c85676a4d9f58d592e3979f1..a65cbcba9d505795f76eb72ce2ad958c87569c97 100644 (file)
--- 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;
                }
index e7a1d83fb47af7b2893b47054be73e8d596e1db7..d0f9b28101d17bbefe24133baacb25380447c8ab 100644 (file)
--- 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 157dd667f4ed928aca615626aa93f39deb4f4a4c..ebfa4b9de7dcd752926baaf00d66836d60caa334 100644 (file)
--- 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)