summaryrefslogtreecommitdiffstats
path: root/xlators/features/bit-rot
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 23:40:53 -0800
commit974837c3da9deb45cd2dc31afe56e5960268cf01 (patch)
treef865d9aa710159ce81e5abcb4a368e7c18171eff /xlators/features/bit-rot
parent99657b970855d9735a195e8ac19c8f1011d0d713 (diff)
glusterd/bitrot : Integration of bad files from bitd with scrub status command
This patch is backport of: http://review.gluster.org/#/c/12720/ 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> Change-Id: If09babafaf5d7cf158fa79119abbf5b986027748 BUG: 1283881 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/12725 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')
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-scrub.h2
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.c29
2 files changed, 21 insertions, 10 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
index 427153c..e730582 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h
@@ -25,4 +25,6 @@ int32_t br_scrubber_handle_options (xlator_t *, br_private_t *, dict_t *);
int32_t br_scrubber_init (xlator_t *, br_private_t *);
+int32_t br_collect_bad_objects_from_children (xlator_t *this, dict_t *dict);
+
#endif /* __BIT_ROT_SCRUB_H__ */
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c
index c5a8a75..a88fa57 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.c
@@ -1562,6 +1562,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;
@@ -1638,19 +1653,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);