summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/dht-shared.c')
-rw-r--r--xlators/cluster/dht/src/dht-shared.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c
index 324b3062696..186edbe7fc4 100644
--- a/xlators/cluster/dht/src/dht-shared.c
+++ b/xlators/cluster/dht/src/dht-shared.c
@@ -195,6 +195,9 @@ dht_fini (xlator_t *this)
GF_FREE (conf->subvolume_status);
+ if (conf->lock_pool)
+ mem_pool_destroy (conf->lock_pool);
+
GF_FREE (conf);
}
out:
@@ -614,6 +617,15 @@ dht_init (xlator_t *this)
goto err;
}
+
+ conf->lock_pool = mem_pool_new (dht_lock_t, 512);
+ if (!conf->lock_pool) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "failed to create lock mem_pool, failing "
+ "initialization");
+ goto err;
+ }
+
this->private = conf;
return 0;
@@ -639,6 +651,9 @@ err:
GF_FREE (conf->link_xattr_name);
GF_FREE (conf->wild_xattr_name);
+ if (conf->lock_pool)
+ mem_pool_destroy (conf->lock_pool);
+
GF_FREE (conf);
}