]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
immutable_object_cache: Remove pessimizing moves
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 2 May 2019 16:41:16 +0000 (12:41 -0400)
committerKefu Chai <kchai@redhat.com>
Fri, 21 Jun 2019 03:38:55 +0000 (11:38 +0800)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/tools/immutable_object_cache/ObjectCacheStore.cc

index 7c3864a157a7814993c1d091b687280f84dfd823..d89935424ef9a69f3d560158f1cbe59499459e6f 100644 (file)
@@ -100,8 +100,7 @@ int ObjectCacheStore::do_promote(std::string pool_nspace,
                    << " snapshot: " << snap_id << dendl;
 
   int ret = 0;
-  std::string cache_file_name = std::move(get_cache_file_name(pool_nspace,
-                                          pool_id, snap_id, object_name));
+  std::string cache_file_name = get_cache_file_name(pool_nspace, pool_id, snap_id, object_name);
   librados::IoCtx ioctx;
   {
     Mutex::Locker _locker(m_ioctx_map_lock);
@@ -147,8 +146,7 @@ int ObjectCacheStore::handle_promote_callback(int ret, bufferlist* read_buf,
     ret = 0;
   }
 
-  std::string cache_file_path = std::move(
-    get_cache_file_path(cache_file_name, true));
+  std::string cache_file_path = get_cache_file_path(cache_file_name, true);
 
   if (cache_file_path == "") {
     lderr(m_cct) << "fail to write cache file" << dendl;
@@ -186,8 +184,7 @@ int ObjectCacheStore::lookup_object(std::string pool_nspace,
                    << " in pool ID : " << pool_id << dendl;
 
   int pret = -1;
-  std::string cache_file_name = std::move(get_cache_file_name(pool_nspace,
-                                            pool_id, snap_id, object_name));
+  std::string cache_file_name = get_cache_file_name(pool_nspace, pool_id, snap_id, object_name);
 
   cache_status_t ret = m_policy->lookup_object(cache_file_name);
 
@@ -245,7 +242,7 @@ int ObjectCacheStore::do_evict(std::string cache_file) {
     return 0;
   }
 
-  std::string cache_file_path = std::move(get_cache_file_path(cache_file));
+  std::string cache_file_path = get_cache_file_path(cache_file);
 
   ldout(m_cct, 20) << "evict cache: " << cache_file_path << dendl;