From: Josh Durgin Date: Mon, 21 Jul 2014 21:09:48 +0000 (-0700) Subject: ObjectCacher: fix bh_{add,remove} dirty_or_tx_bh accounting X-Git-Tag: v0.84~77^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=34b0efdec73c4393407add9da7859286f068833a;p=ceph.git ObjectCacher: fix bh_{add,remove} dirty_or_tx_bh accounting tx buffers need to go on the bh_lru_rest as well, and removing erases (not inserts) them into dirty_or_tx_bh. Signed-off-by: Josh Durgin --- diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index e87ec7a07ec0..ed18adc7e854 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -2043,11 +2043,13 @@ void ObjectCacher::bh_add(Object *ob, BufferHead *bh) if (bh->is_dirty()) { bh_lru_dirty.lru_insert_top(bh); dirty_or_tx_bh.insert(bh); - } else if (bh->is_tx()) { - dirty_or_tx_bh.insert(bh); } else { bh_lru_rest.lru_insert_top(bh); } + + if (bh->is_tx()) { + dirty_or_tx_bh.insert(bh); + } bh_stat_add(bh); } @@ -2059,11 +2061,13 @@ void ObjectCacher::bh_remove(Object *ob, BufferHead *bh) if (bh->is_dirty()) { bh_lru_dirty.lru_remove(bh); dirty_or_tx_bh.erase(bh); - } else if (bh->is_tx()) { - dirty_or_tx_bh.insert(bh); } else { bh_lru_rest.lru_remove(bh); } + + if (bh->is_tx()) { + dirty_or_tx_bh.erase(bh); + } bh_stat_sub(bh); }