summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht.c
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2014-08-11 10:14:18 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2014-10-20 07:55:11 -0700
commitfcd256faa951f459e344ced46f0cc409a5bbc147 (patch)
tree8fbfdc6dc47b7fdfee08d80329d526dacd3df375 /xlators/cluster/dht/src/dht.c
parent7a1e42e0d4be42fa8aa0c7a430b4fbc3ab509705 (diff)
cluster/dht: introduce locking api.
Change-Id: I41389ba91951d3e63e617aa32cd0bee848261c72 BUG: 1139998 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/8521 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/8679 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht.c')
-rw-r--r--xlators/cluster/dht/src/dht.c14
1 files changed, 14 insertions, 0 deletions
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);
}