Whamcloud - gitweb
LU-4423 lnet: Drop unnecessary wrapper function srpc_post_active_rqtbuf
[fs/lustre-release.git] / lnet / selftest / rpc.c
index 5685a60..8d81792 100644 (file)
@@ -27,7 +27,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, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -443,15 +443,6 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
 }
 
 static int
-srpc_post_active_rqtbuf(lnet_process_id_t peer, int service, void *buf,
-                       int len, lnet_handle_md_t *mdh, srpc_event_t *ev)
-{
-       return srpc_post_active_rdma(srpc_serv_portal(service), service,
-                                    buf, len, LNET_MD_OP_PUT, peer,
-                                    LNET_NID_ANY, mdh, ev);
-}
-
-static int
 srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
                         lnet_handle_md_t *mdh, srpc_event_t *ev)
 {
@@ -798,9 +789,11 @@ srpc_send_request (srpc_client_rpc_t *rpc)
         ev->ev_data  = rpc;
         ev->ev_type  = SRPC_REQUEST_SENT;
 
-        rc = srpc_post_active_rqtbuf(rpc->crpc_dest, rpc->crpc_service,
-                                     &rpc->crpc_reqstmsg, sizeof(srpc_msg_t),
-                                     &rpc->crpc_reqstmdh, ev);
+       rc = srpc_post_active_rdma(srpc_serv_portal(rpc->crpc_service),
+                                  rpc->crpc_service, &rpc->crpc_reqstmsg,
+                                  sizeof(srpc_msg_t), LNET_MD_OP_PUT,
+                                  rpc->crpc_dest, LNET_NID_ANY,
+                                  &rpc->crpc_reqstmdh, ev);
         if (rc != 0) {
                 LASSERT (rc == -ENOMEM);
                 ev->ev_fired = 1;  /* no more event expected */
@@ -1117,7 +1110,7 @@ srpc_del_client_rpc_timer (srpc_client_rpc_t *rpc)
        if (rpc->crpc_timeout == 0)
                return;
 
-       /* timer sucessfully defused */
+       /* timer successfully defused */
        if (stt_del_timer(&rpc->crpc_timer))
                return;
 
@@ -1593,9 +1586,10 @@ srpc_startup (void)
        memset(&srpc_data, 0, sizeof(struct smoketest_rpc));
        spin_lock_init(&srpc_data.rpc_glock);
 
-        /* 1 second pause to avoid timestamp reuse */
-        cfs_pause(cfs_time_seconds(1));
-        srpc_data.rpc_matchbits = ((__u64) cfs_time_current_sec()) << 48;
+       /* 1 second pause to avoid timestamp reuse */
+       set_current_state(TASK_UNINTERRUPTIBLE);
+       schedule_timeout(cfs_time_seconds(1));
+       srpc_data.rpc_matchbits = ((__u64) cfs_time_current_sec()) << 48;
 
         srpc_data.rpc_state = SRPC_STATE_NONE;