summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volume-set.c
diff options
context:
space:
mode:
authorNandaja Varma <nandaja.varma@gmail.com>2015-03-09 16:59:54 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-06-16 03:50:10 -0700
commitb3c9fdacce4057e1ca8275dd095782ac4004dd92 (patch)
tree37c5394639848a48a096dd368136562783fa88b1 /xlators/mgmt/glusterd/src/glusterd-volume-set.c
parentc58a15811a82c675a4cc20d664731239daa0c48c (diff)
glusterd: Porting messages to new logging framework.
Backport of http://review.gluster.org/#/c/9836/ Change-Id: I56ced6fca0246c230cc389132c47a0f60472ed0c BUG: 1217722 Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Reviewed-on: http://review.gluster.org/9836 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> (cherry picked from commit 2ae034374ce449c54b1b4ae8350401371db1d8d3) Reviewed-on: http://review.gluster.org/11221
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-set.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 8dea0695d67..aed24469608 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -61,14 +61,15 @@ validate_cache_max_min_size (glusterd_volinfo_t *volinfo, dict_t *dict,
"cache-min-file-size (%s) is greater than "
"cache-max-file-size (%s)",
current_min_value, current_max_value);
- gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_CACHE_MINMAX_SIZE_INVALID, "%s", errstr);
*op_errstr = gf_strdup (errstr);
ret = -1;
goto out;
}
out:
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
return ret;
}
@@ -118,7 +119,8 @@ validate_quota (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
ret = glusterd_volinfo_get_boolean (volinfo, VKEY_FEATURES_QUOTA);
if (ret == -1) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_QUOTA_GET_STAT_FAIL,
"failed to get the quota status");
goto out;
}
@@ -126,7 +128,8 @@ validate_quota (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
if (ret == _gf_false) {
snprintf (errstr, sizeof (errstr),
"Cannot set %s. Enable quota first.", key);
- gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_QUOTA_DISABLED, "%s", errstr);
*op_errstr = gf_strdup (errstr);
ret = -1;
goto out;
@@ -134,7 +137,7 @@ validate_quota (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
ret = 0;
out:
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
return ret;
}
@@ -156,12 +159,13 @@ validate_uss (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
snprintf (errstr, sizeof (errstr), "%s is not a valid boolean "
"value. %s expects a valid boolean value.", value,
key);
- gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_INVALID_ENTRY, "%s", errstr);
*op_errstr = gf_strdup (errstr);
goto out;
}
out:
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
return ret;
}
@@ -183,14 +187,15 @@ validate_stripe (glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
if (volinfo->stripe_count == 1) {
snprintf (errstr, sizeof (errstr),
"Cannot set %s for a non-stripe volume.", key);
- gf_log (this->name, GF_LOG_ERROR, "%s", errstr);
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_NON_STRIPE_VOL, "%s", errstr);
*op_errstr = gf_strdup (errstr);
ret = -1;
goto out;
}
out:
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
return ret;
}
@@ -219,7 +224,8 @@ validate_subvols_per_directory (glusterd_volinfo_t *volinfo, dict_t *dict,
"subvols-per-directory(%d) is greater "
"than the number of subvolumes(%d).",
subvols, volinfo->subvol_count);
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ GD_MSG_SUBVOLUMES_EXCEED,
"%s.", errstr);
*op_errstr = gf_strdup (errstr);
ret = -1;
@@ -227,7 +233,7 @@ validate_subvols_per_directory (glusterd_volinfo_t *volinfo, dict_t *dict,
}
out:
- gf_log (this->name, GF_LOG_DEBUG, "Returning %d", ret);
+ gf_msg_debug (this->name, 0, "Returning %d", ret);
return ret;
}