From: Matt Benjamin Date: Sat, 11 Feb 2017 21:38:05 +0000 (-0500) Subject: rgw_file: add refcount dout traces at debuglevel 17 X-Git-Tag: v11.2.1~16^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=99941105a982f77513c8df576176f4a707daf26a;p=ceph.git rgw_file: add refcount dout traces at debuglevel 17 These are helpful for checking RGWFileHandle refcnt invariants. Signed-off-by: Matt Benjamin (cherry picked from commit 462034e17f919fb783ee33e2c9fa8089f93fd97d) --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index 505c0d92176..6b86a32b020 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -748,7 +748,7 @@ namespace rgw { const auto& fhk = rgw_fh.get_key(); const auto& fh = const_cast(rgw_fh).get_fh(); os << "fh_type) { case RGW_FS_TYPE_DIRECTORY: os << "type=DIRECTORY;"; @@ -801,6 +801,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 */ @@ -1453,8 +1456,12 @@ int rgw_fh_rele(struct rgw_fs *rgw_fs, struct rgw_file_handle *fh, { RGWLibFS *fs = static_cast(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 6c4349950d4..0647e2dd0df 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -888,6 +888,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&) */ @@ -970,6 +975,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) */