From 122cfa9c8d254d1ebc15811a67cf8a96152dbf6f Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Mon, 9 Jul 2018 18:35:23 +0800 Subject: [PATCH] os/bluestore: batch handle get_fragmentation. Signed-off-by: Jianpeng Ma --- src/os/bluestore/BlueStore.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 687a93e8a764..7ef5e91a8842 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -8824,9 +8824,7 @@ void BlueStore::_txc_finish(TransContext *txc) << dendl; } } - logger->set(l_bluestore_fragmentation, - (uint64_t)(alloc->get_fragmentation(min_alloc_size) * 1000)); -} + } void BlueStore::_txc_release_alloc(TransContext *txc) { @@ -9305,6 +9303,9 @@ void BlueStore::_kv_finalize_thread() // this is as good a place as any ... _reap_collections(); + logger->set(l_bluestore_fragmentation, + (uint64_t)(alloc->get_fragmentation(min_alloc_size) * 1000)); + l.lock(); } } -- 2.47.3