diff options
Diffstat (limited to 'xlators/performance/quick-read/src/quick-read.c')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 53f9a5d44ce..c6913ee471b 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -10,6 +10,7 @@ #include "quick-read.h" #include "statedump.h" +#include "quick-read-messages.h" qr_inode_t *qr_inode_ctx_get (xlator_t *this, inode_t *inode); void __qr_inode_prune (qr_inode_table_t *table, qr_inode_t *qr_inode); @@ -471,8 +472,9 @@ qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) ret = dict_set (xdata, GF_CONTENT_KEY, data_from_uint64 (conf->max_file_size)); if (ret) - gf_log (this->name, GF_LOG_WARNING, - "cannot set key in request dict (%s)", + gf_msg (this->name, GF_LOG_WARNING, 0, + QUICK_READ_MSG_DICT_SET_FAILED, + "cannot set key in request dict (%s)", loc->path); wind: frame->local = inode_ref (loc->inode); @@ -784,8 +786,9 @@ mem_acct_init (xlator_t *this) ret = xlator_mem_acct_init (this, gf_qr_mt_end + 1); if (ret != 0) { - gf_log (this->name, GF_LOG_ERROR, "Memory accounting init" - "failed"); + gf_msg (this->name, GF_LOG_ERROR, ENOMEM, + QUICK_READ_MSG_NO_MEMORY, + "Memory accounting init failed"); return ret; } @@ -805,7 +808,8 @@ check_cache_size_ok (xlator_t *this, int64_t cache_size) opt = xlator_volume_option_get (this, "cache-size"); if (!opt) { ret = _gf_false; - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, EINVAL, + QUICK_READ_MSG_INVALID_ARGUMENT, "could not get cache-size option"); goto out; } @@ -816,11 +820,12 @@ check_cache_size_ok (xlator_t *this, int64_t cache_size) else max_cache_size = total_mem; - gf_log (this->name, GF_LOG_DEBUG, "Max cache size is %"PRIu64, - max_cache_size); + gf_msg_debug (this->name, 0, "Max cache size is %"PRIu64, + max_cache_size); if (cache_size > max_cache_size) { ret = _gf_false; - gf_log (this->name, GF_LOG_ERROR, "Cache size %"PRIu64 + gf_msg (this->name, GF_LOG_ERROR, 0, + QUICK_READ_MSG_INVALID_ARGUMENT, "Cache size %"PRIu64 " is greater than the max size of %"PRIu64, cache_size, max_cache_size); goto out; @@ -854,7 +859,8 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("cache-size", cache_size_new, options, size_uint64, out); if (!check_cache_size_ok (this, cache_size_new)) { ret = -1; - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, EINVAL, + QUICK_READ_MSG_INVALID_CONFIG, "Not reconfiguring cache-size"); goto out; } @@ -923,10 +929,9 @@ qr_get_priority_list (const char *opt_str, struct list_head *first) goto out; } - gf_log ("quick-read", GF_LOG_TRACE, - "quick-read priority : pattern %s : priority %s", - pattern, - priority); + gf_msg_trace ("quick-read", 0, + "quick-read priority : pattern %s : priority %s", + pattern, priority); curr->pattern = gf_strdup (pattern); if (curr->pattern == NULL) { @@ -972,14 +977,16 @@ init (xlator_t *this) qr_conf_t *conf = NULL; if (!this->children || this->children->next) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, 0, + QUICK_READ_MSG_XLATOR_CHILD_MISCONFIGURED, "FATAL: volume (%s) not configured with exactly one " "child", this->name); return -1; } if (!this->parents) { - gf_log (this->name, GF_LOG_WARNING, + gf_msg (this->name, GF_LOG_WARNING, 0, + QUICK_READ_MSG_VOL_MISCONFIGURED, "dangling volume. check volfile "); } @@ -1007,8 +1014,8 @@ init (xlator_t *this) if (dict_get (this->options, "priority")) { char *option_list = data_to_str (dict_get (this->options, "priority")); - gf_log (this->name, GF_LOG_TRACE, - "option path %s", option_list); + gf_msg_trace (this->name, 0, + "option path %s", option_list); /* parse the list of pattern:priority */ conf->max_pri = qr_get_priority_list (option_list, &conf->priority_list); |