From: Sage Weil Date: Tue, 1 Jul 2014 22:51:30 +0000 (-0700) Subject: common/RefCountedObject: make nref, cct private X-Git-Tag: v0.84~148^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0dcf3bf47fde3365c38811d512acdb1bda7da4c;p=ceph.git common/RefCountedObject: make nref, cct private Signed-off-by: Sage Weil --- diff --git a/src/common/RefCountedObj.h b/src/common/RefCountedObj.h index 395a43687343..f9644a791cef 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; + } }; /**