summaryrefslogtreecommitdiffstats
path: root/xlators/features/bit-rot/src/bitd/bit-rot.c
diff options
context:
space:
mode:
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>2015-11-23 17:00:07 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-11-23 22:25:47 -0800
commit4348a6af89085cbdb41963f828b88deee4a109f1 (patch)
tree0c50f31509a765df4b18d46c21c139c2ac30736f /xlators/features/bit-rot/src/bitd/bit-rot.c
parentc93e436527e9d2ceed46b939e18edc40b7018cee (diff)
glusterd/bitrot : Integration of bad files from bitd with scrub status command
Currently scrub status command is not displaying list of all the bad files. All the bad files are avaliable in the bitd daemon. With this patch it will dispaly list of all the bad file's in the scrub status command. Change-Id: If09babafaf5d7cf158fa79119abbf5b986027748 BUG: 1207627 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/12720 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>
Diffstat (limited to 'xlators/features/bit-rot/src/bitd/bit-rot.c')
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c
index c4ed7dee718..b28bf2622af 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.c
@@ -1547,6 +1547,21 @@ _br_qchild_event (xlator_t *this, br_child_t *child, br_child_handler *call)
}
int
+br_scrubber_status_get (xlator_t *this, dict_t **dict)
+{
+
+ int ret = -1;
+
+ ret = br_get_bad_objects_list (this, dict);
+ if (ret) {
+ gf_msg_debug (this->name, 0, "Failed to collect corrupt "
+ "files");
+ }
+
+ return ret;
+}
+
+int
notify (xlator_t *this, int32_t event, void *data, ...)
{
int idx = -1;
@@ -1623,19 +1638,13 @@ notify (xlator_t *this, int32_t event, void *data, ...)
break;
case GF_EVENT_SCRUB_STATUS:
- gf_log (this->name, GF_LOG_INFO, "BitRot scrub status "
- "called");
+ gf_msg_debug (this->name, GF_LOG_INFO, "BitRot scrub status "
+ "called");
va_start (ap, data);
output = va_arg (ap, dict_t *);
- /* As of now hardcoding last-scrub-time value. At the time of
- * Final patch submission this option value along with other
- * few option value will be calculate based on real time */
- ret = dict_set_uint64 (output, "last-scrub-time", 12);
- if (ret) {
- gf_log (this->name, GF_LOG_DEBUG, "Failed to set last "
- "scrub time value");
- }
+ ret = br_scrubber_status_get (this, &output);
+ gf_msg_debug (this->name, 0, "returning %d", ret);
break;
default:
default_notify (this, event, data);