@cryptotaxi247 / netdata-1 / commits / 72555a4b3

[health][NFC] Mark internal functions as static. (#10518)

vkalintiris committed Jan 18, 2021 at 20:00 UTC 72555a4b3e51603c6dfd15418b1a5e649684e805
4 files changed +9 -13
health/health.c
+4 -4
@@ -79,7 +79,7 @@ inline char *health_stock_config_dir(void) {
79 *
80 * Function used to initialize the silencer structure.
81 */
82 -void health_silencers_init(void) {
82 +static void health_silencers_init(void) {
83 FILE *fd = fopen(silencers_filename, "r");
84 if (fd) {
85 fseek(fd, 0 , SEEK_END);
@@ -135,7 +135,7 @@ void health_init(void) {
135 *
136 * @param host the structure of the host that the function will reload the configuration.
137 */
138 -void health_reload_host(RRDHOST *host) {
138 +static void health_reload_host(RRDHOST *host) {
139 if(unlikely(!host->health_enabled))
140 return;
141
@@ -549,7 +549,7 @@ static void health_main_cleanup(void *ptr) {
549 static_thread->enabled = NETDATA_MAIN_THREAD_EXITED;
550 }
551
552 -SILENCE_TYPE check_silenced(RRDCALC *rc, char* host, SILENCERS *silencers) {
552 +static SILENCE_TYPE check_silenced(RRDCALC *rc, char* host, SILENCERS *silencers) {
553 SILENCER *s;
554 debug(D_HEALTH, "Checking if alarm was silenced via the command API. Alarm info name:%s context:%s chart:%s host:%s family:%s",
555 rc->name, (rc->rrdset)?rc->rrdset->context:"", rc->chart, host, (rc->rrdset)?rc->rrdset->family:"");
@@ -591,7 +591,7 @@ SILENCE_TYPE check_silenced(RRDCALC *rc, char* host, SILENCERS *silencers) {
591 *
592 * @return It returns 1 case rrdcalc_flags is DISABLED or 0 otherwise
593 */
594 -int update_disabled_silenced(RRDHOST *host, RRDCALC *rc) {
594 +static int update_disabled_silenced(RRDHOST *host, RRDCALC *rc) {
595 uint32_t rrdcalc_flags_old = rc->rrdcalc_flags;
596 // Clear the flags
597 rc->rrdcalc_flags &= ~(RRDCALC_FLAG_DISABLED | RRDCALC_FLAG_SILENCED);
health/health.h
-4
@@ -70,10 +70,7 @@ void health_api_v1_chart_variables2json(RRDSET *st, BUFFER *buf);
70 void health_api_v1_chart_custom_variables2json(RRDSET *st, BUFFER *buf);
71
72 extern int health_alarm_log_open(RRDHOST *host);
73 -extern void health_alarm_log_close(RRDHOST *host);
74 -extern void health_log_rotate(RRDHOST *host);
73 extern void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae);
76 -extern ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename);
74 extern void health_alarm_log_load(RRDHOST *host);
75
76 extern ALARM_ENTRY* health_create_alarm_entry(
@@ -102,7 +99,6 @@ extern void health_alarm_log(RRDHOST *host, ALARM_ENTRY *ae);
99 extern void health_readdir(RRDHOST *host, const char *user_path, const char *stock_path, const char *subpath);
100 extern char *health_user_config_dir(void);
101 extern char *health_stock_config_dir(void);
105 -extern void health_reload_host(RRDHOST *host);
102 extern void health_alarm_log_free(RRDHOST *host);
103
104 extern void health_alarm_log_free_one_nochecks_nounlink(ALARM_ENTRY *ae);
health/health_json.c
+1 -1
@@ -291,7 +291,7 @@ void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* contexts, RRDCAL
291 rrdhost_unlock(host);
292 }
293
294 -void health_alarms2json_fill_alarms(RRDHOST *host, BUFFER *wb, int all, void (*fp)(RRDHOST *, BUFFER *, RRDCALC *)) {
294 +static void health_alarms2json_fill_alarms(RRDHOST *host, BUFFER *wb, int all, void (*fp)(RRDHOST *, BUFFER *, RRDCALC *)) {
295 RRDCALC *rc;
296 int i;
297 for(i = 0, rc = host->alarms; rc ; rc = rc->next) {
health/health_log.c
+4 -4
@@ -22,14 +22,14 @@ inline int health_alarm_log_open(RRDHOST *host) {
22 return -1;
23 }
24
25 -inline void health_alarm_log_close(RRDHOST *host) {
25 +static inline void health_alarm_log_close(RRDHOST *host) {
26 if(host->health_log_fp) {
27 fclose(host->health_log_fp);
28 host->health_log_fp = NULL;
29 }
30 }
31
32 -inline void health_log_rotate(RRDHOST *host) {
32 +static inline void health_log_rotate(RRDHOST *host) {
33 static size_t rotate_every = 0;
34
35 if(unlikely(rotate_every == 0)) {
@@ -158,7 +158,7 @@ inline void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae) {
158 #endif
159 }
160
161 -uint32_t is_valid_alarm_id(RRDHOST *host, const char *chart, const char *name, uint32_t alarm_id)
161 +static uint32_t is_valid_alarm_id(RRDHOST *host, const char *chart, const char *name, uint32_t alarm_id)
162 {
163 uint32_t hash_chart = simple_hash(chart);
164 uint32_t hash_name = simple_hash(name);
@@ -174,7 +174,7 @@ uint32_t is_valid_alarm_id(RRDHOST *host, const char *chart, const char *name, u
174 return 1;
175 }
176
177 -inline ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename) {
177 +static inline ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename) {
178 errno = 0;
179
180 char *s, *buf = mallocz(65536 + 1);