]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: add dir_result_t::dentry::print
authorPatrick Donnelly <pdonnell@ibm.com>
Fri, 3 Jan 2025 21:14:05 +0000 (16:14 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 17 Mar 2025 19:43:20 +0000 (15:43 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
(cherry picked from commit 0fa4a95eadf5faf4d7ff566bc314902b48cafe85)

src/client/Client.cc
src/client/Client.h

index f9daa9efc34f935d5e67c3992f90e6737a420e46..7d3ab9f11fb27e7724b32373c7225d3991f6f223 100644 (file)
@@ -270,6 +270,17 @@ dir_result_t::dir_result_t(InodeRef in, const UserPerm& perms, int fd)
     perms(perms), fd(fd)
   { }
 
+void dir_result_t::dentry::print(std::ostream& os) const
+{
+  os << "dn(name=" << name << " altn=" << alternate_name;
+  if (inode) {
+    os << " ino=" << inode->ino;
+  } else {
+    os << " null";
+  }
+  os << ")";
+}
+
 void Client::_reset_faked_inos()
 {
   ino_t start = 1024;
index e240505c7df714de4a7dff40a89e904d0099b0b7..2a78ad492c2e6c28b63a6a42398122e12be6b8c8 100644 (file)
@@ -157,6 +157,7 @@ struct dir_result_t {
     explicit dentry(int64_t o) : offset(o) {}
     dentry(int64_t o, std::string n, std::string an, InodeRef in) :
       offset(o), name(std::move(n)), alternate_name(std::move(an)), inode(std::move(in)) {}
+    void print(std::ostream& os) const;
   };
   struct dentry_off_lt {
     bool operator()(const dentry& d, int64_t off) const {