Subject: [PATCH 2.6.4rc2mm1] nfsroot parser

Hi,

Here's a patch against 2.6.4rc2mm1.

-Nfs root standard parser
-Enum activated :)

PS : This time it compiles :)

Regards,
Fabian


--
+++ NEU bei GMX und erstmalig in Deutschland: T?V-gepr?fter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


Attachments:
nfs_parse2.diff (6.87 kB)

2004-03-10 17:16:36

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [PATCH 2.6.4rc2mm1] nfsroot parser

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

Subject: Re: [PATCH 2.6.4rc2mm1] nfsroot parser

Randy,

Here's nfs standard parser with some corrections.Is it ok for you ?

Regards,
Fabian

--
+++ NEU bei GMX und erstmalig in Deutschland: T?V-gepr?fter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz


Attachments:
nfs_parse.diff (6.30 kB)

2004-03-10 18:45:19

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [PATCH 2.6.4rc2mm1] nfsroot parser

On Wed, 10 Mar 2004 19:23:12 +0100 (MET) Fabian LoneStar Fr?d?rick wrote:

| Randy,
|
| Here's nfs standard parser with some corrections.Is it ok for you ?

Yes, thanks.

--
~Randy