]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: print lock cache during invalidation
authorPatrick Donnelly <pdonnell@redhat.com>
Sun, 3 Mar 2024 03:22:19 +0000 (22:22 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 20 Mar 2024 14:56:57 +0000 (10:56 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/Locker.cc
src/mds/Mutation.cc
src/mds/Mutation.h

index 16e138edded2894351f413c495c807d57d7ab48a..19ead4c4647d684c9d904246478f945bda155dc4 100644 (file)
@@ -895,6 +895,8 @@ public:
 
 void Locker::put_lock_cache(MDLockCache* lock_cache)
 {
+  dout(20) << __func__ << ": " << *lock_cache << dendl;
+
   ceph_assert(lock_cache->ref > 0);
   if (--lock_cache->ref > 0)
     return;
@@ -928,6 +930,8 @@ int Locker::get_cap_bit_for_lock_cache(int op)
 
 void Locker::invalidate_lock_cache(MDLockCache *lock_cache)
 {
+  dout(15) << __func__ << ": " << *lock_cache << dendl;
+
   ceph_assert(lock_cache->item_cap_lock_cache.is_on_list());
   if (lock_cache->invalidating) {
     ceph_assert(!lock_cache->client_cap);
index ecc455de08db64ce3575e3390d84d761ae93ecad..6ff87183914b89ff8eb49d77adf5b4392af04f08 100644 (file)
@@ -624,3 +624,18 @@ void MDLockCache::detach_dirfrags()
   }
   items_dir.reset();
 }
+
+void MDLockCache::print(std::ostream& out) const {
+  out << "MDLockCache(o=" << ceph_mds_op_name(opcode)
+      << " diri=" << diri->ino();
+  if (client_cap) {
+    out << " c=" << client_cap->get_client();
+  } else {
+    out << " c=(nil)";
+  }
+  out << " r=" << ref;
+  if (invalidating) {
+    out << " invalidating";
+  }
+  out << ")";
+}
index 6a11144362ec229fe339b54d914eb9ac0eede1a4..7f985651e37d9a1c09610f3c9f815881bd1bfb56 100644 (file)
@@ -538,6 +538,7 @@ struct MDLockCache : public MutationImpl {
     return dir_layout;
   }
 
+  void print(std::ostream& out) const;
   void attach_locks();
   void attach_dirfrags(std::vector<CDir*>&& dfv);
   void detach_locks();