From 74e5c390e2956989c39d705cad786219306c40f2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 21 Jun 2011 15:58:59 -0700 Subject: [PATCH] make misc items as not copyable These structures are all not copyable. Make sure we get a link error if we try. Signed-off-by: Sage Weil --- src/client/Trace.h | 3 +++ src/common/BackTrace.h | 3 +++ src/common/RWLock.h | 4 +++- src/common/Thread.h | 3 +++ src/crush/CrushWrapper.h | 3 +++ src/include/Context.h | 4 ++++ src/osd/ReplicatedPG.h | 3 +++ src/osdc/Filer.h | 3 +++ src/osdc/ObjectCacher.h | 3 +++ 9 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/client/Trace.h b/src/client/Trace.h index 6665f21b4f830..dc3ac22e6f2f7 100644 --- a/src/client/Trace.h +++ b/src/client/Trace.h @@ -44,6 +44,9 @@ class Trace { delete fs; } + Trace(const Trace& other); + const Trace& operator=(const Trace& other); + int get_line() { return _line; } void start(); diff --git a/src/common/BackTrace.h b/src/common/BackTrace.h index a7a3b6e33c751..b5d1e1d7ba415 100644 --- a/src/common/BackTrace.h +++ b/src/common/BackTrace.h @@ -23,6 +23,9 @@ struct BackTrace { free(strings); } + BackTrace(const BackTrace& other); + const BackTrace& operator=(const BackTrace& other); + void print(std::ostream& out); }; diff --git a/src/common/RWLock.h b/src/common/RWLock.h index adbd5f0019341..f8915ed288e0e 100644 --- a/src/common/RWLock.h +++ b/src/common/RWLock.h @@ -26,7 +26,9 @@ class RWLock const char *name; int id; - public: +public: + RWLock(const RWLock& other); + const RWLock& operator=(const RWLock& other); RWLock(const char *n) : name(n), id(-1) { pthread_rwlock_init(&L, NULL); diff --git a/src/common/Thread.h b/src/common/Thread.h index ec25a2a5a0162..ea094450024f1 100644 --- a/src/common/Thread.h +++ b/src/common/Thread.h @@ -23,6 +23,9 @@ class Thread { pthread_t thread_id; public: + Thread(const Thread& other); + const Thread& operator=(const Thread& other); + Thread(); virtual ~Thread(); diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index 0f9c8d19fe2f9..1b74a8e8b85ce 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -68,6 +68,9 @@ private: } public: + CrushWrapper(const CrushWrapper& other); + const CrushWrapper& operator=(const CrushWrapper& other); + CrushWrapper() : crush(0), have_rmaps(false) {} ~CrushWrapper() { if (crush) crush_destroy(crush); diff --git a/src/include/Context.h b/src/include/Context.h index 46e09bad81f82..513986964497f 100644 --- a/src/include/Context.h +++ b/src/include/Context.h @@ -31,6 +31,10 @@ */ class Context { public: + Context(const Context& other); + const Context& operator=(const Context& other); + + Context() {} virtual ~Context() {} // we want a virtual destructor!!! virtual void finish(int r) = 0; }; diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index c3b816ce26bdb..cf4229136677d 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -365,6 +365,9 @@ public: ReplicatedPG *pg; + OpContext(const OpContext& other); + const OpContext& operator=(const OpContext& other); + OpContext(Message *_op, osd_reqid_t _reqid, vector& _ops, ObjectState *_obs, ReplicatedPG *_pg) : op(_op), reqid(_reqid), ops(_ops), obs(_obs), new_obs(_obs->oi, _obs->exists), diff --git a/src/osdc/Filer.h b/src/osdc/Filer.h index 938837945f80c..63d24b850e65d 100644 --- a/src/osdc/Filer.h +++ b/src/osdc/Filer.h @@ -82,6 +82,9 @@ class Filer { void _probed(Probe *p, const object_t& oid, uint64_t size, utime_t mtime); public: + Filer(const Filer& other); + const Filer operator=(const Filer& other); + Filer(Objecter *o) : objecter(o) {} ~Filer() {} diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index ab562a54b082d..3bba91c159ae3 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -169,6 +169,9 @@ class ObjectCacher { int rdlock_ref; // how many ppl want or are using a READ lock public: + Object(const Object& other); + const Object& operator=(const Object& other); + Object(ObjectCacher *_oc, sobject_t o, ObjectSet *os, object_locator_t& l) : oc(_oc), oid(o), oset(os), set_item(this), oloc(l), -- 2.39.5