summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-shared.c
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2014-09-10 23:22:03 +0530
committerNiels de Vos <ndevos@redhat.com>2014-10-01 03:33:51 -0700
commit53010998dc6c7bb5268cd1c124887ce9d9a3f032 (patch)
tree4600f6fb4ba573c29b7e510ef83bb4f9cb74c504 /xlators/cluster/dht/src/dht-shared.c
parentbee0c740b54669a8be11acea405d021bb50d3c54 (diff)
cluster/dht: introduce dht locking api.
Change-Id: I41389ba91951d3e63e617aa32cd0bee848261c72 BUG: 1140348 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> (cherry picked from commit a1fe3d72e373bf0deaed152842d12d94bb9129dc) Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/8722 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
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);
}