summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-shared.c
diff options
context:
space:
mode:
authorarao <arao@redhat.com>2015-06-12 16:35:53 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-06-23 22:15:10 -0700
commit2b645af1d077957829c8ff6b8ab56353ba3913d6 (patch)
treefe399a98df744440783a1eec00d6ff9c77ab533f /xlators/cluster/dht/src/dht-shared.c
parent653d3c1406e372aabcf694bfead2d695f84ee0f8 (diff)
dht: Adding log messages to the new logging framework
Change-Id: Ib3bb61c5223f409c23c68100f3fe884918d2dc3f BUG: 1194640 Signed-off-by: arao <arao@redhat.com> Reviewed-on: http://review.gluster.org/10021 Reviewed-by: N Balachandran <nbalacha@redhat.com> Reviewed-by: Joseph Fernandes Tested-by: Joseph Fernandes Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-shared.c')
-rw-r--r--xlators/cluster/dht/src/dht-shared.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c
index b8f42fb145b..342c2015b1a 100644
--- a/xlators/cluster/dht/src/dht-shared.c
+++ b/xlators/cluster/dht/src/dht-shared.c
@@ -259,8 +259,9 @@ mem_acct_init (xlator_t *this)
ret = xlator_mem_acct_init (this, gf_dht_mt_end + 1);
if (ret != 0) {
- gf_log (this->name, GF_LOG_ERROR, "Memory accounting init"
- "failed");
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ DHT_MSG_NO_MEMORY,
+ "Memory accounting init failed");
return ret;
}
out:
@@ -289,7 +290,8 @@ dht_parse_decommissioned_bricks (xlator_t *this, dht_conf_t *conf,
conf->decommissioned_bricks[i] =
conf->subvolumes[i];
conf->decommission_subvols_cnt++;
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_SUBVOL_DECOMMISSION_INFO,
"decommissioning subvolume %s",
conf->subvolumes[i]->name);
break;
@@ -354,12 +356,13 @@ dht_init_regex (xlator_t *this, dict_t *odict, char *name,
}
if (regcomp(re,temp_str,REG_EXTENDED) == 0) {
- gf_log (this->name, GF_LOG_DEBUG,
- "using regex %s = %s", name, temp_str);
+ gf_msg_debug (this->name, 0,
+ "using regex %s = %s", name, temp_str);
*re_valid = _gf_true;
}
else {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ DHT_MSG_REGEX_INFO,
"compiling regex %s failed", temp_str);
}
}
@@ -453,7 +456,9 @@ dht_reconfigure (xlator_t *this, dict_t *options)
if (conf->defrag) {
GF_DECIDE_DEFRAG_THROTTLE_COUNT (throttle_count, conf);
- gf_log ("DHT", GF_LOG_INFO, "conf->dthrottle: %s, "
+ gf_msg ("DHT", GF_LOG_INFO, 0,
+ DHT_MSG_REBAL_THROTTLE_INFO,
+ "conf->dthrottle: %s, "
"conf->defrag->recon_thread_count: %d",
conf->dthrottle, conf->defrag->recon_thread_count);
}
@@ -592,7 +597,8 @@ dht_init (xlator_t *this)
/* We get the commit-hash to set only for rebalance process */
if (dict_get_uint32 (this->options,
"commit-hash", &commit_hash) == 0) {
- gf_log (this->name, GF_LOG_INFO, "%s using commit hash %u",
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ DHT_MSG_COMMIT_HASH_INFO, "%s using commit hash %u",
__func__, commit_hash);
conf->vol_commit_hash = commit_hash;
conf->vch_forced = _gf_true;
@@ -717,7 +723,8 @@ dht_init (xlator_t *this)
if (cmd) {
ret = dht_init_local_subvolumes (this, conf);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ DHT_MSG_INIT_LOCAL_SUBVOL_FAILED,
"dht_init_local_subvolumes failed");
goto err;
}
@@ -746,8 +753,8 @@ dht_init (xlator_t *this)
this->local_pool = mem_pool_new (dht_local_t, 512);
if (!this->local_pool) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- DHT_MSG_INIT_FAILED,
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM,
+ DHT_MSG_NO_MEMORY,
" DHT initialisation failed. "
"failed to create local_t's memory pool");
goto err;
@@ -762,9 +769,10 @@ dht_init (xlator_t *this)
GF_DECIDE_DEFRAG_THROTTLE_COUNT(throttle_count, conf);
- gf_log ("DHT", GF_LOG_DEBUG, "conf->dthrottle: %s, "
- "conf->defrag->recon_thread_count: %d",
- conf->dthrottle, conf->defrag->recon_thread_count);
+ gf_msg_debug ("DHT", 0, "conf->dthrottle: %s, "
+ "conf->defrag->recon_thread_count: %d",
+ conf->dthrottle,
+ conf->defrag->recon_thread_count);
}
GF_OPTION_INIT ("xattr-name", conf->xattr_name, str, err);