diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2020-06-09 15:57:28 +0300 |
---|---|---|
committer | Sanju Rakonde <sanjurakonde@review.gluster.org> | 2020-06-10 15:47:03 +0000 |
commit | 9af05a85a03a89c1e070483067f66df1a6fe42c4 (patch) | |
tree | 5995e3df25f57ef4fc799a40b09d8b543411b649 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | e150d758259a98421eb7711fb3855eb7691e2eda (diff) |
glusterd: destroy all volume info locks and mutexes
Add destroy calls for 'store_volinfo_lock' and 'lock' of volume info.
Move initialization of 'store_volinfo_lock' from glusterd_op_create_volume()
to common place, which is glusterd_volinfo_new() indeed.
Change-Id: I5fae4469f28eab80c4fa6f5947646528e6aedad7
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Fixes: #1291
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index b941073843d..a0b436d2eb8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -675,7 +675,9 @@ glusterd_volinfo_new(glusterd_volinfo_t **volinfo) glusterd_gfproxydsvc_build(&new_volinfo->gfproxyd.svc); glusterd_shdsvc_build(&new_volinfo->shd.svc); + pthread_mutex_init(&new_volinfo->store_volinfo_lock, NULL); pthread_mutex_init(&new_volinfo->reflock, NULL); + *volinfo = glusterd_volinfo_ref(new_volinfo); ret = 0; @@ -956,7 +958,10 @@ glusterd_volinfo_delete(glusterd_volinfo_t *volinfo) glusterd_auth_cleanup(volinfo); glusterd_shd_svcproc_cleanup(&volinfo->shd); + pthread_mutex_destroy(&volinfo->store_volinfo_lock); pthread_mutex_destroy(&volinfo->reflock); + LOCK_DESTROY(&volinfo->lock); + GF_FREE(volinfo); ret = 0; out: |