From: David Zafman Date: Fri, 24 Jan 2014 03:55:27 +0000 (-0800) Subject: osd: Add scrub_supported() backend interface X-Git-Tag: v0.78~237^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37447e758eba628b3dcb21834c15e5baa4a779bb;p=ceph.git osd: Add scrub_supported() backend interface Signed-off-by: David Zafman --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 299ecd612884..38bb17194a36 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4856,7 +4856,7 @@ void OSD::sched_scrub() PG *pg = _lookup_lock_pg(pgid); if (pg) { - if (pg->is_active() && + if (pg->get_pgbackend()->scrub_supported() && pg->is_active() && (load_is_low || (double)diff >= cct->_conf->osd_scrub_max_interval || pg->scrubber.must_scrub)) { diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ee02a57c66d1..83fa35b710d1 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3447,6 +3447,7 @@ void PG::scrub(ThreadPool::TPHandle &handle) */ void PG::classic_scrub(ThreadPool::TPHandle &handle) { + assert(pool.info.type == pg_pool_t::TYPE_REPLICATED); if (!scrubber.active) { dout(10) << "scrub start" << dendl; scrubber.active = true; diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index 8c527d65086e..81a0ee5d1fd5 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -34,6 +34,7 @@ * 1) Handling client operations * 2) Handling object recovery * 3) Handling object access + * 4) Handling scrub, deep-scrub, repair */ class PGBackend { public: @@ -428,6 +429,8 @@ const list, pair > > &to_read, Context *on_complete) = 0; + + virtual bool scrub_supported() { return false; } }; #endif diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index b152f42b0f83..867ffa33b8be 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -489,6 +489,7 @@ private: }; void sub_op_modify_applied(RepModifyRef rm); void sub_op_modify_commit(RepModifyRef rm); + bool scrub_supported() { return true; } }; #endif