Whamcloud - gitweb
LU-12930 various: use schedule_timeout_*interruptible
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd.c
index bcbc0ac..14fb5d6 100644 (file)
@@ -291,8 +291,8 @@ kgnilnd_create_conn(kgn_conn_t **connp, kgn_device_t *dev)
         * check context */
        conn->gnc_device = dev;
 
-       conn->gnc_timeout = MAX(*kgnilnd_tunables.kgn_timeout,
-                               GNILND_MIN_TIMEOUT);
+       conn->gnc_timeout = max(*kgnilnd_tunables.kgn_timeout,
+                                GNILND_MIN_TIMEOUT);
        kgnilnd_update_reaper_timeout(conn->gnc_timeout);
 
        /* this is the ep_handle for doing SMSG & BTE */
@@ -879,7 +879,7 @@ kgnilnd_set_conn_params(kgn_dgram_t *dgram)
        /* set timeout vals in conn early so we can use them for the NAK */
 
        /* use max of the requested and our timeout, peer will do the same */
-       conn->gnc_timeout = MAX(conn->gnc_timeout, connreq->gncr_timeout);
+       conn->gnc_timeout = max(conn->gnc_timeout, connreq->gncr_timeout);
 
        /* only ep_bind really mucks around with the CQ */
        /* only ep bind if we are not connecting to ourself and the dstnid is not a wildcard. this check
@@ -1261,8 +1261,8 @@ kgnilnd_peer_increase_reconnect_locked(kgn_peer_t *peer)
                current_to += *kgnilnd_tunables.kgn_min_reconnect_interval / 2;
        }
 
-       current_to = MIN(current_to,
-                               *kgnilnd_tunables.kgn_max_reconnect_interval);
+       current_to = min(current_to,
+                        *kgnilnd_tunables.kgn_max_reconnect_interval);
 
        peer->gnp_reconnect_interval = current_to;
        CDEBUG(D_NET, "peer %s can reconnect at %lu interval %lu\n",
@@ -1598,8 +1598,7 @@ kgnilnd_del_conn_or_peer(kgn_net_t *net, lnet_nid_t nid, int command,
               atomic_read(&kgnilnd_data.kgn_npending_detach)  ||
               atomic_read(&kgnilnd_data.kgn_npending_unlink)) {
 
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(cfs_time_seconds(1));
+               schedule_timeout_uninterruptible(cfs_time_seconds(1));
                i++;
 
                CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, "Waiting on %d peers %d closes %d detaches\n",
@@ -2464,8 +2463,7 @@ kgnilnd_base_shutdown(void)
 
                CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET,
                        "Waiting for conns to be cleaned up %d\n",atomic_read(&kgnilnd_data.kgn_nconns));
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(cfs_time_seconds(1));
+               schedule_timeout_uninterruptible(cfs_time_seconds(1));
        }
        /* Peer state all cleaned up BEFORE setting shutdown, so threads don't
         * have to worry about shutdown races.  NB connections may be created
@@ -2484,8 +2482,7 @@ kgnilnd_base_shutdown(void)
                i++;
                CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET,
                       "Waiting for ruhroh thread to terminate\n");
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(cfs_time_seconds(1));
+               schedule_timeout_uninterruptible(cfs_time_seconds(1));
        }
 
        /* Flag threads to terminate */
@@ -2517,8 +2514,7 @@ kgnilnd_base_shutdown(void)
                CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, /* power of 2? */
                       "Waiting for %d threads to terminate\n",
                       atomic_read(&kgnilnd_data.kgn_nthreads));
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(cfs_time_seconds(1));
+               schedule_timeout_uninterruptible(cfs_time_seconds(1));
        }
 
        LASSERTF(atomic_read(&kgnilnd_data.kgn_npeers) == 0,
@@ -2769,8 +2765,7 @@ kgnilnd_shutdown(struct lnet_ni *ni)
                                "Waiting for %d references to clear on net %d\n",
                                atomic_read(&net->gnn_refcount),
                                net->gnn_netnum);
-                       set_current_state(TASK_UNINTERRUPTIBLE);
-                       schedule_timeout(cfs_time_seconds(1));
+                       schedule_timeout_uninterruptible(cfs_time_seconds(1));
                }
 
                /* release ref from kgnilnd_startup */