From e066a5fea7bdaa5da78e49c9a5bf344af2f33d3c Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Fri, 23 Mar 2012 13:16:06 -0400 Subject: distribute: support user-specified layouts. The new type is DHT_HASH_TYPE_DM_USER=1 (on disk in network byte order) and we treat it the same as DHT_HASH_TYPE_DM except that we don't stomp on it during rebalance. Change-Id: I893571a9b89577acdea2fe868915b18d3663fd77 BUG: 807312 Signed-off-by: Jeff Darcy Reviewed-on: http://review.gluster.com/3004 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/cluster/dht/src/dht-layout.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/dht/src/dht-layout.c') diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 08697d0421e..97bbe987fdc 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -308,9 +308,13 @@ dht_disk_layout_merge (xlator_t *this, dht_layout_t *layout, return -1; } - switch (disk_layout[1]) { + type = ntoh32 (disk_layout[1]); + switch (type) { + case DHT_HASH_TYPE_DM_USER: + gf_log (this->name, GF_LOG_DEBUG, "found user-set layout"); + layout->type = type; + /* Fall through. */ case DHT_HASH_TYPE_DM: - type = ntoh32 (disk_layout[1]); break; default: gf_log (this->name, GF_LOG_CRITICAL, -- cgit