From patchwork Tue Aug 17 17:27:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jvrao X-Patchwork-Id: 119984 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7HHJvDj010445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 Aug 2010 17:20:33 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 1OlPpJ-00062K-48; Tue, 17 Aug 2010 17:19:53 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OlPpH-000625-Qv for v9fs-developer@lists.sourceforge.net; Tue, 17 Aug 2010 17:19:51 +0000 X-ACL-Warn: Received: from e39.co.us.ibm.com ([32.97.110.160]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1OlPpG-0004Nl-Px for v9fs-developer@lists.sourceforge.net; Tue, 17 Aug 2010 17:19:51 +0000 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o7HH9igM008173 for ; Tue, 17 Aug 2010 11:09:44 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7HHJZbM079850 for ; Tue, 17 Aug 2010 11:19:38 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7HHJYBu002119 for ; Tue, 17 Aug 2010 11:19:34 -0600 Received: from localhost.localdomain (elm9m80.beaverton.ibm.com [9.47.81.80]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o7HHJWRu001997; Tue, 17 Aug 2010 11:19:33 -0600 From: "Venkateswararao Jujjuri (JV)" To: v9fs-developer@lists.sourceforge.net Date: Tue, 17 Aug 2010 10:27:21 -0700 Message-Id: <1282066045-3945-2-git-send-email-jvrao@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1282066045-3945-1-git-send-email-jvrao@linux.vnet.ibm.com> References: <1282066045-3945-1-git-send-email-jvrao@linux.vnet.ibm.com> X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1OlPpG-0004Nl-Px Cc: linux-fsdevel@vger.kernel.org, Badari Pulavarty Subject: [V9fs-developer] [PATCH 1/5] [net/9p] Add capability() to p9_trans_module 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]); Tue, 17 Aug 2010 17:20:33 +0000 (UTC) diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h index 6d5886e..495a118 100644 --- a/include/net/9p/transport.h +++ b/include/net/9p/transport.h @@ -25,6 +25,7 @@ #ifndef NET_9P_TRANSPORT_H #define NET_9P_TRANSPORT_H +#define P9_CAP_GET_MAX_SG_PAGES 0x01 /** * struct p9_trans_module - transport module interface @@ -53,6 +54,7 @@ struct p9_trans_module { void (*close) (struct p9_client *); int (*request) (struct p9_client *, struct p9_req_t *req); int (*cancel) (struct p9_client *, struct p9_req_t *req); + int (*capability) (int req); }; void v9fs_register_trans(struct p9_trans_module *m); diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index dcfbe99..762c19f 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -374,6 +374,18 @@ static void p9_virtio_remove(struct virtio_device *vdev) } +/** + * p9_virtio_capability - Return the queried capability related information. + * + */ +static int p9_virtio_capability(int req) +{ + int ret = 0; + if (req == P9_CAP_GET_MAX_SG_PAGES) + ret = VIRTQUEUE_NUM - 8; /* Keep 8 for in/out headers */ + return ret; +} + static struct virtio_device_id id_table[] = { { VIRTIO_ID_9P, VIRTIO_DEV_ANY_ID }, { 0 }, @@ -400,6 +412,7 @@ static struct p9_trans_module p9_virtio_trans = { .close = p9_virtio_close, .request = p9_virtio_request, .cancel = p9_virtio_cancel, + .capability = p9_virtio_capability, .maxsize = PAGE_SIZE*16, .def = 0, .owner = THIS_MODULE,