Whamcloud - gitweb
LU-12930 various: use schedule_timeout_*interruptible
[fs/lustre-release.git] / lnet / lnet / peer.c
index b373f49..8570b5d 100644 (file)
@@ -587,8 +587,7 @@ lnet_peer_ni_finalize_wait(struct lnet_peer_table *ptable)
                               "Waiting for %d zombies on peer table\n",
                               ptable->pt_zombies);
                }
-               set_current_state(TASK_UNINTERRUPTIBLE);
-               schedule_timeout(cfs_time_seconds(1) >> 1);
+               schedule_timeout_uninterruptible(cfs_time_seconds(1) >> 1);
                spin_lock(&ptable->pt_zombie_lock);
        }
        spin_unlock(&ptable->pt_zombie_lock);
@@ -1924,9 +1923,7 @@ static void lnet_peer_discovery_complete(struct lnet_peer *lp)
 {
        struct lnet_msg *msg, *tmp;
        int rc = 0;
-       struct list_head pending_msgs;
-
-       INIT_LIST_HEAD(&pending_msgs);
+       LIST_HEAD(pending_msgs);
 
        CDEBUG(D_NET, "Discovery complete. Dequeue peer %s\n",
               libcfs_nid2str(lp->lp_primary_nid));
@@ -2585,7 +2582,7 @@ static int lnet_peer_merge_data(struct lnet_peer *lp,
                lp->lp_state &= ~LNET_PEER_ROUTER_ENABLED;
        spin_unlock(&lp->lp_lock);
 
-       nnis = MAX(lp->lp_nnis, pbuf->pb_info.pi_nnis);
+       nnis = max_t(int, lp->lp_nnis, pbuf->pb_info.pi_nnis);
        LIBCFS_ALLOC(curnis, nnis * sizeof(*curnis));
        LIBCFS_ALLOC(addnis, nnis * sizeof(*addnis));
        LIBCFS_ALLOC(delnis, nnis * sizeof(*delnis));
@@ -2979,7 +2976,7 @@ __must_hold(&lp->lp_lock)
        pnid = lnet_peer_select_nid(lp);
        lnet_net_unlock(cpt);
 
-       nnis = MAX(lp->lp_data_nnis, LNET_INTERFACES_MIN);
+       nnis = max(lp->lp_data_nnis, LNET_INTERFACES_MIN);
 
        rc = lnet_send_ping(pnid, &lp->lp_ping_mdh, nnis, lp,
                            the_lnet.ln_dc_eqh, false);
@@ -3254,11 +3251,9 @@ static int lnet_peer_discovery_wait_for_work(void)
 static void lnet_resend_msgs(void)
 {
        struct lnet_msg *msg, *tmp;
-       struct list_head resend;
+       LIST_HEAD(resend);
        int rc;
 
-       INIT_LIST_HEAD(&resend);
-
        spin_lock(&the_lnet.ln_msg_resend_lock);
        list_splice(&the_lnet.ln_msg_resend, &resend);
        spin_unlock(&the_lnet.ln_msg_resend_lock);
@@ -3393,7 +3388,7 @@ static int lnet_peer_discovery(void *arg)
 
        /* Queue cleanup 2: wait for the expired queue to clear. */
        while (!list_empty(&the_lnet.ln_dc_expired))
-               schedule_timeout(cfs_time_seconds(1));
+               schedule_timeout_uninterruptible(cfs_time_seconds(1));
 
        /* Queue cleanup 3: clear the request queue. */
        lnet_net_lock(LNET_LOCK_EX);