Whamcloud - gitweb
LU-8891 llite: rcu-walk check should not depend on statahead
[fs/lustre-release.git] / lnet / selftest / conrpc.c
index f41b1e0..749714a 100644 (file)
@@ -503,10 +503,10 @@ lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans,
 
                 dur = (cfs_duration_t)cfs_time_sub(crpc->crp_stamp,
                       (cfs_time_t)console_session.ses_id.ses_stamp);
-                cfs_duration_usec(dur, &tv);
+               jiffies_to_timeval(dur, &tv);
 
                if (copy_to_user(&ent->rpe_peer,
-                                &nd->nd_id, sizeof(lnet_process_id_t)) ||
+                                &nd->nd_id, sizeof(struct lnet_process_id)) ||
                    copy_to_user(&ent->rpe_stamp, &tv, sizeof(tv)) ||
                    copy_to_user(&ent->rpe_state,
                                 &nd->nd_state, sizeof(nd->nd_state)) ||
@@ -699,17 +699,17 @@ lstcon_statrpc_prep(lstcon_node_t *nd, unsigned feats, lstcon_rpc_t **crpc)
         return 0;
 }
 
-static lnet_process_id_packed_t *
+static struct lnet_process_id_packed *
 lstcon_next_id(int idx, int nkiov, lnet_kiov_t *kiov)
 {
-        lnet_process_id_packed_t *pid;
+       struct lnet_process_id_packed *pid;
         int                       i;
 
         i = idx / SFW_ID_PER_PAGE;
 
         LASSERT (i < nkiov);
 
-       pid = (lnet_process_id_packed_t *)page_address(kiov[i].kiov_page);
+       pid = (struct lnet_process_id_packed *)page_address(kiov[i].kiov_page);
 
         return &pid[idx % SFW_ID_PER_PAGE];
 }
@@ -718,7 +718,7 @@ static int
 lstcon_dstnodes_prep(lstcon_group_t *grp, int idx,
                      int dist, int span, int nkiov, lnet_kiov_t *kiov)
 {
-        lnet_process_id_packed_t *pid;
+       struct lnet_process_id_packed *pid;
         lstcon_ndlink_t          *ndl;
         lstcon_node_t            *nd;
         int                       start;
@@ -823,7 +823,7 @@ lstcon_testrpc_prep(lstcon_node_t *nd, int transop, unsigned feats,
                npg = sfw_id_pages(test->tes_span);
                nob = (feats & LST_FEAT_BULK_LEN) == 0 ?
                      npg * PAGE_SIZE :
-                     sizeof(lnet_process_id_packed_t) * test->tes_span;
+                     sizeof(struct lnet_process_id_packed) * test->tes_span;
        }
 
        rc = lstcon_rpc_prep(nd, SRPC_SERVICE_TEST, feats, npg, nob, crpc);
@@ -1176,7 +1176,7 @@ lstcon_rpc_pinger(void *arg)
         srpc_debug_reqst_t *drq;
         lstcon_ndlink_t    *ndl;
         lstcon_node_t      *nd;
-        time_t              intv;
+       int intv;
         int                 count = 0;
         int                 rc;
 
@@ -1190,10 +1190,10 @@ lstcon_rpc_pinger(void *arg)
                 return;
         }
 
-        if (!console_session.ses_expired &&
-            cfs_time_current_sec() - console_session.ses_laststamp >
-            (time_t)console_session.ses_timeout)
-                console_session.ses_expired = 1;
+       if (!console_session.ses_expired &&
+           ktime_get_real_seconds() - console_session.ses_laststamp >
+           (time64_t)console_session.ses_timeout)
+               console_session.ses_expired = 1;
 
        trans = console_session.ses_ping;
 
@@ -1248,9 +1248,8 @@ lstcon_rpc_pinger(void *arg)
                 if (nd->nd_state != LST_NODE_ACTIVE)
                         continue;
 
-                intv = cfs_duration_sec(cfs_time_sub(cfs_time_current(),
-                                                     nd->nd_stamp));
-                if (intv < (time_t)nd->nd_timeout / 2)
+               intv = cfs_duration_sec(jiffies - nd->nd_stamp);
+               if (intv < nd->nd_timeout / 2)
                         continue;
 
                rc = lstcon_rpc_init(nd, SRPC_SERVICE_DEBUG,
@@ -1278,8 +1277,8 @@ lstcon_rpc_pinger(void *arg)
 
         CDEBUG(D_NET, "Ping %d nodes in session\n", count);
 
-        ptimer->stt_expires = (cfs_time_t)(cfs_time_current_sec() + LST_PING_INTERVAL);
-        stt_add_timer(ptimer);
+       ptimer->stt_expires = ktime_get_real_seconds() + LST_PING_INTERVAL;
+       stt_add_timer(ptimer);
 
        mutex_unlock(&console_session.ses_mutex);
 }
@@ -1300,10 +1299,10 @@ lstcon_rpc_pinger_start(void)
                 return rc;
         }
 
-        ptimer = &console_session.ses_ping_timer;
-        ptimer->stt_expires = (cfs_time_t)(cfs_time_current_sec() + LST_PING_INTERVAL);
+       ptimer = &console_session.ses_ping_timer;
+       ptimer->stt_expires = ktime_get_real_seconds() + LST_PING_INTERVAL;
 
-        stt_add_timer(ptimer);
+       stt_add_timer(ptimer);
 
         return 0;
 }