From c0dcf3bf47fde3365c38811d512acdb1bda7da4c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Jul 2014 15:51:30 -0700 Subject: [PATCH] common/RefCountedObject: make nref, cct private Signed-off-by: Sage Weil --- src/common/RefCountedObj.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/RefCountedObj.h b/src/common/RefCountedObj.h index 395a43687343b..f9644a791cefd 100644 --- a/src/common/RefCountedObj.h +++ b/src/common/RefCountedObj.h @@ -21,8 +21,10 @@ #include "common/ceph_context.h" struct RefCountedObject { +private: atomic_t nref; CephContext *cct; +public: RefCountedObject(CephContext *c = NULL, int n=1) : nref(n), cct(c) {} virtual ~RefCountedObject() { assert(nref.read() == 0); @@ -45,6 +47,9 @@ struct RefCountedObject { if (v == 0) delete this; } + void set_cct(CephContext *c) { + cct = c; + } }; /** -- 2.39.5