]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: avoid using global `g_ceph_context`
authorKefu Chai <kchai@redhat.com>
Fri, 21 Feb 2020 13:03:33 +0000 (21:03 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 22 Feb 2020 03:29:34 +0000 (11:29 +0800)
always prefer using the local one, for better readability and
testability.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/os/bluestore/KernelDevice.cc

index 990e0ce90999d9bca1888323da6574a1ceb9e7fe..f816cd66b5213d32d84fc189743244b402ed3eef 100644 (file)
@@ -55,7 +55,7 @@ KernelDevice::KernelDevice(CephContext* cct, aio_callback_t cb, void *cbpriv, ai
   fd_directs.resize(WRITE_LIFE_MAX, -1);
   fd_buffereds.resize(WRITE_LIFE_MAX, -1);
 
-  bool use_ioring = g_ceph_context->_conf.get_val<bool>("bluestore_ioring");
+  bool use_ioring = cct->_conf.get_val<bool>("bluestore_ioring");
   unsigned int iodepth = cct->_conf->bdev_aio_max_queue_depth;
 
   if (use_ioring && ioring_queue_t::supported()) {