Skip to contentSkip to conversation

vfs: delete surplus inode NULL check

PATCH New Alan Cox 1 participant 1 message Sep 19, 2012 VFS

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 vfs: delete surplus inode NULL check

From: Alan Cox <[email protected]>

Each iteration of d_delete we reload inode from dentry->d_inode and then call S_ISDIR(inode-i_mode), so inode cannot possibly be NULL shortly afterwards unless something went horribly wrong.

---

 fs/dcache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dcache.c +1 -1
index 9b467d9..7a18480 100644
@@ -2109,7 +2109,7 @@ again:
 	inode = dentry->d_inode;
 	isdir = S_ISDIR(inode->i_mode);
 	if (dentry->d_count == 1) {
-		if (inode && !spin_trylock(&inode->i_lock)) {
+		if (!spin_trylock(&inode->i_lock)) {
 			spin_unlock(&dentry->d_lock);
 			cpu_relax();
 			goto again;