summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-diskusage.c
diff options
context:
space:
mode:
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;
}