struct inodeno_t ino,
Inode **inode)
{
- int r = (cmount->get_client())->lookup_ino(ino, cmount->default_perms, inode);
- if (r) {
- return r;
- }
-
- assert(inode != NULL);
- assert(*inode != NULL);
-
- // Request the parent inode, so that we can look up the name
- Inode *parent;
- r = (cmount->get_client())->lookup_parent(*inode, cmount->default_perms, &parent);
- if (r && r != -EINVAL) {
- // Unexpected error
- (cmount->get_client())->ll_forget(*inode, 1);
- return r;
- } else if (r == -EINVAL) {
- // EINVAL indicates node without parents (root), drop out now
- // and don't try to look up the non-existent dentry.
- return 0;
- }
- // FIXME: I don't think this works; lookup_parent() returns 0 if the parent
- // is already in cache
- assert(parent != NULL);
-
- // Finally, get the name (dentry) of the requested inode
- r = (cmount->get_client())->lookup_name(*inode, parent, cmount->default_perms);
- if (r) {
- // Unexpected error
- (cmount->get_client())->ll_forget(parent, 1);
- (cmount->get_client())->ll_forget(*inode, 1);
- return r;
- }
-
- (cmount->get_client())->ll_forget(parent, 1);
- return 0;
+ return (cmount->get_client())->ll_lookup_inode(ino, cmount->default_perms, inode);
}
extern "C" int ceph_ll_lookup(struct ceph_mount_info *cmount,