[prev in list] [next in list] [prev in thread] [next in thread]
List: v9fs-developer
Subject: [V9fs-developer] [PATCH -v3 1/3] net/9p: Add multi channel support.
From: "Aneesh Kumar K.V" <aneesh.kumar () linux ! vnet ! ibm ! com>
Date: 2010-02-15 17:39:00
Message-ID: 1266254822-823-1-git-send-email-aneesh.kumar () linux ! vnet ! ibm ! com
[Download RAW message or body]
This is needed for supporting multiple mount points.
We can find out the device names to be used with mount by checking
/sys/devices/virtio-pci/virtio*/device file
if the device file have value 9 then the specific virtio device can
be used for mounting.
ex:
#cat /sys/devices/virtio-pci/virtio1/device
9
now we can mount using
# mount -t 9p -o trans=virtio virtio1 /mnt/
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
include/linux/virtio_9p.h | 2 +-
net/9p/trans_virtio.c | 14 ++++++++------
2 files changed, 9 insertions(+), 7 deletions(-)
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 cb50f4a..df924e5 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);
--
1.7.0.14.g7e948
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
V9fs-developer mailing list
V9fs-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/v9fs-developer
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic