Skip to contentSkip to conversation

minix_lookup: use d_splice_alias()

RFC PATCH New Al Viro 1 participant 1 message May 13, 2018 VFS

lore
Share & tools
lore

Al Viro

author
#0 lore raw

RFC PATCH 1/1 minix_lookup: use d_splice_alias()

---
 fs/minix/namei.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
fs/minix/namei.c +2 -6
index ccf0f00030bf..1a6084d2b02e 100644
@@ -28,13 +28,9 @@ static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, un
 		return ERR_PTR(-ENAMETOOLONG);
 
 	ino = minix_inode_by_name(dentry);
-	if (ino) {
+	if (ino)
 		inode = minix_iget(dir->i_sb, ino);
-		if (IS_ERR(inode))
-			return ERR_CAST(inode);
-	}
-	d_add(dentry, inode);
-	return NULL;
+	return d_splice_alias(inode, dentry);
 }
 
 static int minix_mknod(struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev)
Signature · 1 line
2.11.0