From: Radoslaw Zarzynski Date: Mon, 29 Mar 2021 16:21:14 +0000 (+0000) Subject: crimson/osd: std::move func in pg::with_*_obc(). X-Git-Tag: v17.1.0~2395^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0e731e6c082d3996dc4b78a8cfa06cd0b2b57afa;p=ceph.git crimson/osd: std::move func in pg::with_*_obc(). 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 --- diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 10a7a4f5520c..0e3200d4ff4e 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -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)); }); }); });