Whamcloud - gitweb
LU-12930 various: use schedule_timeout_*interruptible
[fs/lustre-release.git] / lnet / klnds / socklnd / socklnd.c
index 364fb54..96c16fd 100644 (file)
@@ -748,9 +748,10 @@ ksocknal_select_ips(struct ksock_peer_ni *peer_ni, __u32 *peerips, int n_peerips
        LASSERT(net->ksnn_ninterfaces <= LNET_INTERFACES_NUM);
 
        /* Only match interfaces for additional connections
-         * if I have > 1 interface */
-        n_ips = (net->ksnn_ninterfaces < 2) ? 0 :
-                MIN(n_peerips, net->ksnn_ninterfaces);
+        * if I have > 1 interface
+        */
+       n_ips = (net->ksnn_ninterfaces < 2) ? 0 :
+               min(n_peerips, net->ksnn_ninterfaces);
 
         for (i = 0; peer_ni->ksnp_n_passive_ips < n_ips; i++) {
                 /*              ^ yes really... */
@@ -2215,8 +2216,7 @@ ksocknal_base_shutdown(void)
                                "waiting for %d threads to terminate\n",
                                ksocknal_data.ksnd_nthreads);
                        read_unlock(&ksocknal_data.ksnd_global_lock);
-                       set_current_state(TASK_UNINTERRUPTIBLE);
-                       schedule_timeout(cfs_time_seconds(1));
+                       schedule_timeout_uninterruptible(cfs_time_seconds(1));
                        read_lock(&ksocknal_data.ksnd_global_lock);
                }
                read_unlock(&ksocknal_data.ksnd_global_lock);
@@ -2424,8 +2424,7 @@ ksocknal_shutdown(struct lnet_ni *ni)
                CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, /* power of 2? */
                       "waiting for %d peers to disconnect\n",
                       atomic_read(&net->ksnn_npeers) - SOCKNAL_SHUTDOWN_BIAS);
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(cfs_time_seconds(1));
+               schedule_timeout_uninterruptible(cfs_time_seconds(1));
 
                ksocknal_debug_peerhash(ni);
        }