]> git-server-git.apps.pok.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>
Thu, 27 Feb 2025 18:41:57 +0000 (13:41 -0500)
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/client/Client.cc
src/client/Client.h

index ad19eccdf237890036f74c718196b8deb6194add..b33b13d40fd6e8d91950881242c2bd521d2ece3d 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 c4618ee10457103c3bd667b94cc09a9af23ac899..9017ee780c8294968510bb2527e1264ffb5762be 100644 (file)
@@ -160,6 +160,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 {