From 3a499d170de2c7df06b127b709d27c64cef98886 Mon Sep 17 00:00:00 2001 From: Venkatesh Somyajulu Date: Tue, 17 Jun 2014 14:45:44 +0530 Subject: cluster/dht: Bring option to choose gfid or name based hashing Change-Id: I11794eb2adceb88e75864aede450e904431a6273 BUG: 1095888 Signed-off-by: Venkatesh Somyajulu Reviewed-on: http://review.gluster.org/8049 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-shared.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'xlators/cluster/dht/src/dht-shared.c') diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index 3d1d635b4ed..53082c505ff 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -395,6 +395,10 @@ dht_reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("readdir-optimize", conf->readdir_optimize, options, bool, out); + GF_OPTION_RECONF ("randomize-hash-range-by-gfid", + conf->randomize_by_gfid, + options, bool, out); + if (conf->defrag) { GF_OPTION_RECONF ("rebalance-stats", conf->defrag->stats, options, bool, out); @@ -643,6 +647,9 @@ dht_init (xlator_t *this) goto err; } + GF_OPTION_INIT ("randomize-hash-range-by-gfid", + conf->randomize_by_gfid, bool, err); + GF_OPTION_INIT ("xattr-name", conf->xattr_name, str, err); gf_asprintf (&conf->link_xattr_name, "%s."DHT_LINKFILE_STR, conf->xattr_name); @@ -793,5 +800,14 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_ANY }, + { .key = {"randomize-hash-range-by-gfid"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .description = "Use gfid of directory to determine the subvolume " + "from which hash ranges are allocated starting with 0. " + "Note that we still use a directory/file's name to determine the " + "subvolume to which it hashes" + }, + { .key = {NULL} }, }; -- cgit