From patchwork Mon Feb 15 17:27:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 79430 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1FHRUHM005489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 15 Feb 2010 17:28:06 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nh4j6-0004Z8-Qn; Mon, 15 Feb 2010 17:27:16 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nh4j5-0004Yv-Bo for v9fs-developer@lists.sourceforge.net; Mon, 15 Feb 2010 17:27:15 +0000 X-ACL-Warn: Received: from e28smtp07.in.ibm.com ([122.248.162.7]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1Nh4j3-0006Qt-S3 for v9fs-developer@lists.sourceforge.net; Mon, 15 Feb 2010 17:27:15 +0000 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp07.in.ibm.com (8.14.3/8.13.1) with ESMTP id o1FHR5RX011369 for ; Mon, 15 Feb 2010 22:57:05 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o1FHR5ex299070 for ; Mon, 15 Feb 2010 22:57:05 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o1FHR5qE028366 for ; Mon, 15 Feb 2010 22:57:05 +0530 Received: from localhost.localdomain ([9.124.219.14]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o1FHR406028349; Mon, 15 Feb 2010 22:57:05 +0530 From: "Aneesh Kumar K.V" To: v9fs-developer@lists.sourceforge.net Date: Mon, 15 Feb 2010 22:57:00 +0530 Message-Id: <1266254822-823-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.14.g7e948 X-Spam-Score: -1.4 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Nh4j3-0006Qt-S3 Subject: [V9fs-developer] [PATCH -v3 1/3] net/9p: Add multi channel support. X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 15 Feb 2010 17:28:06 +0000 (UTC) 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 /* 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);