From: Kefu Chai Date: Fri, 21 Feb 2020 13:04:29 +0000 (+0800) Subject: os/filestore: avoid using global `g_ceph_context` X-Git-Tag: v16.0.0~60^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a09f1a141a88a35ebf26d3e4866fd426f3545aa;p=ceph.git os/filestore: avoid using global `g_ceph_context` always prefer using the local one, for better readability and testability. Signed-off-by: Kefu Chai --- 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