]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/9p/v9fs.c
Merge branch 'e1000' of ssh://198.78.49.142/srv/git/intel/linux-2.6
[linux-2.6-omap-h63xx.git] / fs / 9p / v9fs.c
index 5e0f79355fdf8ebcb19896ad3cbc304e7b71bb6a..ef338654914095fa464a7b779d6504db526ad61f 100644 (file)
@@ -37,7 +37,6 @@
 #include "v9fs_vfs.h"
 #include "transport.h"
 #include "mux.h"
-#include "conv.h"
 
 /* TODO: sysfs or debugfs interface */
 int v9fs_debug_level = 0;      /* feature-rific global debug level  */
@@ -67,7 +66,7 @@ static match_table_t tokens = {
        {Opt_afid, "afid=%u"},
        {Opt_rfdno, "rfdno=%u"},
        {Opt_wfdno, "wfdno=%u"},
-       {Opt_debug, "debug=%u"},
+       {Opt_debug, "debug=%x"},
        {Opt_name, "name=%s"},
        {Opt_remotename, "aname=%s"},
        {Opt_unix, "proto=unix"},
@@ -270,6 +269,7 @@ v9fs_session_init(struct v9fs_session_info *v9ses,
        int n = 0;
        int newfid = -1;
        int retval = -EINVAL;
+       struct v9fs_str *version;
 
        v9ses->name = __getname();
        if (!v9ses->name)
@@ -352,13 +352,16 @@ v9fs_session_init(struct v9fs_session_info *v9ses,
                        goto FreeFcall;
                }
 
-               /* Really should check for 9P1 and report error */
-               if (!strcmp(fcall->params.rversion.version, "9P2000.u")) {
+               version = &fcall->params.rversion.version;
+               if (version->len==8 && !memcmp(version->str, "9P2000.u", 8)) {
                        dprintk(DEBUG_9P, "9P2000 UNIX extensions enabled\n");
                        v9ses->extended = 1;
-               } else {
+               } else if (version->len==6 && !memcmp(version->str, "9P2000", 6)) {
                        dprintk(DEBUG_9P, "9P2000 legacy mode enabled\n");
                        v9ses->extended = 0;
+               } else {
+                       retval = -EREMOTEIO;
+                       goto FreeFcall;
                }
 
                n = fcall->params.rversion.msize;
@@ -450,12 +453,17 @@ extern int v9fs_error_init(void);
 
 static int __init init_v9fs(void)
 {
+       int ret;
+
        v9fs_error_init();
 
        printk(KERN_INFO "Installing v9fs 9P2000 file system support\n");
 
-       v9fs_mux_global_init();
-       return register_filesystem(&v9fs_fs_type);
+       ret = v9fs_mux_global_init();
+       if (!ret)
+               ret = register_filesystem(&v9fs_fs_type);
+
+       return ret;
 }
 
 /**