]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: pretty print mutation when dumping lock
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 10 Jan 2024 19:08:11 +0000 (14:08 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 20 Mar 2024 14:56:54 +0000 (10:56 -0400)
Now looks like:

    ... (iquiesce xlock x=1 by request(mds.0:2785 nref=6)) ...

instead of:

    ... (iquiesce xlock x=1 by 0xdeadbeef)) ...

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/SimpleLock.cc
src/mds/SimpleLock.h

index 43f710ec68a50eef73a568cd0aac2831f4966167..70d277bd10c0f9750151fea059be911622e36fb2 100644 (file)
@@ -108,3 +108,29 @@ std::vector<MDLockCache*> SimpleLock::get_active_caches() {
   }
   return result;
 }
+
+void SimpleLock::_print(std::ostream& out) const
+{
+  out << get_lock_type_name(get_type()) << " ";
+  out << get_state_name(get_state());
+  if (!get_gather_set().empty())
+    out << " g=" << get_gather_set();
+  if (is_leased())
+    out << " l";
+  if (is_rdlocked())
+    out << " r=" << get_num_rdlocks();
+  if (is_wrlocked())
+    out << " w=" << get_num_wrlocks();
+  if (is_xlocked()) {
+    out << " x=" << get_num_xlocks();
+    if (auto mut = get_xlock_by(); mut) {
+      out << " by " << *mut;
+    }
+  }
+#if 0
+  if (is_stable())
+    out << " stable";
+  else
+    out << " unstable";
+#endif
+}
index d0b6578302d7720ce3a9eeaa0af118e7ecc946dd..f0fef93e1c602be4cd55a181a7c58ea42d8e63d6 100644 (file)
@@ -581,28 +581,7 @@ public:
     return false;
   }
 
-  void _print(std::ostream& out) const {
-    out << get_lock_type_name(get_type()) << " ";
-    out << get_state_name(get_state());
-    if (!get_gather_set().empty())
-      out << " g=" << get_gather_set();
-    if (is_leased())
-      out << " l";
-    if (is_rdlocked()) 
-      out << " r=" << get_num_rdlocks();
-    if (is_wrlocked()) 
-      out << " w=" << get_num_wrlocks();
-    if (is_xlocked()) {
-      out << " x=" << get_num_xlocks();
-      if (get_xlock_by())
-       out << " by " << get_xlock_by();
-    }
-    /*if (is_stable())
-      out << " stable";
-    else
-      out << " unstable";
-    */
-  }
+  void _print(std::ostream& out) const;
 
   /**
    * Write bare values (caller must be in an object section)