From 51f3d2d166ad49b63e3e885e2ba1a478145ac1b8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 3 Dec 2008 14:17:54 -0800 Subject: [PATCH] osd: scrub info in pg_stat_t. scrub states. --- src/osd/PG.cc | 13 +++++++++++-- src/osd/osd_types.h | 25 +++++++++++++++++++------ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index db5c1b3d46d68..4b4cd3281fc42 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1797,7 +1797,9 @@ void PG::scrub() } dout(10) << "scrub start" << dendl; - + state_set(PG_STATE_SCRUBBING); + update_stats(); + // request maps from replicas for (unsigned i=1; i acting; - pg_stat_t() : reported(0), created(0), parent_split_bits(0), - state(0), + pg_stat_t() : reported(0), state(0), + created(0), parent_split_bits(0), num_bytes(0), num_kb(0), num_objects(0), num_object_clones(0), num_objects_missing_on_primary(0), num_objects_degraded(0) @@ -386,10 +395,12 @@ struct pg_stat_t { void encode(bufferlist &bl) const { ::encode(version, bl); ::encode(reported, bl); + ::encode(state, bl); ::encode(created, bl); ::encode(parent, bl); ::encode(parent_split_bits, bl); - ::encode(state, bl); + ::encode(last_scrub, bl); + ::encode(last_scrub_stamp, bl); ::encode(num_bytes, bl); ::encode(num_kb, bl); ::encode(num_objects, bl); @@ -401,10 +412,12 @@ struct pg_stat_t { void decode(bufferlist::iterator &bl) { ::decode(version, bl); ::decode(reported, bl); + ::decode(state, bl); ::decode(created, bl); ::decode(parent, bl); ::decode(parent_split_bits, bl); - ::decode(state, bl); + ::decode(last_scrub, bl); + ::decode(last_scrub_stamp, bl); ::decode(num_bytes, bl); ::decode(num_kb, bl); ::decode(num_objects, bl); -- 2.39.5