From: Zengran Zhang Date: Mon, 21 Jan 2019 11:19:16 +0000 (+0800) Subject: osd: ec saves a write access to the memory under most circumstances X-Git-Tag: v14.1.0~298^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f33fc9c16eeaafca77872340fe0a402775a6407;p=ceph.git osd: ec saves a write access to the memory under most circumstances Signed-off-by: Kefu Chai Signed-off-by: Zengran Zhang --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index dc7f5aed7936..c20e10a25ac2 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1861,9 +1861,9 @@ bool ECBackend::try_state_to_reads() return false; } - op->using_cache = pipeline_state.caching_enabled(); - - if (op->invalidates_cache()) { + if (!pipeline_state.caching_enabled()) { + op->using_cache = false; + } else if (op->invalidates_cache()) { dout(20) << __func__ << ": invalidating cache after this op" << dendl; pipeline_state.invalidate(); diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index 6784925df9ca..89d5dcbcb524 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -478,7 +478,7 @@ public: bool invalidates_cache() const { return plan.invalidates_cache; } // must be true if requires_rmw(), must be false if invalidates_cache() - bool using_cache = false; + bool using_cache = true; /// In progress read state; map pending_read; // subset already being read