diff mbox

[V9fs-developer,-V2,2/3] net/9p: Add multi channel support.

Message ID 1265909071-11474-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Aneesh Kumar K.V Feb. 11, 2010, 5:24 p.m. UTC
None
diff mbox

Patch

diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h
index 095e10d..7a615c3 100644
--- a/include/linux/virtio_9p.h
+++ b/include/linux/virtio_9p.h
@@ -6,6 +6,6 @@ 
 #include <linux/virtio_config.h>
 
 /* Maximum number of virtio channels per partition (1 for now) */
-#define MAX_9P_CHAN	1
+#define MAX_9P_CHAN	10
 
 #endif /* _LINUX_VIRTIO_9P_H */
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index e586bce..6a9504c 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -296,13 +296,15 @@  p9_virtio_create(struct p9_client *client, const char *devname, char *args)
 
 	mutex_lock(&virtio_9p_lock);
 	while (index < MAX_9P_CHAN) {
-		if (chan->initialized && !chan->inuse) {
-			chan->inuse = true;
-			break;
-		} else {
-			index++;
-			chan = &channels[index];
+		if (chan->initialized &&
+			!strcmp(devname, dev_name(&chan->vdev->dev))) {
+			if (!chan->inuse) {
+				chan->inuse = true;
+				break;
+			}
 		}
+		index++;
+		chan = &channels[index];
 	}
 	mutex_unlock(&virtio_9p_lock);