diff options
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 7 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-shared.c | 23 |
2 files changed, 27 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index a240a72444d..0ef5c81a608 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -444,6 +444,9 @@ struct gf_defrag_info_ { /* Hard link handle requirement */ synclock_t link_lock; + + /* lock migration flag */ + gf_boolean_t lock_migration_enabled; }; typedef struct gf_defrag_info_ gf_defrag_info_t; @@ -535,6 +538,10 @@ struct dht_conf { */ uint32_t vol_commit_hash; gf_boolean_t vch_forced; + + /* lock migration */ + + gf_boolean_t lock_migration_enabled; }; typedef struct dht_conf dht_conf_t; diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index 856819ac052..0fea1d58e58 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -455,7 +455,13 @@ dht_reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("rebal-throttle", conf->dthrottle, options, str, out); + GF_OPTION_RECONF ("lock-migration", conf->lock_migration_enabled, + options, bool, out); + if (conf->defrag) { + conf->defrag->lock_migration_enabled = + conf->lock_migration_enabled; + GF_DECIDE_DEFRAG_THROTTLE_COUNT (throttle_count, conf); gf_msg ("DHT", GF_LOG_INFO, 0, DHT_MSG_REBAL_THROTTLE_INFO, @@ -588,8 +594,6 @@ err: return ret; } - - int dht_init (xlator_t *this) { @@ -722,8 +726,14 @@ dht_init (xlator_t *this) GF_OPTION_INIT ("readdir-optimize", conf->readdir_optimize, bool, err); + + GF_OPTION_INIT ("lock-migration", conf->lock_migration_enabled, + bool, err); + if (defrag) { - GF_OPTION_INIT ("rebalance-stats", defrag->stats, bool, err); + defrag->lock_migration_enabled = conf->lock_migration_enabled; + + GF_OPTION_INIT ("rebalance-stats", defrag->stats, bool, err); if (dict_get_str (this->options, "rebalance-filter", &temp_str) == 0) { if (gf_defrag_pattern_list_fill (this, defrag, temp_str) @@ -1066,5 +1076,12 @@ struct volume_options options[] = { "max of [($(processing units) - 4) / 2), 4]" }, + { .key = {"lock-migration"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .description = " If enabled this feature will migrate the posix locks" + " associated with a file during rebalance" + }, + { .key = {NULL} }, }; |