Whamcloud - gitweb
b=18690 enable rehash for hash tables that intended to use it
authorJohann Lombardi <johann@sun.com>
Fri, 15 Jan 2010 10:32:27 +0000 (11:32 +0100)
committerJohann Lombardi <johann@sun.com>
Fri, 15 Jan 2010 10:32:27 +0000 (11:32 +0100)
lustre/lov/lov_obd.c
lustre/obdclass/class_hash.c
lustre/obdclass/obd_config.c
lustre/quota/quota_context.c

index 738a9c3..37723c5 100644 (file)
@@ -891,7 +891,8 @@ static int lov_setup(struct obd_device *obd, obd_count len, void *buf)
         lov->lov_pools_hash_body = lustre_hash_init("POOLS",
                                                     HASH_POOLS_CUR_BITS,
                                                     HASH_POOLS_MAX_BITS,
-                                                    &pool_hash_operations, 0);
+                                                    &pool_hash_operations,
+                                                    LH_REHASH);
         CFS_INIT_LIST_HEAD(&lov->lov_pool_list);
         lov->lov_pool_count = 0;
         rc = lov_ost_pool_init(&lov->lov_packed, 0);
index 0867098..682cdc8 100644 (file)
@@ -127,8 +127,8 @@ lustre_hash_init(char *name, unsigned int cur_bits, unsigned int max_bits,
         lh->lh_ops = ops;
         lh->lh_flags = flags;
         if (cur_bits != max_bits && (lh->lh_flags & LH_REHASH) == 0)
-                CDEBUG(D_INFO, "Rehash is disabled, ignore max_bits %d\n",
-                               max_bits);
+                CERROR("Rehash is disabled for %s, ignore max_bits %d\n",
+                       name, max_bits);
 
         /* theta * 1000 */
         __lustre_hash_set_theta(lh, 500, 2000);
index 487d763..2aefafb 100644 (file)
@@ -309,7 +309,7 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         obd->obd_uuid_hash = lustre_hash_init("UUID_HASH",
                                               HASH_UUID_CUR_BITS,
                                               HASH_UUID_MAX_BITS,
-                                              &uuid_hash_ops, 0);
+                                              &uuid_hash_ops, LH_REHASH);
         if (!obd->obd_uuid_hash)
                 GOTO(err_hash, err = -ENOMEM);
 
@@ -317,7 +317,7 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         obd->obd_nid_hash = lustre_hash_init("NID_HASH",
                                              HASH_NID_CUR_BITS,
                                              HASH_NID_MAX_BITS,
-                                             &nid_hash_ops, 0);
+                                             &nid_hash_ops, LH_REHASH);
         if (!obd->obd_nid_hash)
                 GOTO(err_hash, err = -ENOMEM);
 
@@ -325,7 +325,8 @@ int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         obd->obd_nid_stats_hash = lustre_hash_init("NID_STATS",
                                                    HASH_NID_STATS_CUR_BITS,
                                                    HASH_NID_STATS_MAX_BITS,
-                                                   &nid_stat_hash_ops, 0);
+                                                   &nid_stat_hash_ops,
+                                                   LH_REHASH);
         if (!obd->obd_nid_stats_hash)
                 GOTO(err_hash, err = -ENOMEM);
 
index c9014cb..c878dd7 100644 (file)
@@ -1258,7 +1258,7 @@ qctxt_init(struct obd_device *obd, dqacq_handler_t handler)
         qctxt->lqc_lqs_hash = lustre_hash_init("LQS_HASH",
                                                HASH_LQS_CUR_BITS,
                                                HASH_LQS_MAX_BITS,
-                                               &lqs_hash_ops, 0);
+                                               &lqs_hash_ops, LH_REHASH);
         if (!qctxt->lqc_lqs_hash)
                 CERROR("%s: initialize hash lqs failed\n", obd->obd_name);