diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/client/Dentry.cc | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/client/Dentry.cc')
-rw-r--r-- | src/client/Dentry.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/client/Dentry.cc b/src/client/Dentry.cc new file mode 100644 index 000000000..f8741050a --- /dev/null +++ b/src/client/Dentry.cc @@ -0,0 +1,33 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#include "include/types.h" +#include "include/utime.h" + +#include "Dentry.h" +#include "Dir.h" +#include "Inode.h" + +#include "common/Formatter.h" + +void Dentry::dump(Formatter *f) const +{ + f->dump_string("name", name); + f->dump_stream("dir") << dir->parent_inode->ino; + if (inode) + f->dump_stream("ino") << inode->ino; + f->dump_int("ref", ref); + f->dump_int("offset", offset); + if (lease_mds >= 0) { + f->dump_int("lease_mds", lease_mds); + f->dump_stream("lease_ttl") << lease_ttl; + f->dump_unsigned("lease_gen", lease_gen); + f->dump_unsigned("lease_seq", lease_seq); + } + f->dump_int("cap_shared_gen", cap_shared_gen); +} + +std::ostream &operator<<(std::ostream &oss, const Dentry &dn) +{ + return oss << dn.dir->parent_inode->vino() << "[\"" << dn.name << "\"]"; +} |