From: Haomai Wang Date: Sun, 27 Jul 2014 05:37:49 +0000 (+0800) Subject: Only write bufferhead when it's dirty X-Git-Tag: v0.84~55^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2149%2Fhead;p=ceph.git Only write bufferhead when it's dirty The TX state bh should be skipped because the bh should be inflight. We only need to write dirty bh. And TX and dirty state bh both should be waited until flushed. Signed-off-by: Haomai Wang --- diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index ed18adc7e854..e7dfe18bb060 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -1621,7 +1621,10 @@ bool ObjectCacher::flush_set(ObjectSet *oset, Context *onfinish) next++; BufferHead *bh = *it; waitfor_commit.insert(bh->ob); - bh_write(bh); + + if (bh->is_dirty()) + bh_write(bh); + it = next; }