]> 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)
committerNathan Cutler <ncutler@suse.com>
Tue, 4 Jul 2017 07:15:41 +0000 (09:15 +0200)
These are helpful for checking RGWFileHandle refcnt invariants.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 462034e17f919fb783ee33e2c9fa8089f93fd97d)

src/rgw/rgw_file.cc
src/rgw/rgw_file.h

index 505c0d921765ea03b394e5323aa45683e4faa72a..6b86a32b020cfb878cecda898237e14701fd8488 100644 (file)
@@ -748,7 +748,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;";
@@ -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<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 6c4349950d45bbe5bcd125606328eac6667af3e4..0647e2dd0df24cb56bfa94049d864fce82c4936f 100644 (file)
@@ -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) */