From 401360783f6a9cb6073dc2e9810c2e7c9608e44c Mon Sep 17 00:00:00 2001 From: Shinobu Kinjo Date: Wed, 13 Dec 2017 14:48:09 +0900 Subject: [PATCH] common/mds/osd: Explicitly delete if no copy, and remove incorrect comment Signed-off-by: Shinobu Kinjo --- src/include/elist.h | 5 ++--- src/include/xlist.h | 5 ++--- src/mds/Capability.h | 4 ++-- src/osd/OSDMap.h | 1 - src/osdc/Objecter.h | 5 ++--- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/include/elist.h b/src/include/elist.h index 1bf3df8c6c875..6719b9c92d840 100644 --- a/src/include/elist.h +++ b/src/include/elist.h @@ -39,9 +39,8 @@ public: assert(!is_on_list()); } - // no copying! - item(const item& other); - const item& operator= (const item& right); + item(const item& other) = delete; + const item& operator= (const item& right) = delete; bool empty() const { return _prev == this; } diff --git a/src/include/xlist.h b/src/include/xlist.h index 3e39333e511d4..5e4995af8300b 100644 --- a/src/include/xlist.h +++ b/src/include/xlist.h @@ -33,9 +33,8 @@ public: //remove_myself(); } - // no copying! - item(const item& other); - const item& operator= (const item& right); + item(const item& other) = delete; + const item& operator= (const item& right) = delete; xlist* get_list() { return _list; } diff --git a/src/mds/Capability.h b/src/mds/Capability.h index e3ada8411c43e..3543efee849fb 100644 --- a/src/mds/Capability.h +++ b/src/mds/Capability.h @@ -127,9 +127,9 @@ public: mseq(0), suppress(0), state(0) { } - Capability(const Capability& other); // no copying + Capability(const Capability& other) = delete; - const Capability& operator=(const Capability& other); // no copying + const Capability& operator=(const Capability& other) = delete; int pending() { return _pending; } int issued() { return _issued; } diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index d817a632a017b..fd1f381d90cf8 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -587,7 +587,6 @@ private: memset(&fsid, 0, sizeof(fsid)); } - // no copying private: OSDMap(const OSDMap& other) = default; OSDMap& operator=(const OSDMap& other) = default; diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index de225dc865b4d..701e642ecc8c0 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1754,9 +1754,8 @@ public: ping_tid(0), map_dne_bound(0) {} - // no copy! - const LingerOp &operator=(const LingerOp& r); - LingerOp(const LingerOp& o); + const LingerOp &operator=(const LingerOp& r) = delete; + LingerOp(const LingerOp& o) = delete; uint64_t get_cookie() { return reinterpret_cast(this); -- 2.39.5