From: Jeff Layton Date: Wed, 3 Feb 2021 13:12:41 +0000 (-0500) Subject: client: stop doing unnecessary work in ll_lookup_inode X-Git-Tag: v15.2.14~86^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aabf6b05820e4175978c868cb5452a774097444a;p=ceph.git client: stop doing unnecessary work in ll_lookup_inode It's not clear to me why we're looking up the parent and name of the inode in ll_lookup_inode, as we don't actually do anything with them. Just return once we get an inode reference. Signed-off-by: Jeff Layton (cherry picked from commit 2b0b895e888c0f3dece3c1e717ca6e1552e588d8) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index c6d5b0c5585..04f3a3d0547 100755 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -10909,43 +10909,7 @@ int Client::ll_lookup_inode( return -ENOTCONN; // Num1: get inode and *inode - int r = _lookup_ino(ino, perms, inode); - if (r) - return r; - - ceph_assert(*inode != NULL); - - if (!(*inode)->dentries.empty()) { - ldout(cct, 8) << __func__ << " dentry already present" << dendl; - return 0; - } - - if ((*inode)->is_root()) { - ldout(cct, 8) << "ino is root, no parent" << dendl; - return 0; - } - - // Num2: Request the parent inode, so that we can look up the name - Inode *parent; - r = _lookup_parent(*inode, perms, &parent); - if (r) { - _ll_forget(*inode, 1); - return r; - } - - ceph_assert(parent != NULL); - - // Num3: Finally, get the name (dentry) of the requested inode - r = _lookup_name(*inode, parent, perms); - if (r) { - // Unexpected error - _ll_forget(parent, 1); - _ll_forget(*inode, 1); - return r; - } - - _ll_forget(parent, 1); - return 0; + return _lookup_ino(ino, perms, inode); } int Client::ll_lookupx(Inode *parent, const char *name, Inode **out,