diff options
author | Gaurav Kumar Garg <garg.gaurav52@gmail.com> | 2015-11-25 17:38:43 +0530 |
---|---|---|
committer | Venky Shankar <vshankar@redhat.com> | 2015-12-14 19:08:39 -0800 |
commit | 22827d51c232c44a8f5ac003529d907d93baf7b0 (patch) | |
tree | 6cd9965c9a87c4332b865a9d602927de62f165e6 /xlators/features/bit-rot/src/bitd/bit-rot.h | |
parent | 0598ca33ec95b4f4c44582c6154c52494b910b3a (diff) |
bitrot: getting correct value of scrub stat's
When user execute bitrot scrub status command then gluster
is not giving correct value of Number of Scrubbed files,
Number of Unsigned files, Last completed scrub time,
Duration of last scrub.
With this patch scrub status will give correct value for
all the above fields.
Change-Id: Ic966f76d22db5b0c889e6386a1c2219afbda1f49
BUG: 1285989
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: http://review.gluster.org/12776
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/bitd/bit-rot.h')
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.h b/xlators/features/bit-rot/src/bitd/bit-rot.h index 16892a7e3fd..04336e641d0 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot.h @@ -154,6 +154,26 @@ struct br_scrubber { typedef struct br_obj_n_workers br_obj_n_workers_t; +typedef struct br_private br_private_t; + +typedef void (*br_scrubbed_file_update) (br_private_t *priv); + +struct br_scrub_stats { + uint32_t scrubbed_files; /* Total number of scrubbed file */ + + uint32_t unsigned_files; /* Total number of unsigned file */ + + uint32_t scrub_duration; /* Duration of last scrub */ + + char last_scrub_time[1024]; /*last scrub completion time */ + + struct timeval scrub_start_tv; /* Scrubbing starting time*/ + + struct timeval scrub_end_tv; /* Scrubbing finishing time */ + + pthread_mutex_t lock; +}; + struct br_private { pthread_mutex_t lock; @@ -179,17 +199,18 @@ struct br_private { and ready to be picked up for signing and the workers which sign the objects */ + uint32_t expiry_time; /* objects "wait" time */ br_tbf_t *tbf; /* token bucket filter */ gf_boolean_t iamscrubber; /* function as a fs scrubber */ + struct br_scrub_stats scrub_stat; /* statistics of scrub*/ + struct br_scrubber fsscrub; /* scrubbers for this subvolume */ }; -typedef struct br_private br_private_t; - struct br_object { xlator_t *this; |