From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: review 5, was Re: projected date for mount.cifs to support DFS junction points Date: Sun, 13 Jan 2008 20:21:44 +0000 Message-ID: <20080113202144.GB24573@infradead.org> References: <1199988975.7483.3.camel@gn2.draper.com> <524f69650801101228o3639363cp4c9710d747b71ead@mail.gmail.com> <20080111090749.GA14910@infradead.org> <524f69650801110805y56cdbe4nf7587e396b70f32c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-cifs-client@lists.samba.org, sfrench@us.ibm.com, linux-fsdevel To: Steve French Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:43682 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753338AbYAMUVr (ORCPT ); Sun, 13 Jan 2008 15:21:47 -0500 Content-Disposition: inline In-Reply-To: <524f69650801110805y56cdbe4nf7587e396b70f32c@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: +#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.