projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/utils_avltree.[ch]: Rename all types and functions to use the prefix `c_avl_'.
[collectd.git]
/
src
/
rrdtool.c
diff --git
a/src/rrdtool.c
b/src/rrdtool.c
index
d274ba0
..
fbd8360
100644
(file)
--- a/
src/rrdtool.c
+++ b/
src/rrdtool.c
@@
-105,7
+105,7
@@
static double xff = 0.1;
static int cache_timeout = 0;
static int cache_flush_timeout = 0;
static time_t cache_flush_last;
static int cache_timeout = 0;
static int cache_flush_timeout = 0;
static time_t cache_flush_last;
-static avl_tree_t *cache = NULL;
+static
c_
avl_tree_t *cache = NULL;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
static rrd_queue_t *queue_head = NULL;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
static rrd_queue_t *queue_head = NULL;
@@
-641,7
+641,7
@@
static void *rrd_queue_thread (void *data)
* we make a copy of it's values */
pthread_mutex_lock (&cache_lock);
* we make a copy of it's values */
pthread_mutex_lock (&cache_lock);
- avl_get (cache, queue_entry->filename, (void *) &cache_entry);
+
c_
avl_get (cache, queue_entry->filename, (void *) &cache_entry);
values = cache_entry->values;
values_num = cache_entry->values_num;
values = cache_entry->values;
values_num = cache_entry->values_num;
@@
-665,7
+665,7
@@
static void *rrd_queue_thread (void *data)
} /* while (42) */
pthread_mutex_lock (&cache_lock);
} /* while (42) */
pthread_mutex_lock (&cache_lock);
- avl_destroy (cache);
+
c_
avl_destroy (cache);
cache = NULL;
pthread_mutex_unlock (&cache_lock);
cache = NULL;
pthread_mutex_unlock (&cache_lock);
@@
-713,7
+713,7
@@
static void rrd_cache_flush (int timeout)
int keys_num = 0;
char *key;
int keys_num = 0;
char *key;
- avl_iterator_t *iter;
+
c_
avl_iterator_t *iter;
int i;
DEBUG ("rrdtool plugin: Flushing cache, timeout = %i", timeout);
int i;
DEBUG ("rrdtool plugin: Flushing cache, timeout = %i", timeout);
@@
-721,8
+721,8
@@
static void rrd_cache_flush (int timeout)
now = time (NULL);
/* Build a list of entries to be flushed */
now = time (NULL);
/* Build a list of entries to be flushed */
- iter = avl_get_iterator (cache);
- while (avl_iterator_next (iter, (void *) &key, (void *) &rc) == 0)
+ iter =
c_
avl_get_iterator (cache);
+ while (
c_
avl_iterator_next (iter, (void *) &key, (void *) &rc) == 0)
{
if (rc->flags == FLAG_QUEUED)
continue;
{
if (rc->flags == FLAG_QUEUED)
continue;
@@
-744,20
+744,20
@@
static void rrd_cache_flush (int timeout)
"realloc failed: %s",
sstrerror (errno, errbuf,
sizeof (errbuf)));
"realloc failed: %s",
sstrerror (errno, errbuf,
sizeof (errbuf)));
- avl_iterator_destroy (iter);
+
c_
avl_iterator_destroy (iter);
return;
}
keys[keys_num] = key;
keys_num++;
}
return;
}
keys[keys_num] = key;
keys_num++;
}
- } /* while (avl_iterator_next) */
- avl_iterator_destroy (iter);
+ } /* while (
c_
avl_iterator_next) */
+
c_
avl_iterator_destroy (iter);
for (i = 0; i < keys_num; i++)
{
for (i = 0; i < keys_num; i++)
{
- if (avl_remove (cache, keys[i], (void *) &key, (void *) &rc) != 0)
+ if (
c_
avl_remove (cache, keys[i], (void *) &key, (void *) &rc) != 0)
{
{
- DEBUG ("rrdtool plugin: avl_remove (%s) failed.", keys[i]);
+ DEBUG ("rrdtool plugin:
c_
avl_remove (%s) failed.", keys[i]);
continue;
}
continue;
}
@@
-783,7
+783,7
@@
static int rrd_cache_insert (const char *filename,
pthread_mutex_lock (&cache_lock);
pthread_mutex_lock (&cache_lock);
- avl_get (cache, filename, (void *) &rc);
+
c_
avl_get (cache, filename, (void *) &rc);
if (rc == NULL)
{
if (rc == NULL)
{
@@
-816,7
+816,7
@@
static int rrd_cache_insert (const char *filename,
sstrerror (errno, errbuf, sizeof (errbuf));
sstrerror (errno, errbuf, sizeof (errbuf));
- avl_remove (cache, filename, &cache_key, NULL);
+
c_
avl_remove (cache, filename, &cache_key, NULL);
pthread_mutex_unlock (&cache_lock);
ERROR ("rrdtool plugin: realloc failed: %s", errbuf);
pthread_mutex_unlock (&cache_lock);
ERROR ("rrdtool plugin: realloc failed: %s", errbuf);
@@
-856,7
+856,7
@@
static int rrd_cache_insert (const char *filename,
return (-1);
}
return (-1);
}
- avl_insert (cache, cache_key, rc);
+
c_
avl_insert (cache, cache_key, rc);
}
DEBUG ("rrdtool plugin: rrd_cache_insert: file = %s; "
}
DEBUG ("rrdtool plugin: rrd_cache_insert: file = %s; "
@@
-1095,10
+1095,10
@@
static int rrd_init (void)
/* Set the cache up */
pthread_mutex_lock (&cache_lock);
/* Set the cache up */
pthread_mutex_lock (&cache_lock);
- cache = avl_create ((int (*) (const void *, const void *)) strcmp);
+ cache =
c_
avl_create ((int (*) (const void *, const void *)) strcmp);
if (cache == NULL)
{
if (cache == NULL)
{
- ERROR ("rrdtool plugin: avl_create failed.");
+ ERROR ("rrdtool plugin:
c_
avl_create failed.");
return (-1);
}
return (-1);
}