summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-diskusage.c
diff options
context:
space:
mode:
authorNithya Balachandran <nbalacha@redhat.com>2014-05-30 11:26:40 +0530
committerVijay Bellur <vbellur@redhat.com>2014-06-16 06:25:51 -0700
commit7382b66de76101d625ed888ec7b7f82fd7da56d3 (patch)
treee28bc5b65c6557907c4e011ca1ca7776cabd0656 /xlators/cluster/dht/src/dht-diskusage.c
parent0031bd1d18c874f3b68b59df7f84fce354b9b86c (diff)
Cluster/DHT: New logging framework
Moved all relevant DHT gf_log calls to the new logging framework. Change-Id: I3af3cfe0416e332774a6c4ff6a091d006c400af2 BUG: 1075611 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/7929 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-diskusage.c')
-rw-r--r--xlators/cluster/dht/src/dht-diskusage.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/xlators/cluster/dht/src/dht-diskusage.c b/xlators/cluster/dht/src/dht-diskusage.c
index d035aca2665..8664f550ba2 100644
--- a/xlators/cluster/dht/src/dht-diskusage.c
+++ b/xlators/cluster/dht/src/dht-diskusage.c
@@ -19,6 +19,7 @@
#include "glusterfs.h"
#include "xlator.h"
#include "dht-common.h"
+#include "dht-messages.h"
#include "defaults.h"
#include <sys/time.h>
@@ -70,14 +71,15 @@ dht_du_info_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
conf->du_stats[i].avail_percent = percent;
conf->du_stats[i].avail_space = bytes;
conf->du_stats[i].avail_inodes = percent_inodes;
- gf_log (this->name, GF_LOG_DEBUG,
- "on subvolume '%s': avail_percent is: "
- "%.2f and avail_space is: %"PRIu64" "
- "and avail_inodes is: %.2f",
- prev->this->name,
- conf->du_stats[i].avail_percent,
- conf->du_stats[i].avail_space,
- conf->du_stats[i].avail_inodes);
+ gf_msg_debug (this->name, 0,
+ "subvolume '%s': avail_percent "
+ "is: %.2f and avail_space "
+ "is: %" PRIu64" and avail_inodes"
+ " is: %.2f",
+ prev->this->name,
+ conf->du_stats[i].avail_percent,
+ conf->du_stats[i].avail_space,
+ conf->du_stats[i].avail_inodes);
}
}
UNLOCK (&conf->subvolume_lock);
@@ -239,7 +241,8 @@ dht_is_subvol_filled (xlator_t *this, xlator_t *subvol)
if (subvol_filled_space && conf->subvolume_status[i]) {
if (!(conf->du_stats[i].log++ % (GF_UNIVERSAL_ANSWER * 10))) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ DHT_MSG_SUBVOL_INSUFF_SPACE,
"disk space on subvolume '%s' is getting "
"full (%.2f %%), consider adding more nodes",
subvol->name,
@@ -249,7 +252,8 @@ dht_is_subvol_filled (xlator_t *this, xlator_t *subvol)
if (subvol_filled_inodes && conf->subvolume_status[i]) {
if (!(conf->du_stats[i].log++ % (GF_UNIVERSAL_ANSWER * 10))) {
- gf_log (this->name, GF_LOG_CRITICAL,
+ gf_msg (this->name, GF_LOG_CRITICAL, 0,
+ DHT_MSG_SUBVOL_INSUFF_INODES,
"inodes on subvolume '%s' are at "
"(%.2f %%), consider adding more nodes",
subvol->name,
@@ -281,9 +285,10 @@ dht_free_disk_available_subvol (xlator_t *this, xlator_t *subvol,
layout = dht_layout_get (this, loc->parent);
if (!layout) {
- gf_log (this->name, GF_LOG_DEBUG,
- "layout missing path=%s parent=%s",
- loc->path, uuid_utoa (loc->parent->gfid));
+ gf_msg_debug (this->name, 0,
+ "Missing layout. path=%s,"
+ " parent gfid = %s", loc->path,
+ uuid_utoa (loc->parent->gfid));
goto out;
}
} else {
@@ -305,10 +310,9 @@ dht_free_disk_available_subvol (xlator_t *this, xlator_t *subvol,
UNLOCK (&conf->subvolume_lock);
out:
if (!avail_subvol) {
- gf_log (this->name,
- GF_LOG_DEBUG,
- "no subvolume has enough free space and/or inodes\
- to create");
+ gf_msg_debug (this->name, 0,
+ "No subvolume has enough free space \
+ and/or inodes to create");
avail_subvol = subvol;
}