From: Casey Bodley Date: Tue, 24 May 2016 14:23:26 +0000 (-0400) Subject: rgw: remove unneeded RGWRados::num_rados_handles X-Git-Tag: v11.0.0~340^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=72d5a485e41ac5824c30556b6cfe659094cd303c;p=ceph.git rgw: remove unneeded RGWRados::num_rados_handles Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 7cce45513a4..0594c7fd2a9 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3199,8 +3199,7 @@ void RGWRados::finalize() int RGWRados::init_rados() { int ret = 0; - auto count = cct->_conf->rgw_num_rados_handles; - auto handles = std::vector{count}; + auto handles = std::vector{cct->_conf->rgw_num_rados_handles}; for (auto& r : handles) { ret = r.init_with_context(cct); @@ -3223,7 +3222,6 @@ int RGWRados::init_rados() meta_mgr = new RGWMetadataManager(cct, this); data_log = new RGWDataChangesLog(cct, this); - num_rados_handles = count; std::swap(handles, rados); return ret; } @@ -12083,7 +12081,7 @@ void RGWStoreManager::close_storage(RGWRados *store) librados::Rados* RGWRados::get_rados_handle() { - if (num_rados_handles == 1) { + if (rados.size() == 1) { return &rados[0]; } else { handle_lock.get_read(); @@ -12097,7 +12095,7 @@ librados::Rados* RGWRados::get_rados_handle() handle_lock.put_read(); handle_lock.get_write(); uint32_t handle = next_rados_handle.read(); - if (handle == num_rados_handles) { + if (handle == rados.size()) { next_rados_handle.set(0); handle = 0; } diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 03dd1daf06a..f5f8a7f64ce 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1802,7 +1802,6 @@ protected: std::vector rados; atomic_t next_rados_handle; - uint32_t num_rados_handles; RWLock handle_lock; std::map rados_map; @@ -1842,7 +1841,7 @@ public: bucket_index_max_shards(0), max_bucket_id(0), cct(NULL), next_rados_handle(0), - num_rados_handles(0), handle_lock("rados_handle_lock"), + handle_lock("rados_handle_lock"), binfo_cache(NULL), pools_initialized(false), quota_handler(NULL),