From bf19c6be2c57c43ebc6c7ceb85fd7487c7e36799 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 20 Mar 2014 14:06:16 +0100 Subject: [PATCH] cleanup: clvmd move destroy_lvhash into main Keep destruction code path consistent and simple and destroy lvhash in the place it's been created. Also issue debug message from a single place. --- daemons/clvmd/clvmd-cman.c | 1 - daemons/clvmd/clvmd-corosync.c | 3 --- daemons/clvmd/clvmd-openais.c | 3 --- daemons/clvmd/clvmd-singlenode.c | 2 -- daemons/clvmd/clvmd.c | 2 ++ 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/daemons/clvmd/clvmd-cman.c b/daemons/clvmd/clvmd-cman.c index 7e76dc442..e41d0cf77 100644 --- a/daemons/clvmd/clvmd-cman.c +++ b/daemons/clvmd/clvmd-cman.c @@ -245,7 +245,6 @@ static void _add_up_node(const char *csid) static void _cluster_closedown() { - destroy_lvhash(); dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); cman_finish(c_handle); } diff --git a/daemons/clvmd/clvmd-corosync.c b/daemons/clvmd/clvmd-corosync.c index e68cb73aa..be51b61a7 100644 --- a/daemons/clvmd/clvmd-corosync.c +++ b/daemons/clvmd/clvmd-corosync.c @@ -345,9 +345,6 @@ static int _init_cluster(void) static void _cluster_closedown(void) { - DEBUGLOG("cluster_closedown\n"); - destroy_lvhash(); - dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); cpg_finalize(cpg_handle); quorum_finalize(quorum_handle); diff --git a/daemons/clvmd/clvmd-openais.c b/daemons/clvmd/clvmd-openais.c index 77c048265..c91a2388c 100644 --- a/daemons/clvmd/clvmd-openais.c +++ b/daemons/clvmd/clvmd-openais.c @@ -365,9 +365,6 @@ static int _init_cluster(void) static void _cluster_closedown(void) { - DEBUGLOG("cluster_closedown\n"); - destroy_lvhash(); - saLckFinalize(lck_handle); cpg_finalize(cpg_handle); } diff --git a/daemons/clvmd/clvmd-singlenode.c b/daemons/clvmd/clvmd-singlenode.c index a3a196090..e65ab28c8 100644 --- a/daemons/clvmd/clvmd-singlenode.c +++ b/daemons/clvmd/clvmd-singlenode.c @@ -121,8 +121,6 @@ static void _cluster_closedown(void) { close_comms(); - DEBUGLOG("cluster_closedown\n"); - destroy_lvhash(); /* If there is any awaited resource, kill it softly */ pthread_mutex_lock(&_lock_mutex); dm_hash_destroy(_locks); diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index dd3548f09..05e567091 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -636,6 +636,8 @@ int main(int argc, char *argv[]) dm_free(delfd); } + DEBUGLOG("cluster_closedown\n"); + destroy_lvhash(); clops->cluster_closedown(); ret = 0;