From patchwork Mon Nov 21 21:39:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9440081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87098606DB for ; Mon, 21 Nov 2016 21:41:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79B25289CA for ; Mon, 21 Nov 2016 21:41:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B45B28ACB; Mon, 21 Nov 2016 21:41:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BEA9D28A93 for ; Mon, 21 Nov 2016 21:41:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8wJQ-0007Pi-95; Mon, 21 Nov 2016 21:39:40 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8wJO-0007PQ-Gw for xen-devel@lists.xensource.com; Mon, 21 Nov 2016 21:39:38 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id 7F/2D-28971-99963385; Mon, 21 Nov 2016 21:39:37 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsVybKJsh+7MTOM Ig3v/uC3uTXnP7sDosb1vF3sAYxRrZl5SfkUCa8aZrvPMBZf4Ki4ff8fUwHiRu4uRi0NIYCqj xILd1xghnO1MEqdur2HuYuTkYBMwlPj7ZBMbiC0ioCzRNLmHDaSIGaTjTsd5IIeDQxio6ON+R ZAaFgFViaWXullBbF4BN4mpe+6yg9gSAnISJ49NBotzCnhLvLi+mxHEFhLwknh37zgbRE2GxL yeOawQtpfEohuXoGw1iavnNjFPYORbwMiwilGjOLWoLLVI19hYL6koMz2jJDcxM0fX0MBMLze 1uDgxPTUnMalYLzk/dxMjMFAYgGAH4871gYcYJTmYlER5Dy81ihDiS8pPqcxILM6ILyrNSS0+ xCjDwaEkwcuWYRwhJFiUmp5akZaZAwxZmLQEB4+SCK8NSJq3uCAxtzgzHSJ1ilFRSpyXFSQhA JLIKM2Da4PFySVGWSlhXkagQ4R4ClKLcjNLUOVfMYpzMCoJ83qDTOHJzCuBm/4KaDET0GIlVg OQxSWJCCmpBsa1Xj+Mv864vvDBZz7djo+5nf8SvmhUGG0t/j9p54uuxxMD1iZu//bimrh22l5 RluPqL4vurOR4kxk50b5j8u+iU46FkuG338Qd1HSR9d46p2r6aevUr0+/tIhekGoQzV5csGIJ t3jzX9nPHlN+OrK+7vL74vOv0PzBIjWZbnGtylA1872u2deVWIozEg21mIuKEwEeHvJqjgIAA A== X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1479764375!62827680!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22120 invoked from network); 21 Nov 2016 21:39:37 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-8.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Nov 2016 21:39:37 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B43D520220; Mon, 21 Nov 2016 21:39:34 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9232220204; Mon, 21 Nov 2016 21:39:33 +0000 (UTC) From: Stefano Stabellini To: aneesh.kumar@linux.vnet.ibm.com Date: Mon, 21 Nov 2016 13:39:29 -0800 Message-Id: <1479764372-29470-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Cc: xen-devel@lists.xensource.com, wei.liu2@citrix.com, groug@kaod.org, qemu-devel@nongnu.org, sstabellini@kernel.org, anthony.perard@citrix.com Subject: [Xen-devel] [PATCH 1/4] 9pfs: move pdus to V9fsState X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP pdus are initialized and used in 9pfs common code. Move the array from V9fsVirtioState to V9fsState. Signed-off-by: Stefano Stabellini Reviewed-by: Greg Kurz --- hw/9pfs/9p.c | 7 +++---- hw/9pfs/9p.h | 1 + hw/9pfs/virtio-9p.h | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index aea7e9d..05e950f 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3440,7 +3440,6 @@ void pdu_submit(V9fsPDU *pdu) /* Returns 0 on success, 1 on failure. */ int v9fs_device_realize_common(V9fsState *s, Error **errp) { - V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); int i, len; struct stat stat; FsDriverEntry *fse; @@ -3451,9 +3450,9 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp) QLIST_INIT(&s->free_list); QLIST_INIT(&s->active_list); for (i = 0; i < (MAX_REQ - 1); i++) { - QLIST_INSERT_HEAD(&s->free_list, &v->pdus[i], next); - v->pdus[i].s = s; - v->pdus[i].idx = i; + QLIST_INSERT_HEAD(&s->free_list, &s->pdus[i], next); + s->pdus[i].s = s; + s->pdus[i].idx = i; } v9fs_path_init(&path); diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 3976b7f..07cee01 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -229,6 +229,7 @@ typedef struct V9fsState char *tag; enum p9_proto_version proto_version; int32_t msize; + V9fsPDU pdus[MAX_REQ]; /* * lock ensuring atomic path update * on rename. diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index 25c47c7..52c4b9d 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -10,7 +10,6 @@ typedef struct V9fsVirtioState VirtIODevice parent_obj; VirtQueue *vq; size_t config_size; - V9fsPDU pdus[MAX_REQ]; VirtQueueElement *elems[MAX_REQ]; V9fsState state; } V9fsVirtioState;