patch-1.3.73 linux/fs/nfs/dir.c

Next file: linux/fs/nfs/inode.c
Previous file: linux/fs/ncpfs/sock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.72/linux/fs/nfs/dir.c linux/fs/nfs/dir.c
@@ -612,7 +612,7 @@
 		printk("nfs_refresh_inode: inode number mismatch\n");
 		return;
 	}
-	was_empty = inode->i_mode == 0;
+	was_empty = (inode->i_mode == 0);
 	inode->i_mode = fattr->mode;
 	inode->i_nlink = fattr->nlink;
 	inode->i_uid = fattr->uid;
@@ -631,22 +631,21 @@
 	inode->i_atime = fattr->atime.seconds;
 	inode->i_mtime = fattr->mtime.seconds;
 	inode->i_ctime = fattr->ctime.seconds;
-	if (was_empty) {
-		if (S_ISREG(inode->i_mode))
-			inode->i_op = &nfs_file_inode_operations;
-		else if (S_ISDIR(inode->i_mode))
-			inode->i_op = &nfs_dir_inode_operations;
-		else if (S_ISLNK(inode->i_mode))
-			inode->i_op = &nfs_symlink_inode_operations;
-		else if (S_ISCHR(inode->i_mode))
-			inode->i_op = &chrdev_inode_operations;
-		else if (S_ISBLK(inode->i_mode))
-			inode->i_op = &blkdev_inode_operations;
-		else if (S_ISFIFO(inode->i_mode))
+	if (S_ISREG(inode->i_mode))
+		inode->i_op = &nfs_file_inode_operations;
+	else if (S_ISDIR(inode->i_mode))
+		inode->i_op = &nfs_dir_inode_operations;
+	else if (S_ISLNK(inode->i_mode))
+		inode->i_op = &nfs_symlink_inode_operations;
+	else if (S_ISCHR(inode->i_mode))
+		inode->i_op = &chrdev_inode_operations;
+	else if (S_ISBLK(inode->i_mode))
+		inode->i_op = &blkdev_inode_operations;
+	else if (S_ISFIFO(inode->i_mode)) {
+		if (was_empty)
 			init_fifo(inode);
-		else
-			inode->i_op = NULL;
-	}
+	} else
+		inode->i_op = NULL;
 	nfs_lookup_cache_refresh(inode, fattr);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this