Parcourir la source

[PATCH] ext2: remove d_splice_alias NULL check from ext2_lookup

Remove redundant NULL check in ext2_lookup() as d_splice_alias() can take NULL
inode as input.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Pekka Enberg il y a 19 ans
Parent
commit
082a05c6f0
1 fichiers modifiés avec 1 ajouts et 4 suppressions
  1. 1 4
      fs/ext2/namei.c

+ 1 - 4
fs/ext2/namei.c

@@ -83,10 +83,7 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, str
 		if (!inode)
 			return ERR_PTR(-EACCES);
 	}
-	if (inode)
-		return d_splice_alias(inode, dentry);
-	d_add(dentry, inode);
-	return NULL;
+	return d_splice_alias(inode, dentry);
 }
 
 struct dentry *ext2_get_parent(struct dentry *child)