]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: std::move func in pg::with_*_obc().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 29 Mar 2021 16:21:14 +0000 (16:21 +0000)
committerKefu Chai <kchai@redhat.com>
Fri, 2 Apr 2021 07:26:42 +0000 (15:26 +0800)
Well, likely all the commit does is just appending a couple
of extra bytes. Though, strictly juding, a func should be
`std::move()`d before calling in those cases. Otherwise we
can miss e.g. the `operator() &&` overload.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/pg.cc

index 10a7a4f5520c4a22daa6dc79b2ad95f3342e825a..0e3200d4ff4e0efc7149dfe36652d5343ca6ccc4 100644 (file)
@@ -876,7 +876,7 @@ PG::with_head_obc(hobject_t oid, with_obc_func_t&& func)
       });
     }
     return loaded.safe_then_interruptible([func = std::move(func)](auto obc) {
-      return func(std::move(obc));
+      return std::move(func)(std::move(obc));
     });
   }).finally([this, pgref, obc=std::move(obc)] {
     logger().debug("with_head_obc: released {}", obc->get_oid());
@@ -917,7 +917,7 @@ PG::with_clone_obc(hobject_t oid, with_obc_func_t&& func)
         });
       }
       return loaded.safe_then_interruptible([func = std::move(func)](auto clone) {
-        return func(std::move(clone));
+        return std::move(func)(std::move(clone));
       });
     });
   });