[linux-cifs-client] review 5, was Re: projected date for mount.cifs to support DFS junction points

Christoph Hellwig hch at infradead.org
Sun Jan 13 20:21:44 GMT 2008


+#ifdef CONFIG_CIFS_DFS_UPCALL
+			if (is_remote) {
+				inode->i_op =
+					&cifs_dfs_referral_inode_operations;
+				inode->i_fop = NULL;

i_fop should never be set to NULL.  Just leave it alone so it stays
at &empty_fops.

+#ifdef CONFIG_CIFS_DFS_UPCALL
+			if (is_remote) {
+				inode->i_op =
+					&cifs_dfs_referral_inode_operations;
+				inode->i_fop = NULL;
+			} else {
+				inode->i_op = &cifs_dir_inode_ops;
+				inode->i_fop = &cifs_dir_ops;
+			}
+#else
 			inode->i_op = &cifs_dir_inode_ops;
 			inode->i_fop = &cifs_dir_ops;
+#endif

This code and everything surrounding it is duplicated in two functions.
Please refactor it into a common helper before adding new code to it.



More information about the linux-cifs-client mailing list