aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/virtio_9p.h2
-rw-r--r--net/9p/trans_virtio.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h
index 095e10d148b4..7a615c3f5e3d 100644
--- a/include/linux/virtio_9p.h
+++ b/include/linux/virtio_9p.h
@@ -6,6 +6,6 @@
6#include <linux/virtio_config.h> 6#include <linux/virtio_config.h>
7 7
8/* Maximum number of virtio channels per partition (1 for now) */ 8/* Maximum number of virtio channels per partition (1 for now) */
9#define MAX_9P_CHAN 1 9#define MAX_9P_CHAN 10
10 10
11#endif /* _LINUX_VIRTIO_9P_H */ 11#endif /* _LINUX_VIRTIO_9P_H */
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index cb50f4ae5eef..df924e5657d3 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)
296 296
297 mutex_lock(&virtio_9p_lock); 297 mutex_lock(&virtio_9p_lock);
298 while (index < MAX_9P_CHAN) { 298 while (index < MAX_9P_CHAN) {
299 if (chan->initialized && !chan->inuse) { 299 if (chan->initialized &&
300 chan->inuse = true; 300 !strcmp(devname, dev_name(&chan->vdev->dev))) {
301 break; 301 if (!chan->inuse) {
302 } else { 302 chan->inuse = true;
303 index++; 303 break;
304 chan = &channels[index]; 304 }
305 } 305 }
306 index++;
307 chan = &channels[index];
306 } 308 }
307 mutex_unlock(&virtio_9p_lock); 309 mutex_unlock(&virtio_9p_lock);
308 310