/** * vxfs_lookup - lookup pathname component * @dip: dir in which we lookup * @dp: dentry we lookup * @flags: lookup flags * * Description: * vxfs_lookup tries to lookup the pathname component described * by @dp in @dip. * * Returns: * A NULL-pointer on success, else a negative error code encoded * in the return pointer. */ static struct dentry * vxfs_lookup(struct inode *dip, struct dentry *dp, unsigned int flags) { struct inode *ip = NULL; ino_t ino; if (dp->d_name.len > VXFS_NAMELEN) return ERR_PTR(-ENAMETOOLONG); ino = vxfs_inode_by_name(dip, dp); if (ino) { ip = vxfs_iget(dip->i_sb, ino); if (IS_ERR(ip)) return ERR_CAST(ip); } d_add(dp, ip); return NULL; }
/** * vxfs_lookup - lookup pathname component * @dip: dir in which we lookup * @dp: dentry we lookup * * Description: * vxfs_lookup tries to lookup the pathname component described * by @dp in @dip. * * Returns: * A NULL-pointer on success, else an negative error code encoded * in the return pointer. */ static struct dentry * vxfs_lookup(struct inode *dip, struct dentry *dp) { struct inode *ip = NULL; ino_t ino; if (dp->d_name.len > VXFS_NAMELEN) return ERR_PTR(-ENAMETOOLONG); ino = vxfs_inode_by_name(dip, dp); if (ino == 0) return NULL; ip = iget(dip->i_sb, ino); if (!ip) return ERR_PTR(-EACCES); d_add(dp, ip); return NULL; }
/** * vxfs_lookup - lookup pathname component * @dip: dir in which we lookup * @dp: dentry we lookup * @nd: lookup nameidata * * Description: * vxfs_lookup tries to lookup the pathname component described * by @dp in @dip. * * Returns: * A NULL-pointer on success, else an negative error code encoded * in the return pointer. */ static struct dentry * vxfs_lookup(struct inode *dip, struct dentry *dp, struct nameidata *nd) { struct inode *ip = NULL; ino_t ino; if (dp->d_name.len > VXFS_NAMELEN) return ERR_PTR(-ENAMETOOLONG); lock_kernel(); ino = vxfs_inode_by_name(dip, dp); if (ino) { ip = vxfs_iget(dip->i_sb, ino); if (IS_ERR(ip)) { unlock_kernel(); return ERR_CAST(ip); } } unlock_kernel(); d_add(dp, ip); return NULL; }