From patchwork Thu Feb 11 17:24:30 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: 78748 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 o1BHOsZx006951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Feb 2010 17:25:30 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 1NfcmV-0005E6-Cx; Thu, 11 Feb 2010 17:24:47 +0000 Received: from sfi-mx-4.v28.ch3.sourceforge.com ([172.29.28.124] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NfcmT-0005Dw-Rn for v9fs-developer@lists.sourceforge.net; Thu, 11 Feb 2010 17:24:45 +0000 X-ACL-Warn: Received: from e23smtp09.au.ibm.com ([202.81.31.142]) by sfi-mx-4.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NfcmS-00021y-H6 for v9fs-developer@lists.sourceforge.net; Thu, 11 Feb 2010 17:24:45 +0000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp09.au.ibm.com (8.14.3/8.13.1) with ESMTP id o1BHObip017158 for ; Fri, 12 Feb 2010 04:24:37 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o1BHJSPF1450018 for ; Fri, 12 Feb 2010 04:19:28 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o1BHOahq016213 for ; Fri, 12 Feb 2010 04:24:36 +1100 Received: from localhost.localdomain ([9.124.211.8]) by d23av02.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o1BHOXp1016197; Fri, 12 Feb 2010 04:24:35 +1100 From: "Aneesh Kumar K.V" To: v9fs-developer@lists.sourceforge.net Date: Thu, 11 Feb 2010 22:54:30 +0530 Message-Id: <1265909071-11474-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.0.rc2 In-Reply-To: <1265909071-11474-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1265909071-11474-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Spam-Score: -3.0 (---) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [202.81.31.142 listed in list.dnswl.org] 1.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NfcmS-00021y-H6 Subject: [V9fs-developer] [PATCH -V2 2/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]); Thu, 11 Feb 2010 17:25:30 +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 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);