Commit 79ac5a46 authored by Al Viro's avatar Al Viro

jfs_lookup(): don't bother with . or ..

they'll never be passed to ->lookup()
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 10d9f309
...@@ -1456,34 +1456,25 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc ...@@ -1456,34 +1456,25 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
ino_t inum; ino_t inum;
struct inode *ip; struct inode *ip;
struct component_name key; struct component_name key;
const char *name = dentry->d_name.name;
int len = dentry->d_name.len;
int rc; int rc;
jfs_info("jfs_lookup: name = %s", name); jfs_info("jfs_lookup: name = %s", dentry->d_name.name);
if ((name[0] == '.') && (len == 1)) if ((rc = get_UCSname(&key, dentry)))
inum = dip->i_ino; return ERR_PTR(rc);
else if (strcmp(name, "..") == 0) rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP);
inum = PARENT(dip); free_UCSname(&key);
else { if (rc == -ENOENT) {
if ((rc = get_UCSname(&key, dentry))) ip = NULL;
return ERR_PTR(rc); } else if (rc) {
rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP); jfs_err("jfs_lookup: dtSearch returned %d", rc);
free_UCSname(&key); ip = ERR_PTR(rc);
if (rc == -ENOENT) { } else {
d_add(dentry, NULL); ip = jfs_iget(dip->i_sb, inum);
return NULL; if (IS_ERR(ip))
} else if (rc) { jfs_err("jfs_lookup: iget failed on inum %d", (uint)inum);
jfs_err("jfs_lookup: dtSearch returned %d", rc);
return ERR_PTR(rc);
}
} }
ip = jfs_iget(dip->i_sb, inum);
if (IS_ERR(ip))
jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum);
return d_splice_alias(ip, dentry); return d_splice_alias(ip, 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