diff options
author | Matt Benjamin <mbenjamin@redhat.com> | 2017-02-11 22:38:05 +0100 |
---|---|---|
committer | Matt Benjamin <mbenjamin@redhat.com> | 2017-02-13 21:59:12 +0100 |
commit | 462034e17f919fb783ee33e2c9fa8089f93fd97d (patch) | |
tree | f075e7d8bcfddce721b7b7f49382b2512b035396 /src | |
parent | rgw_file: add pretty-print for RGWFileHandle (diff) | |
download | ceph-462034e17f919fb783ee33e2c9fa8089f93fd97d.tar.xz ceph-462034e17f919fb783ee33e2c9fa8089f93fd97d.zip |
rgw_file: add refcount dout traces at debuglevel 17
These are helpful for checking RGWFileHandle refcnt invariants.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/rgw/rgw_file.cc | 11 | ||||
-rw-r--r-- | src/rgw/rgw_file.h | 10 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index d7076d30528..c57b8568f0b 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -726,7 +726,7 @@ namespace rgw { const auto& fhk = rgw_fh.get_key(); const auto& fh = const_cast<RGWFileHandle&>(rgw_fh).get_fh(); os << "<RGWFileHandle:"; - os << "addr=" << &rgw_fh; + os << "addr=" << &rgw_fh << ";"; switch (fh->fh_type) { case RGW_FS_TYPE_DIRECTORY: os << "type=DIRECTORY;"; @@ -779,6 +779,9 @@ namespace rgw { } /* RGWFileHandle::decode_attrs */ bool RGWFileHandle::reclaim() { + lsubdout(fs->get_context(), rgw, 17) + << __func__ << " " << *this + << dendl; fs->fh_cache.remove(fh.fh_hk.object, this, cohort::lru::FLAG_NONE); return true; } /* RGWFileHandle::reclaim */ @@ -1408,8 +1411,12 @@ int rgw_fh_rele(struct rgw_fs *rgw_fs, struct rgw_file_handle *fh, { RGWLibFS *fs = static_cast<RGWLibFS*>(rgw_fs->fs_private); RGWFileHandle* rgw_fh = get_rgwfh(fh); - fs->unref(rgw_fh); + lsubdout(fs->get_context(), rgw, 17) + << __func__ << " " << *rgw_fh + << dendl; + + fs->unref(rgw_fh); return 0; } diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index e0f9b627410..5add75ce64c 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -892,6 +892,11 @@ namespace rgw { } lat.lock->unlock(); /* !LATCHED */ get<0>(fhr) = fh; + if (fh) { + lsubdout(get_context(), rgw, 17) + << __func__ << " 1 " << *fh + << dendl; + } return fhr; } /* lookup_fh(const fh_key&) */ @@ -974,6 +979,11 @@ namespace rgw { lat.lock->unlock(); /* !LATCHED */ out: get<0>(fhr) = fh; + if (fh) { + lsubdout(get_context(), rgw, 17) + << __func__ << " 2 " << *fh + << dendl; + } return fhr; } /* lookup_fh(RGWFileHandle*, const char *, const uint32_t) */ |