]>
git.proxmox.com Git - ceph.git/blob - ceph/src/common/RefCountedObj.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #include "include/ceph_assert.h"
6 #include "common/RefCountedObj.h"
7 #include "common/ceph_context.h"
8 #include "common/dout.h"
9 #include "common/valgrind.h"
11 namespace TOPNSPC::common
{
12 RefCountedObject::~RefCountedObject()
14 ceph_assert(nref
== 0);
17 void RefCountedObject::put() const {
18 CephContext
*local_cct
= cct
;
21 lsubdout(local_cct
, refs
, 1) << "RefCountedObject::put " << this << " "
22 << (v
+ 1) << " -> " << v
26 ANNOTATE_HAPPENS_AFTER(&nref
);
27 ANNOTATE_HAPPENS_BEFORE_FORGET_ALL(&nref
);
30 ANNOTATE_HAPPENS_BEFORE(&nref
);
34 void RefCountedObject::_get() const {
36 ceph_assert(v
> 1); /* it should never happen that _get() sees nref == 0 */
38 lsubdout(cct
, refs
, 1) << "RefCountedObject::get " << this << " "
39 << (v
- 1) << " -> " << v
<< dendl
;