Whamcloud - gitweb
LU-4423 lnet: use 64-bit time for selftest
[fs/lustre-release.git] / lnet / selftest / framework.c
index 07a2812..e5e302a 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -43,7 +39,7 @@
 
 #include "selftest.h"
 
-lst_sid_t LST_INVALID_SID = {LNET_NID_ANY, -1};
+struct lst_sid LST_INVALID_SID = {LNET_NID_ANY, -1};
 
 static int session_timeout = 100;
 module_param(session_timeout, int, 0444);
@@ -178,8 +174,7 @@ sfw_add_session_timer (void)
         LASSERT (!sn->sn_timer_active);
 
         sn->sn_timer_active = 1;
-        timer->stt_expires = cfs_time_add(sn->sn_timeout,
-                                          cfs_time_current_sec());
+       timer->stt_expires = ktime_get_real_seconds()+ sn->sn_timeout;
         stt_add_timer(timer);
         return;
 }
@@ -268,7 +263,7 @@ sfw_session_expired (void *data)
 }
 
 static inline void
-sfw_init_session(sfw_session_t *sn, lst_sid_t sid,
+sfw_init_session(sfw_session_t *sn, struct lst_sid sid,
                 unsigned features, const char *name)
 {
         stt_timer_t *timer = &sn->sn_timer;
@@ -334,7 +329,7 @@ sfw_client_rpc_fini (srpc_client_rpc_t *rpc)
 }
 
 static sfw_batch_t *
-sfw_find_batch (lst_bid_t bid)
+sfw_find_batch(struct lst_bid bid)
 {
        sfw_session_t *sn = sfw_data.fw_session;
        sfw_batch_t   *bat;
@@ -350,7 +345,7 @@ sfw_find_batch (lst_bid_t bid)
 }
 
 static sfw_batch_t *
-sfw_bid2batch (lst_bid_t bid)
+sfw_bid2batch(struct lst_bid bid)
 {
         sfw_session_t *sn = sfw_data.fw_session;
         sfw_batch_t   *bat;
@@ -379,7 +374,7 @@ static int
 sfw_get_stats (srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
 {
         sfw_session_t  *sn = sfw_data.fw_session;
-        sfw_counters_t *cnt = &reply->str_fw;
+       struct sfw_counters *cnt = &reply->str_fw;
         sfw_batch_t    *bat;
         struct timeval  tv;
 
@@ -1125,7 +1120,7 @@ sfw_alloc_pages(struct srpc_server_rpc *rpc, int cpt, int npages, int len,
        LASSERT(rpc->srpc_bulk == NULL);
        LASSERT(npages > 0 && npages <= LNET_MAX_IOV);
 
-       rpc->srpc_bulk = srpc_alloc_bulk(cpt, npages, len, sink);
+       rpc->srpc_bulk = srpc_alloc_bulk(cpt, 0, npages, len, sink);
        if (rpc->srpc_bulk == NULL)
                return -ENOMEM;
 
@@ -1181,7 +1176,7 @@ sfw_add_test (srpc_server_rpc_t *rpc)
                int     len;
 
                if ((sn->sn_features & LST_FEAT_BULK_LEN) == 0) {
-                       len = npg * PAGE_CACHE_SIZE;
+                       len = npg * PAGE_SIZE;
 
                } else  {
                        len = sizeof(lnet_process_id_packed_t) *