Re: [PATCH 2.6.4rc2mm1] nfsroot parser
From: Randy.Dunlap
Date: Wed Mar 10 2004 - 12:18:06 EST
On Wed, 10 Mar 2004 11:53:38 +0100 (MET) Fabian LoneStar Frédérick wrote:
| Hi,
|
| Here's a patch against 2.6.4rc2mm1.
|
| -Nfs root standard parser
| -Enum activated :)
|
| PS : This time it compiles :)
diff -Naur orig/fs/nfs/nfsroot.c edited/fs/nfs/nfsroot.c
--- orig/fs/nfs/nfsroot.c 2004-03-10 10:54:23.000000000 +0100
+++ edited/fs/nfs/nfsroot.c 2004-03-10 11:43:05.000000000 +0100
-static void __init root_nfs_parse(char *name, char *buf)
+
+static int __init root_nfs_parse(char *name, char *buf)
{
+ char *p;
+ substring_t args[MAX_OPT_ARGS];
+ int option;
+
+ if (!name)
+ return 1;
+
+ if (name[0] && strcmp(name, "default")){
+ strlcpy(buf, name, NFS_MAXPATHLEN);
+ return 1;
+ }
+ while ((p = strsep (&name, ",")) != NULL) {
+ int token;
+ if (!*p)
+ continue;
+ token = match_token(p, tokens, args);
+
+ /* %u tokens only */
+ if (match_int(&args[0], &option))
+ return 0;
+ switch (token) {
...
What?? "soft" just needs to set NFS_MOUNT_SOFT, "hard" needs to clear
(reset) it.
That "... |= 0" is useless.
Similar for other options that are "opposites" of each other.
So typically each case below is:
set_or_reset_a_value;
break;
And please s/ ;/;/ on those line endings.
+ case Opt_soft:
+ nfs_data.flags &= ~NFS_MOUNT_SOFT;
+ nfs_data.flags |= NFS_MOUNT_SOFT;
+ break;
+ case Opt_hard:
+ nfs_data.flags &= ~NFS_MOUNT_SOFT ;
+ nfs_data.flags |= 0 ;
+ break;
+ case Opt_intr:
+ nfs_data.flags &= ~NFS_MOUNT_INTR;
+ nfs_data.flags |= NFS_MOUNT_INTR;
+ break;
+ case Opt_nointr:
+ nfs_data.flags &= ~NFS_MOUNT_INTR;
+ nfs_data.flags |= 0;
+ break;
+ case Opt_posix:
+ nfs_data.flags &= ~NFS_MOUNT_POSIX;
+ nfs_data.flags |= NFS_MOUNT_POSIX;
+ break;
+ case Opt_noposix:
+ nfs_data.flags &= ~NFS_MOUNT_POSIX;
+ nfs_data.flags |= 0;
+ break;
+ case Opt_cto:
+ nfs_data.flags &= ~NFS_MOUNT_NOCTO;
+ nfs_data.flags |= 0;
+ break;
+ case Opt_nocto:
+ nfs_data.flags &= ~NFS_MOUNT_NOCTO;
+ nfs_data.flags |= NFS_MOUNT_NOCTO;
+ break;
+ case Opt_ac:
+ nfs_data.flags &= ~NFS_MOUNT_NOAC;
+ nfs_data.flags |= 0;
+ break;
+ case Opt_noac:
+ nfs_data.flags &= ~NFS_MOUNT_NOAC;
+ nfs_data.flags |= NFS_MOUNT_NOAC;
+ break;
+ case Opt_lock:
+ nfs_data.flags &= ~NFS_MOUNT_NONLM;
+ nfs_data.flags |= 0;
+ break;
+ case Opt_nolock:
+ nfs_data.flags &= ~NFS_MOUNT_NONLM;
+ nfs_data.flags |= NFS_MOUNT_NONLM;
+ break;
+ case Opt_v2:
+ nfs_data.flags &= ~NFS_MOUNT_VER3;
+ nfs_data.flags |= 0;
+ break;
+ case Opt_v3:
+ nfs_data.flags &= ~NFS_MOUNT_VER3;
+ nfs_data.flags |= NFS_MOUNT_VER3;
+ break;
+ case Opt_udp:
+ nfs_data.flags &= ~NFS_MOUNT_TCP;
+ nfs_data.flags |= 0;
+ break;
+ case Opt_tcp:
+ nfs_data.flags &= ~NFS_MOUNT_TCP;
+ nfs_data.flags |= NFS_MOUNT_TCP;
+ break;
+ case Opt_broken_suid:
+ nfs_data.flags &= ~NFS_MOUNT_BROKEN_SUID;
+ nfs_data.flags |= NFS_MOUNT_BROKEN_SUID;
+ break;
+ default :
+ return 0;
}
}
--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/