From befbb45bbadfccfedcfa15944e994260f2732320 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 14 May 2024 22:09:44 -0400 Subject: [PATCH] mds: dump alternate_name to formatter Signed-off-by: Patrick Donnelly (cherry picked from commit a66e80a3cf97359b63abac86a8229ddfa8decf79) --- src/mds/CDentry.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mds/CDentry.cc b/src/mds/CDentry.cc index 9caa7ca92eb44..b9a232798d880 100644 --- a/src/mds/CDentry.cc +++ b/src/mds/CDentry.cc @@ -600,6 +600,15 @@ void CDentry::dump(Formatter *f) const make_path(path); f->dump_string("path", path.get_path()); + if (auto s = get_alternate_name(); !s.empty()) { + bufferlist bl, b64; + bl.append(s); + bl.encode_base64(b64); + auto encoded = std::string_view(b64.c_str(), b64.length()); + f->dump_string("alternate_name", encoded); + } else { + f->dump_string("alternate_name", ""); + } f->dump_unsigned("path_ino", path.get_ino().val); f->dump_unsigned("snap_first", first); f->dump_unsigned("snap_last", last); -- 2.39.5