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: v12.0.1~423^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=462034e17f919fb783ee33e2c9fa8089f93fd97d;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 --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index d7076d305288..c57b8568f0b3 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(rgw_fh).get_fh(); os << "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(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 e0f9b627410c..5add75ce64c9 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) */