From 17d6a993fc17d533460c5f40f3908c708e057c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:17 +0200 Subject: Merging upstream version 18.2.3. Signed-off-by: Daniel Baumann --- src/client/Inode.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/client/Inode.cc') diff --git a/src/client/Inode.cc b/src/client/Inode.cc index 0c19bef5e..cb30d4940 100644 --- a/src/client/Inode.cc +++ b/src/client/Inode.cc @@ -119,6 +119,22 @@ void Inode::make_short_path(filepath& p) p = filepath(ino); } +/* + * make a filepath suitable for mds auth access check: + */ +bool Inode::make_path_string(std::string& s) +{ + if (client->_get_root_ino(false) == ino) { + return true; + } else if (!dentries.empty()) { + Dentry *dn = get_first_parent(); + ceph_assert(dn->dir && dn->dir->parent_inode); + return dn->make_path_string(s); + } + + return false; +} + /* * make a filepath suitable for an mds request: * - if we are non-snapped/live, the ino is sufficient, e.g. #1234 -- cgit v1.2.3