diff mbox

[V9fs-developer,4/4,V2] 9P2010.L handshake: .L protocol negotiation

Message ID 20100305221621.72331153@in.ibm.com (mailing list archive)
State Rejected
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

Sripathi Kodi March 5, 2010, 4:46 p.m. UTC
None
diff mbox

Patch

diff --git a/net/9p/client.c b/net/9p/client.c
index 586d410..8fb7b78 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -669,8 +669,25 @@  int p9_client_version(struct p9_client *c)
 
 	P9_DPRINTK(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
 						c->msize, c->proto_version);
-	req = p9_client_rpc(c, P9_TVERSION, "ds", c->msize,
-				p9_is_proto_dotu(c) ? "9P2000.u" : "9P2000");
+
+	switch (c->proto_version) {
+		case p9_proto_2010L:
+			req = p9_client_rpc(c, P9_TVERSION, "ds",
+						c->msize, "9P2010.L");
+			break;
+		case p9_proto_2000u:
+			req = p9_client_rpc(c, P9_TVERSION, "ds",
+						c->msize, "9P2000.u");
+			break;
+		case p9_proto_legacy:
+			req = p9_client_rpc(c, P9_TVERSION, "ds",
+						c->msize, "9P2000");
+			break;
+		default:
+			return -EINVAL;
+			break;
+	}
+
 	if (IS_ERR(req))
 		return PTR_ERR(req);
 
@@ -682,7 +699,9 @@  int p9_client_version(struct p9_client *c)
 	}
 
 	P9_DPRINTK(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version);
-	if (! strncmp(version, "9P2000.u", 8))
+	if (! strncmp(version, "9P2010.L", 8))
+		c->proto_version = p9_proto_2010L;
+	else if (! strncmp(version, "9P2000.u", 8))
 		c->proto_version = p9_proto_2000u;
 	else if (! strncmp(version, "9P2000", 6))
 		c->proto_version = p9_proto_legacy;