From 8e2f036193603eb1d31d3f88e74e23cf1ee3f4af Mon Sep 17 00:00:00 2001 From: Patrick Caulfield Date: Mon, 25 Jun 2007 09:02:37 +0000 Subject: [PATCH] Use cpg_local_get() rather then Clm to get the local nodeid. --- WHATS_NEW | 1 + daemons/clvmd/Makefile.in | 2 +- daemons/clvmd/clvmd-openais.c | 22 +++------------------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 239ef4649..32a5d774f 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -4,6 +4,7 @@ Version 2.02.27 - Add vg_status function and clean up vg->status in tools directory. Add --ignoremonitoring to disable all dmeventd interaction. Remove get_ prefix from get_pv_* functions. + clvmd-openais now uses cpg_local_get() to get nodeid, rather than Clm. Version 2.02.26 - 15th June 2007 ================================ diff --git a/daemons/clvmd/Makefile.in b/daemons/clvmd/Makefile.in index 82f87c56b..eeba497e7 100644 --- a/daemons/clvmd/Makefile.in +++ b/daemons/clvmd/Makefile.in @@ -59,7 +59,7 @@ endif ifeq ("$(OPENAIS)", "yes") SOURCES += clvmd-openais.c - LMLIBS += -lSaLck -lSaClm -lcpg + LMLIBS += -lSaLck -lcpg DEFS += -DUSE_OPENAIS endif diff --git a/daemons/clvmd/clvmd-openais.c b/daemons/clvmd/clvmd-openais.c index 3ec105452..cb01862e3 100644 --- a/daemons/clvmd/clvmd-openais.c +++ b/daemons/clvmd/clvmd-openais.c @@ -98,9 +98,6 @@ SaLckCallbacksT lck_callbacks = { .saLckResourceUnlockCallback = lck_unlock_callback }; -/* We only call Clm to get our node id */ -SaClmCallbacksT clm_callbacks; - struct node_info { enum {NODE_UNKNOWN, NODE_DOWN, NODE_UP, NODE_CLVMD} state; @@ -348,7 +345,6 @@ static int _init_cluster(void) { SaAisErrorT err; SaVersionT ver = { 'B', 1, 1 }; - SaClmHandleT clm_handle; int select_fd; SaClmClusterNodeT cluster_node; @@ -387,26 +383,14 @@ static int _init_cluster(void) return ais_to_errno(err); } - /* A brief foray into Clm to get our node id */ - err = saClmInitialize(&clm_handle, &clm_callbacks, &ver); - if (err != SA_AIS_OK) { - syslog(LOG_ERR, "Could not initialize OpenAIS membership service %d\n", err); - DEBUGLOG("Could not initialize OpenAIS Membership service %d\n", err); - return ais_to_errno(err); - } - - err = saClmClusterNodeGet(clm_handle, - SA_CLM_LOCAL_NODE_ID, - TIMEOUT, - &cluster_node); + err = cpg_local_get(cpg_handle, + &cluster_node); if (err != SA_AIS_OK) { cpg_finalize(cpg_handle); saLckFinalize(lck_handle); - saClmFinalize(clm_handle); syslog(LOG_ERR, "Cannot get local node id\n"); return ais_to_errno(err); } - saClmFinalize(clm_handle); our_nodeid = cluster_node.nodeId; DEBUGLOG("Our local node id is %d\n", our_nodeid); @@ -424,7 +408,7 @@ static void _cluster_closedown(void) unlock_all(); saLckFinalize(lck_handle); - cpg_inalize(cpg_handle); + cpg_finalize(cpg_handle); } static void _get_our_csid(char *csid)