Commit 0916a5e4 authored by Al Viro's avatar Al Viro

hppfs_lookup(): don't open-code lookup_one_len()

... and it's getting it wrong, too - missing ->d_revalidate() calls when
it's dealing with filesystem (procfs) that has non-trivial ->d_revalidate()...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3cc0658e
...@@ -139,7 +139,8 @@ static int file_removed(struct dentry *dentry, const char *file) ...@@ -139,7 +139,8 @@ static int file_removed(struct dentry *dentry, const char *file)
static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
{ {
struct dentry *proc_dentry, *new, *parent; struct dentry *proc_dentry, *parent;
struct qstr *name = &dentry->d_name;
struct inode *inode; struct inode *inode;
int err, deleted; int err, deleted;
...@@ -149,23 +150,9 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, ...@@ -149,23 +150,9 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
else if (deleted) else if (deleted)
return ERR_PTR(-ENOENT); return ERR_PTR(-ENOENT);
err = -ENOMEM;
parent = HPPFS_I(ino)->proc_dentry; parent = HPPFS_I(ino)->proc_dentry;
mutex_lock(&parent->d_inode->i_mutex); mutex_lock(&parent->d_inode->i_mutex);
proc_dentry = d_lookup(parent, &dentry->d_name); proc_dentry = lookup_one_len(name->name, parent, name->len);
if (proc_dentry == NULL) {
proc_dentry = d_alloc(parent, &dentry->d_name);
if (proc_dentry == NULL) {
mutex_unlock(&parent->d_inode->i_mutex);
goto out;
}
new = (*parent->d_inode->i_op->lookup)(parent->d_inode,
proc_dentry, NULL);
if (new) {
dput(proc_dentry);
proc_dentry = new;
}
}
mutex_unlock(&parent->d_inode->i_mutex); mutex_unlock(&parent->d_inode->i_mutex);
if (IS_ERR(proc_dentry)) if (IS_ERR(proc_dentry))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment