jfs_lookup(): don't bother with . or ..
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 17 Jul 2011 14:17:46 +0000 (10:17 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Jul 2011 00:48:01 +0000 (20:48 -0400)
they'll never be passed to ->lookup()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/jfs/namei.c

index 247331551992bec8b1876f3c745f66e0c0dd0e7b..03787ef6a11826523abaa38fcfce77f57c8c199d 100644 (file)
@@ -1456,34 +1456,25 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
        ino_t inum;
        struct inode *ip;
        struct component_name key;
-       const char *name = dentry->d_name.name;
-       int len = dentry->d_name.len;
        int rc;
 
-       jfs_info("jfs_lookup: name = %s", name);
-
-       if ((name[0] == '.') && (len == 1))
-               inum = dip->i_ino;
-       else if (strcmp(name, "..") == 0)
-               inum = PARENT(dip);
-       else {
-               if ((rc = get_UCSname(&key, dentry)))
-                       return ERR_PTR(rc);
-               rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP);
-               free_UCSname(&key);
-               if (rc == -ENOENT) {
-                       d_add(dentry, NULL);
-                       return NULL;
-               } else if (rc) {
-                       jfs_err("jfs_lookup: dtSearch returned %d", rc);
-                       return ERR_PTR(rc);
-               }
+       jfs_info("jfs_lookup: name = %s", dentry->d_name.name);
+
+       if ((rc = get_UCSname(&key, dentry)))
+               return ERR_PTR(rc);
+       rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP);
+       free_UCSname(&key);
+       if (rc == -ENOENT) {
+               ip = NULL;
+       } else if (rc) {
+               jfs_err("jfs_lookup: dtSearch returned %d", rc);
+               ip = ERR_PTR(rc);
+       } else {
+               ip = jfs_iget(dip->i_sb, inum);
+               if (IS_ERR(ip))
+                       jfs_err("jfs_lookup: iget failed on inum %d", (uint)inum);
        }
 
-       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);
 }