From: Xiubo Li Date: Tue, 25 Apr 2023 02:51:08 +0000 (+0800) Subject: client: add _get_root_ino() helper support X-Git-Tag: v18.2.4~114^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef135de41e64cd2a230dc19ca9d0b37a5f622821;p=ceph.git client: add _get_root_ino() helper support Fixes: https://tracker.ceph.com/issues/57154 Signed-off-by: Xiubo Li (cherry picked from commit 429aafbb18d147646e6f52e1a8af4de7a0fd68bd) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index f126957334f..84c4715caf5 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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); diff --git a/src/client/Client.h b/src/client/Client.h index a7c6051409d..ae94b3fb536 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -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();