diff options
author | Venky Shankar <vshankar@redhat.com> | 2015-06-25 12:07:24 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-07-09 03:31:34 -0700 |
commit | 911b4a37a67b6759ddce55e1b3dbcd0641805f76 (patch) | |
tree | 7dedfa6f4e0f9e7b1cd9f7042ff857821cdb67a8 /xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | |
parent | a90b7c5d640bc7bf1bd648c69127fd1953e27421 (diff) |
features/bitrot: convert pending gf_log() to gf_msg()
Backport of http://review.gluster.org/11396
Change-Id: Idfd245327b485459ccbda503510b8ca0127bb66c
BUG: 1226666
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/11542
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/bitd/bit-rot-scrub.c')
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c index af31a3cb775..3a038cef2bc 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c @@ -542,11 +542,12 @@ br_fsscan_deactivate (xlator_t *this, br_child_t *child) ret = gf_tw_del_timer (priv->timer_wheel, fsscan->timer); if (ret == 0) { nstate = BR_SCRUB_STATE_STALLED; - gf_log (this->name, GF_LOG_INFO, "Brick [%s] is under active " - "scrubbing. Pausing scrub..", child->brick_path); + gf_msg (this->name, GF_LOG_INFO, 0, BRB_MSG_SCRUB_INFO, + "Brick [%s] is under active scrubbing. Pausing scrub..", + child->brick_path); } else { nstate = BR_SCRUB_STATE_PAUSED; - gf_log (this->name, GF_LOG_INFO, + gf_msg (this->name, GF_LOG_INFO, 0, BRB_MSG_SCRUB_INFO, "Scrubber paused [Brick: %s]", child->brick_path); } @@ -617,8 +618,9 @@ br_fsscanner_exit_control (xlator_t *this, br_child_t *child) if (fsscan->state == BR_SCRUB_STATE_ACTIVE) { (void) br_fsscan_activate (this, child); } else { - gf_log (this->name, GF_LOG_INFO, "Brick [%s] waiting " - "to get rescheduled..", child->brick_path); + gf_msg (this->name, GF_LOG_INFO, 0, BRB_MSG_SCRUB_INFO, + "Brick [%s] waiting to get rescheduled..", + child->brick_path); } } UNLOCK (&child->lock); @@ -757,7 +759,8 @@ br_fsscan_schedule (xlator_t *this, br_child_t *child) timo = br_fsscan_calculate_timeout (fsscan->boot, fsscan->boot, fsscrub->frequency); if (timo == 0) { - gf_log (this->name, GF_LOG_ERROR, "BUG: Zero schedule timeout"); + gf_msg (this->name, GF_LOG_ERROR, 0, BRB_MSG_ZERO_TIMEOUT_BUG, + "BUG: Zero schedule timeout"); goto error_return; } @@ -805,7 +808,8 @@ br_fsscan_activate (xlator_t *this, br_child_t *child) timo = br_fsscan_calculate_timeout (fsscan->boot, now.tv_sec, fsscrub->frequency); if (timo == 0) { - gf_log (this->name, GF_LOG_ERROR, "BUG: Zero schedule timeout"); + gf_msg (this->name, GF_LOG_ERROR, 0, BRB_MSG_ZERO_TIMEOUT_BUG, + "BUG: Zero schedule timeout"); return -1; } @@ -815,8 +819,8 @@ br_fsscan_activate (xlator_t *this, br_child_t *child) (void) gf_tw_mod_timer (priv->timer_wheel, fsscan->timer, timo); _br_child_set_scrub_state (child, BR_SCRUB_STATE_PENDING); - gf_log (this->name, GF_LOG_INFO, "Scrubbing for %s rescheduled to run " - "at %s", child->brick_path, timestr); + gf_msg (this->name, GF_LOG_INFO, 0, BRB_MSG_SCRUB_INFO, "Scrubbing for " + "%s rescheduled to run at %s", child->brick_path, timestr); return 0; } @@ -840,7 +844,8 @@ br_fsscan_reschedule (xlator_t *this, br_child_t *child) timo = br_fsscan_calculate_timeout (fsscan->boot, now.tv_sec, fsscrub->frequency); if (timo == 0) { - gf_log (this->name, GF_LOG_ERROR, "BUG: Zero schedule timeout"); + gf_msg (this->name, GF_LOG_ERROR, 0, BRB_MSG_ZERO_TIMEOUT_BUG, + "BUG: Zero schedule timeout"); return -1; } @@ -850,13 +855,14 @@ br_fsscan_reschedule (xlator_t *this, br_child_t *child) fsscan->over = _gf_false; ret = gf_tw_mod_timer_pending (priv->timer_wheel, fsscan->timer, timo); if (ret == 0) - gf_log (this->name, GF_LOG_INFO, + gf_msg (this->name, GF_LOG_INFO, 0, BRB_MSG_SCRUB_INFO, "Scrubber for %s is currently running and would be " "rescheduled after completion", child->brick_path); else { _br_child_set_scrub_state (child, BR_SCRUB_STATE_PENDING); - gf_log (this->name, GF_LOG_INFO, "Scrubbing for %s rescheduled " - "to run at %s", child->brick_path, timestr); + gf_msg (this->name, GF_LOG_INFO, 0, BRB_MSG_SCRUB_INFO, + "Scrubbing for %s rescheduled to run at %s", + child->brick_path, timestr); } return 0; |