From 6a09f1a141a88a35ebf26d3e4866fd426f3545aa Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 21 Feb 2020 21:04:29 +0800 Subject: [PATCH] os/filestore: avoid using global `g_ceph_context` always prefer using the local one, for better readability and testability. Signed-off-by: Kefu Chai --- src/os/filestore/FileJournal.h | 2 +- src/os/filestore/JournalThrottle.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/filestore/FileJournal.h b/src/os/filestore/FileJournal.h index d2475e437f88..b0204366265a 100644 --- a/src/os/filestore/FileJournal.h +++ b/src/os/filestore/FileJournal.h @@ -417,7 +417,7 @@ private: full_state(FULL_NOTFULL), fd(-1), writing_seq(0), - throttle(cct->_conf->filestore_caller_concurrency), + throttle(cct, cct->_conf->filestore_caller_concurrency), write_stop(true), aio_stop(true), write_thread(this), diff --git a/src/os/filestore/JournalThrottle.h b/src/os/filestore/JournalThrottle.h index 75485d6d8f30..f32f5d734f54 100644 --- a/src/os/filestore/JournalThrottle.h +++ b/src/os/filestore/JournalThrottle.h @@ -94,8 +94,9 @@ public: uint64_t get_max(); JournalThrottle( + CephContext *cct, unsigned expected_concurrency ///< [in] determines size of conds - ) : throttle(g_ceph_context, "filestore_journal", expected_concurrency) {} + ) : throttle(cct, "filestore_journal", expected_concurrency) {} }; #endif -- 2.47.3