Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / fs / nfs / nfsroot.c
index a561819..2d18b43 100644 (file)
@@ -69,7 +69,6 @@
  *     Fabian Frederick:       Option parser rebuilt (using parser lib)
 */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -87,6 +86,7 @@
 #include <linux/root_dev.h>
 #include <net/ipconfig.h>
 #include <linux/parser.h>
+#include <linux/vs_cvirt.h>
 
 /* Define this to allow debugging output */
 #undef NFSROOT_DEBUG
@@ -124,7 +124,7 @@ enum {
        Opt_soft, Opt_hard, Opt_intr,
        Opt_nointr, Opt_posix, Opt_noposix, Opt_cto, Opt_nocto, Opt_ac, 
        Opt_noac, Opt_lock, Opt_nolock, Opt_v2, Opt_v3, Opt_udp, Opt_tcp,
-       Opt_broken_suid,
+       Opt_acl, Opt_noacl, Opt_tagxid,
        /* Error token */
        Opt_err
 };
@@ -159,7 +159,9 @@ static match_table_t __initdata tokens = {
        {Opt_udp, "udp"},
        {Opt_tcp, "proto=tcp"},
        {Opt_tcp, "tcp"},
-       {Opt_broken_suid, "broken_suid"},
+       {Opt_acl, "acl"},
+       {Opt_noacl, "noacl"},
+       {Opt_tagxid, "tagxid"},
        {Opt_err, NULL}
        
 };
@@ -268,10 +270,20 @@ static int __init root_nfs_parse(char *name, char *buf)
                        case Opt_tcp:
                                nfs_data.flags |= NFS_MOUNT_TCP;
                                break;
-                       case Opt_broken_suid:
-                               nfs_data.flags |= NFS_MOUNT_BROKEN_SUID;
+                       case Opt_acl:
+                               nfs_data.flags &= ~NFS_MOUNT_NOACL;
                                break;
-                       default : 
+                       case Opt_noacl:
+                               nfs_data.flags |= NFS_MOUNT_NOACL;
+                               break;
+#ifndef CONFIG_INOXID_NONE
+                       case Opt_tagxid:
+                               nfs_data.flags |= NFS_MOUNT_TAGXID;
+                               break;
+#endif
+                       default:
+                               printk(KERN_WARNING "Root-NFS: unknown "
+                                       "option: %s\n", p);
                                return 0;
                }
        }
@@ -292,8 +304,8 @@ static int __init root_nfs_name(char *name)
        nfs_port          = -1;
        nfs_data.version  = NFS_MOUNT_VERSION;
        nfs_data.flags    = NFS_MOUNT_NONLM;    /* No lockd in nfs root yet */
-       nfs_data.rsize    = NFS_DEF_FILE_IO_BUFFER_SIZE;
-       nfs_data.wsize    = NFS_DEF_FILE_IO_BUFFER_SIZE;
+       nfs_data.rsize    = NFS_DEF_FILE_IO_SIZE;
+       nfs_data.wsize    = NFS_DEF_FILE_IO_SIZE;
        nfs_data.acregmin = 3;
        nfs_data.acregmax = 60;
        nfs_data.acdirmin = 30;
@@ -351,7 +363,7 @@ static void __init root_nfs_print(void)
 #endif
 
 
-int __init root_nfs_init(void)
+static int __init root_nfs_init(void)
 {
 #ifdef NFSROOT_DEBUG
        nfs_debug |= NFSDBG_ROOT;
@@ -379,15 +391,15 @@ int __init root_nfs_init(void)
  *  Parse NFS server and directory information passed on the kernel
  *  command line.
  */
-int __init nfs_root_setup(char *line)
+static int __init nfs_root_setup(char *line)
 {
        ROOT_DEV = Root_NFS;
        if (line[0] == '/' || line[0] == ',' || (line[0] >= '0' && line[0] <= '9')) {
                strlcpy(nfs_root_name, line, sizeof(nfs_root_name));
        } else {
-               int n = strlen(line) + strlen(NFS_ROOT);
+               int n = strlen(line) + sizeof(NFS_ROOT) - 1;
                if (n >= sizeof(nfs_root_name))
-                       line[sizeof(nfs_root_name) - strlen(NFS_ROOT) - 1] = '\0';
+                       line[sizeof(nfs_root_name) - sizeof(NFS_ROOT) - 2] = '\0';
                sprintf(nfs_root_name, NFS_ROOT, line);
        }
        root_server_addr = root_nfs_parse_addr(nfs_root_name);
@@ -459,10 +471,11 @@ static int __init root_nfs_ports(void)
                                        "number from server, using default\n");
                        port = nfsd_port;
                }
-               nfs_port = htons(port);
+               nfs_port = port;
                dprintk("Root-NFS: Portmapper on server returned %d "
                        "as nfsd port\n", port);
        }
+       nfs_port = htons(nfs_port);
 
        if ((port = root_nfs_getport(NFS_MNT_PROGRAM, mountd_ver, proto)) < 0) {
                printk(KERN_ERR "Root-NFS: Unable to get mountd port "