From fcd256faa951f459e344ced46f0cc409a5bbc147 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 11 Aug 2014 10:14:18 +0530 Subject: cluster/dht: introduce locking api. Change-Id: I41389ba91951d3e63e617aa32cd0bee848261c72 BUG: 1139998 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/8521 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Reviewed-by: Vijay Bellur Reviewed-on: http://review.gluster.org/8679 Reviewed-by: Kaleb KEITHLEY --- xlators/cluster/dht/src/dht.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xlators/cluster/dht/src/dht.c') diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index 9d396434ed3..97bd2a0fe99 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -213,6 +213,9 @@ fini (xlator_t *this) GF_FREE (conf->file_layouts); } + if (conf->lock_pool) + mem_pool_destroy (conf->lock_pool); + GF_FREE (conf->subvolumes); GF_FREE (conf->subvolume_status); @@ -483,6 +486,14 @@ 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; @@ -504,6 +515,9 @@ err: GF_FREE (conf->defrag); + if (conf->lock_pool) + mem_pool_destroy (conf->lock_pool); + GF_FREE (conf); } -- cgit