Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1457711ybe; Thu, 5 Sep 2019 16:04:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyArAmulN2fq/k8Xh4oYwrZkYweZwNoyBzlPlpe+vrj20dncG92TAmeoHl4SSf9YLvKA2Ml X-Received: by 2002:a62:f246:: with SMTP id y6mr6878013pfl.22.1567724678102; Thu, 05 Sep 2019 16:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567724678; cv=none; d=google.com; s=arc-20160816; b=L3J4+V+JqX4IEB5r+a82zp97k4z0xnQyMNn+8l4kGhCwQ0EmInx5ZSKdUVjm2gyOHq hfJg+b5zNoX1zgCy6A7n5K51ZQFlXJZ/GfmF72y/+/5de4iv1aXznmEhHjZoCcENh/I/ 2fZg+EXC5il2LRwLYMhoqO94U60Wa80gL7Oog/SinoS5CjRSsMFm/MX1e4mqfSjXHSG9 TDMXSMTbx5zcJtVEZ28o0AeenhTxunBgOXk98V17YCoOBQmQNGlQ/Wp8MI7dhrOmqKfy hjJN6ZHNGQ3kGfSvSs7933X5PcXTjcMk3D8nHeW1GDl5Z9HpPpLNzqWCdPdMc2hHzAoy b7yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NY8R1PxUs88kESQpN/BugqL9cEjATZBcroLJeayA7fY=; b=uci5wwxwQaIxAfujwtE6Zcww+e/bRLdeR75fEgQKBaA6dWlxumfdaPrFdHAcMKUhxS R2k5sC4wHzoymNbRav16o6L4zHiRxtvpZhsHVunh/77TLd6+dr6of9c8jm0g0nzb+HGk 1PhvGRislGtP+7GVaCQT4t1sX5l6pHIUHOSro5nJsuq7uVE7EllQcVDLGkxwihtTxlYU wbmEYJKhDEaYpc/LzwBrmBCObiqpBBb/u7JhN3Rygbp+3EjrnVL+dyziD13PjzTcEtJc PfLCGznqAUNVmwq2l3+PKJDZV1Kz96viRJdmHIt/yZWQsdYr/khxMnxIDcXBd+o9V4nY C5sA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z199si3281649pfc.283.2019.09.05.16.04.22; Thu, 05 Sep 2019 16:04:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390319AbfIETtn (ORCPT + 99 others); Thu, 5 Sep 2019 15:49:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390132AbfIETte (ORCPT ); Thu, 5 Sep 2019 15:49:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 299CC7E423; Thu, 5 Sep 2019 19:49:34 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 670905D9CA; Thu, 5 Sep 2019 19:49:26 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id EFC332253A1; Thu, 5 Sep 2019 15:49:17 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org, miklos@szeredi.hu Cc: linux-kernel@vger.kernel.org, virtio-fs@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, dgilbert@redhat.com, mst@redhat.com Subject: [PATCH 09/18] virtiofs: Add an helper to start all the queues Date: Thu, 5 Sep 2019 15:48:50 -0400 Message-Id: <20190905194859.16219-10-vgoyal@redhat.com> In-Reply-To: <20190905194859.16219-1-vgoyal@redhat.com> References: <20190905194859.16219-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 05 Sep 2019 19:49:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This just marks are the queues are connected and ready to accept the request. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index d5730a50b303..f2936daca39c 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -112,6 +112,19 @@ static void virtio_fs_drain_all_queues(struct virtio_fs *fs) } } +static void virtio_fs_start_all_queues(struct virtio_fs *fs) +{ + struct virtio_fs_vq *fsvq; + int i; + + for (i = 0; i < fs->nvqs; i++) { + fsvq = &fs->vqs[i]; + spin_lock(&fsvq->lock); + fsvq->connected = true; + spin_unlock(&fsvq->lock); + } +} + /* Add a new instance to the list or return -EEXIST if tag name exists*/ static int virtio_fs_add_instance(struct virtio_fs *fs) { @@ -483,10 +496,10 @@ static int virtio_fs_setup_vqs(struct virtio_device *vdev, if (ret < 0) goto out; - for (i = 0; i < fs->nvqs; i++) { + for (i = 0; i < fs->nvqs; i++) fs->vqs[i].vq = vqs[i]; - fs->vqs[i].connected = true; - } + + virtio_fs_start_all_queues(fs); out: kfree(names); kfree(callbacks); -- 2.20.1