From e3fc4dbdd67b86737380bf46c15cf0becdacd29e Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Sun, 18 Sep 2016 21:00:26 +0100 Subject: [PATCH] osd/PG.h: move shared ptr instead of copying it When we move newmap into osdmap_ref we prevent unnecessary increase and decrease of reference count when newmap goes out of scope. Signed-off-by: Michal Jarzabek --- src/osd/PG.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index 1cf85d22586..c3fb92759d8 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -226,7 +226,7 @@ protected: void update_osdmap_ref(OSDMapRef newmap) { assert(_lock.is_locked_by_me()); Mutex::Locker l(map_lock); - osdmap_ref = newmap; + osdmap_ref = std::move(newmap); } OSDMapRef get_osdmap_with_maplock() const {