提交 d4d329ec 编写于 作者: S Shengliang Guan

fix: rename global variables

上级 f2d6ed86
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "dmMgmt.h" #include "dmMgmt.h"
static SDnode global = {0}; static SDnode globalDnode = {0};
SDnode *dmInstance() { return &global; } SDnode *dmInstance() { return &globalDnode; }
static int32_t dmCheckRepeatInit(SDnode *pDnode) { static int32_t dmCheckRepeatInit(SDnode *pDnode) {
if (atomic_val_compare_exchange_8(&pDnode->once, DND_ENV_INIT, DND_ENV_READY) != DND_ENV_INIT) { if (atomic_val_compare_exchange_8(&pDnode->once, DND_ENV_INIT, DND_ENV_READY) != DND_ENV_INIT) {
...@@ -270,6 +270,6 @@ void dmReportStartup(const char *pName, const char *pDesc) { ...@@ -270,6 +270,6 @@ void dmReportStartup(const char *pName, const char *pDesc) {
} }
int64_t dmGetClusterId() { int64_t dmGetClusterId() {
return global.data.clusterId; return globalDnode.data.clusterId;
} }
...@@ -37,8 +37,6 @@ typedef struct SRaftStore { ...@@ -37,8 +37,6 @@ typedef struct SRaftStore {
SRaftStore *raftStoreOpen(const char *path); SRaftStore *raftStoreOpen(const char *path);
int32_t raftStoreClose(SRaftStore *pRaftStore); int32_t raftStoreClose(SRaftStore *pRaftStore);
int32_t raftStorePersist(SRaftStore *pRaftStore); int32_t raftStorePersist(SRaftStore *pRaftStore);
int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len);
int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len);
bool raftStoreHasVoted(SRaftStore *pRaftStore); bool raftStoreHasVoted(SRaftStore *pRaftStore);
void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId); void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId);
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
// private function // private function
static int32_t raftStoreInit(SRaftStore *pRaftStore); static int32_t raftStoreInit(SRaftStore *pRaftStore);
static bool raftStoreFileExist(char *path); static bool raftStoreFileExist(char *path);
static int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len);
static int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len);
// public function // public function
SRaftStore *raftStoreOpen(const char *path) { SRaftStore *raftStoreOpen(const char *path) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册