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

Christoph Hellwig hch at infradead.org
Sun Jan 13 19:50:57 GMT 2008


+#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.



More information about the linux-cifs-client mailing list