From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: review 3, was Re: projected date for mount.cifs to support DFS junction points Date: Sun, 13 Jan 2008 19:50:57 +0000 Message-ID: <20080113195057.GC23832@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]:60275 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752551AbYAMTvB (ORCPT ); Sun, 13 Jan 2008 14:51:01 -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 + /* copy mount params to sb for use in submounts */ + /* BB: should we move this after the mount so we + * do not have to do the copy on failed mounts? + * BB: May be it is better to do simple copy before + * complex operation (mount), and in case of fail + * just exit instead of doing mount and attempting + * undo it if this copy fails?*/ + len = strlen(data); + cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL); + if (cifs_sb->mountdata == NULL) { + kfree(sb->s_fs_info); + sb->s_fs_info = NULL; + return -ENOMEM; + } + strncpy(cifs_sb->mountdata, data, len + 1); + cifs_sb->mountdata[len] = '\0'; +#endif Please split the mount data handling into nice helpers that can be stubbed out for !CONFIG_CIFS_DFS_UPCALL. -static struct file_system_type cifs_fs_type = { +struct file_system_type cifs_fs_type = { This isn't actually used outside of cifsfs.c in this patch, so it should not be made non-static here.