From b33fbeb4eae27f4be3d3b0c845a8e6be1dd5dd2e Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 3 Jan 2025 16:14:05 -0500 Subject: [PATCH] client: add dir_result_t::dentry::print Signed-off-by: Patrick Donnelly (cherry picked from commit 0fa4a95eadf5faf4d7ff566bc314902b48cafe85) --- src/client/Client.cc | 11 +++++++++++ src/client/Client.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index f9daa9efc34..7d3ab9f11fb 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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; diff --git a/src/client/Client.h b/src/client/Client.h index e240505c7df..2a78ad492c2 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -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 { -- 2.39.5