dht: initialize layout type

Instead of relying on CALLOC's zero initialization which happens
to be the value of DHT_HASH_TYPE_DM, explicitly set the value

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 523 (Hash type is not initialized in dht_layout_new)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=523
This commit is contained in:
Anand Avati 2010-01-23 13:26:39 +00:00 committed by Anand V. Avati
parent 6313f854fb
commit da505a63c1
3 changed files with 6 additions and 5 deletions

View File

@ -50,6 +50,11 @@ struct dht_layout {
typedef struct dht_layout dht_layout_t;
typedef enum {
DHT_HASH_TYPE_DM,
} dht_hashfn_type_t;
struct dht_local {
int call_cnt;
loc_t loc;

View File

@ -29,11 +29,6 @@
#include "hashfn.h"
typedef enum {
DHT_HASH_TYPE_DM,
} dht_hashfn_type_t;
int
dht_hash_compute_internal (int type, const char *name, uint32_t *hash_p)
{

View File

@ -51,6 +51,7 @@ dht_layout_new (xlator_t *this, int cnt)
goto out;
}
layout->type = DHT_HASH_TYPE_DM;
layout->cnt = cnt;
if (conf)
layout->gen = conf->gen;