summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-shared.c
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2014-08-11 10:14:18 +0530
committerVijay Bellur <vbellur@redhat.com>2014-08-26 04:56:29 -0700
commita1fe3d72e373bf0deaed152842d12d94bb9129dc (patch)
treea7c50b39c25885f5a378fbe5b07e585c4ee2be8c /xlators/cluster/dht/src/dht-shared.c
parent27daeba0f7e02669919a7d89a04ea8fe39e06898 (diff)
cluster/dht: introduce locking api.
Change-Id: I41389ba91951d3e63e617aa32cd0bee848261c72 BUG: 1130888 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>
Diffstat (limited to 'xlators/cluster/dht/src/dht-shared.c')
-rw-r--r--xlators/cluster/dht/src/dht-shared.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c
index f8faecf6870..22a7260f829 100644
--- a/xlators/cluster/dht/src/dht-shared.c
+++ b/xlators/cluster/dht/src/dht-shared.c
@@ -218,6 +218,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:
@@ -663,6 +666,14 @@ dht_init (xlator_t *this)
GF_OPTION_INIT ("weighted-rebalance", conf->do_weighting, bool, err);
+ conf->lock_pool = mem_pool_new (dht_lock_t, 512);
+ if (!conf->lock_pool) {
+ gf_msg (this->name, GF_LOG_ERROR, 0, DHT_MSG_INIT_FAILED,
+ "failed to create lock mem_pool, failing "
+ "initialization");
+ goto err;
+ }
+
this->private = conf;
return 0;
@@ -688,6 +699,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);
}