]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: add _get_root_ino() helper support
authorXiubo Li <xiubli@redhat.com>
Tue, 25 Apr 2023 02:51:08 +0000 (10:51 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 27 Mar 2024 00:42:40 +0000 (08:42 +0800)
Fixes: https://tracker.ceph.com/issues/57154
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 429aafbb18d147646e6f52e1a8af4de7a0fd68bd)

src/client/Client.cc
src/client/Client.h

index f126957334f53a88d7b41e62abdd9c7194e6c086..84c4715caf50b52e56087380e671bc4bb5304dba 100644 (file)
@@ -467,15 +467,20 @@ void Client::tear_down_cache()
   ceph_assert(inode_map.empty());
 }
 
-inodeno_t Client::get_root_ino()
+inodeno_t Client::_get_root_ino(bool fake)
 {
-  std::scoped_lock l(client_lock);
-  if (use_faked_inos())
+  if (fake && use_faked_inos())
     return root->faked_ino;
   else
     return root->ino;
 }
 
+inodeno_t Client::get_root_ino()
+{
+  std::scoped_lock l(client_lock);
+  return _get_root_ino(true);
+}
+
 Inode *Client::get_root()
 {
   std::scoped_lock l(client_lock);
index a7c6051409d4f6a303304341a5b50668bcf9f29a..ae94b3fb53632abea7785c147b4181386849f238 100644 (file)
@@ -696,6 +696,7 @@ public:
 
   client_t get_nodeid() { return whoami; }
 
+  inodeno_t _get_root_ino(bool fake=true);
   inodeno_t get_root_ino();
   Inode *get_root();