Whamcloud - gitweb
LU-6142 lnet: convert kiblnd/ksocknal_thread_start to vararg
[fs/lustre-release.git] / lnet / klnds / o2iblnd / o2iblnd.c
index 82b8d10..1b57abf 100644 (file)
@@ -525,7 +525,6 @@ kiblnd_get_conn_by_idx(struct lnet_ni *ni, int index)
 {
        struct kib_peer_ni *peer_ni;
        struct kib_conn *conn;
-       struct list_head *ctmp;
        int i;
        unsigned long flags;
 
@@ -537,11 +536,11 @@ kiblnd_get_conn_by_idx(struct lnet_ni *ni, int index)
                if (peer_ni->ibp_ni != ni)
                        continue;
 
-               list_for_each(ctmp, &peer_ni->ibp_conns) {
+               list_for_each_entry(conn, &peer_ni->ibp_conns,
+                                   ibc_list) {
                        if (index-- > 0)
                                continue;
 
-                       conn = list_entry(ctmp, struct kib_conn, ibc_list);
                        kiblnd_conn_addref(conn);
                        read_unlock_irqrestore(&kiblnd_data.kib_global_lock,
                                               flags);
@@ -1752,10 +1751,11 @@ kiblnd_fmr_pool_unmap(struct kib_fmr *fmr, int status)
 
                if (frd) {
                        frd->frd_valid = false;
+                       frd->frd_posted = false;
+                       fmr->fmr_frd = NULL;
                        spin_lock(&fps->fps_lock);
                        list_add_tail(&frd->frd_list, &fpo->fast_reg.fpo_pool_list);
                        spin_unlock(&fps->fps_lock);
-                       fmr->fmr_frd = NULL;
                }
        }
        fmr->fmr_pool = NULL;
@@ -1922,6 +1922,7 @@ again:
                                fmr->fmr_key  = is_rx ? mr->rkey : mr->lkey;
                                fmr->fmr_frd  = frd;
                                fmr->fmr_pool = fpo;
+                               frd->frd_posted = false;
                                return 0;
                        }
                        spin_unlock(&fps->fps_lock);
@@ -3158,12 +3159,11 @@ kiblnd_start_schedulers(struct kib_sched_info *sched)
        }
 
        for (i = 0; i < nthrs; i++) {
-               long    id;
-               char    name[20];
-               id = KIB_THREAD_ID(sched->ibs_cpt, sched->ibs_nthreads + i);
-               snprintf(name, sizeof(name), "kiblnd_sd_%02ld_%02ld",
-                        KIB_THREAD_CPT(id), KIB_THREAD_TID(id));
-               rc = kiblnd_thread_start(kiblnd_scheduler, (void *)id, name);
+               long    id = KIB_THREAD_ID(sched->ibs_cpt, sched->ibs_nthreads + i);
+
+               rc = kiblnd_thread_start(kiblnd_scheduler, (void *)id,
+                                        "kiblnd_sd_%02ld_%02ld",
+                                        KIB_THREAD_CPT(id), KIB_THREAD_TID(id));
                if (rc == 0)
                        continue;