Whamcloud - gitweb
Revert "LU-1013 obdclass: lu_object_find miss to unlink object from LRU"
[fs/lustre-release.git] / lnet / lnet / api-ni.c
index 07069db..4cf824e 100644 (file)
@@ -137,8 +137,8 @@ lnet_get_networks (void)
                 return (rc == 0) ? networks : NULL;
         }
 #else
-        ip2nets = NULL;
-        rc = 0;
+        SET_BUT_UNUSED(ip2nets);
+        SET_BUT_UNUSED(rc);
 #endif
         if (networks != NULL)
                 return networks;
@@ -482,7 +482,7 @@ lnet_setup_handle_hash (void)
         /* Arbitrary choice of hash table size */
 #ifdef __KERNEL__
         the_lnet.ln_lh_hash_size =
-                CFS_PAGE_SIZE / sizeof (cfs_list_t);
+                (2 * CFS_PAGE_SIZE) / sizeof (cfs_list_t);
 #else
         the_lnet.ln_lh_hash_size = (MAX_MES + MAX_MDS + MAX_EQS)/4;
 #endif
@@ -520,7 +520,7 @@ lnet_lookup_cookie (__u64 cookie, int type)
         if ((cookie & (LNET_COOKIE_TYPES - 1)) != type)
                 return (NULL);
 
-        hash = ((unsigned int)cookie) % the_lnet.ln_lh_hash_size;
+        hash = ((unsigned int)(cookie >> LNET_COOKIE_TYPE_BITS)) % the_lnet.ln_lh_hash_size;
         list = &the_lnet.ln_lh_hash_table[hash];
 
         cfs_list_for_each (el, list) {
@@ -544,7 +544,7 @@ lnet_initialise_handle (lnet_libhandle_t *lh, int type)
         lh->lh_cookie = the_lnet.ln_next_object_cookie | type;
         the_lnet.ln_next_object_cookie += LNET_COOKIE_TYPES;
 
-        hash = ((unsigned int)lh->lh_cookie) % the_lnet.ln_lh_hash_size;
+        hash = ((unsigned int)(lh->lh_cookie >> LNET_COOKIE_TYPE_BITS)) % the_lnet.ln_lh_hash_size;
         cfs_list_add (&lh->lh_hash_chain, &the_lnet.ln_lh_hash_table[hash]);
 }
 
@@ -925,7 +925,7 @@ lnet_shutdown_lndnis (void)
                 cfs_list_del (&ni->ni_list);
 
                 the_lnet.ln_nzombie_nis++;
-                lnet_ni_decref_locked(ni); /* drop apini's ref */
+                lnet_ni_decref_locked(ni); /* drop ln_nis' ref */
         }
 
         /* Drop the cached eqwait NI. */
@@ -952,7 +952,7 @@ lnet_shutdown_lndnis (void)
         lnet_clear_peer_table();
 
         LNET_LOCK();
-        /* Now wait for the NI's I just nuked to show up on apini_zombie_nis
+        /* Now wait for the NI's I just nuked to show up on ln_zombie_nis
          * and shut them down in guaranteed thread context */
         i = 2;
         while (the_lnet.ln_nzombie_nis != 0) {
@@ -1028,6 +1028,15 @@ lnet_startup_lndnis (void)
 
                 LASSERT (libcfs_isknown_lnd(lnd_type));
 
+                if (lnd_type == CIBLND    ||
+                    lnd_type == OPENIBLND ||
+                    lnd_type == IIBLND    ||
+                    lnd_type == VIBLND) {
+                        CERROR("LND %s obsoleted\n",
+                               libcfs_lnd2str(lnd_type));
+                        goto failed;
+                }
+
                 LNET_MUTEX_DOWN(&the_lnet.ln_lnd_mutex);
                 lnd = lnet_find_lnd_by_type(lnd_type);