From 88aa26dc203c3e9396d84a4fd89fc9b64bb38929 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 8 Mar 2016 09:18:56 +0800 Subject: [PATCH] osd: drop unnecessary transaction cleanup The lock() method will ensure 'dirty_info' will be false, and within this function's scope I see no possibility to set 'dirty_info' true. Thus I guess the transaction cleanup logic before exit is never reachable and therefore shall be considered as redundant and can be safely removed. Signed-off-by: xie xingguo --- src/osd/PG.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 15dc0af1d91..ffe79efa685 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2003,12 +2003,7 @@ void PG::_activate_committed(epoch_t epoch, epoch_t activation_epoch) } } - if (dirty_info) { - ObjectStore::Transaction t; - write_if_dirty(t); - int tr = osd->store->queue_transaction(osr.get(), std::move(t), NULL); - assert(tr == 0); - } + assert(!dirty_info); unlock(); } -- 2.47.3