]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: add refcount dout traces at debuglevel 17
authorMatt Benjamin <mbenjamin@redhat.com>
Sat, 11 Feb 2017 21:38:05 +0000 (16:38 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Mon, 13 Feb 2017 20:59:12 +0000 (15:59 -0500)
These are helpful for checking RGWFileHandle refcnt invariants.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.cc
src/rgw/rgw_file.h

index d7076d3052880db4b2b3cd4f42865b1d0c7e78ed..c57b8568f0b317d25bde08406f5be460de3e7061 100644 (file)
@@ -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;
 }
 
index e0f9b627410c4e1b05922c3f6a7356068ccedd45..5add75ce64c965f631f7bd54ca621ed17b89eeab 100644 (file)
@@ -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) */