From ba2dbaf83d0dfed4a72b3644d7d4cf14e9719df4 Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Fri, 15 Jan 2010 11:32:27 +0100 Subject: [PATCH] b=18690 enable rehash for hash tables that intended to use it --- lustre/lov/lov_obd.c | 3 ++- lustre/obdclass/class_hash.c | 4 ++-- lustre/obdclass/obd_config.c | 7 ++++--- lustre/quota/quota_context.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 738a9c3..37723c5 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -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); diff --git a/lustre/obdclass/class_hash.c b/lustre/obdclass/class_hash.c index 0867098..682cdc8 100644 --- a/lustre/obdclass/class_hash.c +++ b/lustre/obdclass/class_hash.c @@ -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); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 487d763..2aefafb 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -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); diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index c9014cb..c878dd7 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -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); -- 1.8.3.1