Whamcloud - gitweb
LU-4423 selftest: use jiffies_to_*() instead of cfs_duration_usec
[fs/lustre-release.git] / lnet / selftest / framework.c
index ae43d09..032d95e 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "selftest.h"
 
-struct lst_sid LST_INVALID_SID = {LNET_NID_ANY, -1};
+struct lst_sid LST_INVALID_SID = { .ses_nid = LNET_NID_ANY, .ses_stamp = -1};
 
 static int session_timeout = 100;
 module_param(session_timeout, int, 0444);
@@ -376,7 +376,6 @@ sfw_get_stats (srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
         sfw_session_t  *sn = sfw_data.fw_session;
        struct sfw_counters *cnt = &reply->str_fw;
         sfw_batch_t    *bat;
-        struct timeval  tv;
 
         reply->str_sid = (sn == NULL) ? LST_INVALID_SID : sn->sn_id;
 
@@ -395,10 +394,7 @@ sfw_get_stats (srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
 
         /* send over the msecs since the session was started
          - with 32 bits to send, this is ~49 days */
-        cfs_duration_usec(cfs_time_sub(cfs_time_current(),
-                                       sn->sn_started), &tv);
-
-        cnt->running_ms      = (__u32)(tv.tv_sec * 1000 + tv.tv_usec / 1000);
+       cnt->running_ms      = jiffies_to_msecs(jiffies - sn->sn_started);
        cnt->brw_errors      = atomic_read(&sn->sn_brw_errors);
        cnt->ping_errors     = atomic_read(&sn->sn_ping_errors);
        cnt->zombie_sessions = atomic_read(&sfw_data.fw_nzombies);
@@ -913,7 +909,7 @@ sfw_test_rpc_done (srpc_client_rpc_t *rpc)
 }
 
 int
-sfw_create_test_rpc(sfw_test_unit_t *tsu, lnet_process_id_t peer,
+sfw_create_test_rpc(sfw_test_unit_t *tsu, struct lnet_process_id peer,
                    unsigned features, int nblk, int blklen,
                    srpc_client_rpc_t **rpcpp)
 {
@@ -1032,7 +1028,8 @@ sfw_run_batch (sfw_batch_t *tsb)
                        wi = &tsu->tsu_worker;
                        swi_init_workitem(wi, tsu, sfw_run_test,
                                          lst_sched_test[\
-                                         lnet_cpt_of_nid(tsu->tsu_dest.nid)]);
+                                         lnet_cpt_of_nid(tsu->tsu_dest.nid,
+                                                         NULL)]);
                        swi_schedule_workitem(wi);
                }
        }
@@ -1393,7 +1390,7 @@ sfw_bulk_ready(struct srpc_server_rpc *rpc, int status)
 }
 
 srpc_client_rpc_t *
-sfw_create_rpc(lnet_process_id_t peer, int service,
+sfw_create_rpc(struct lnet_process_id peer, int service,
               unsigned features, int nbulkiov, int bulklen,
               void (*done)(srpc_client_rpc_t *), void *priv)
 {