From nobody Mon Feb 9 11:21:18 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1647340428; cv=none; d=zohomail.com; s=zohoarc; b=Ar7+gsf70AfQnq16JiTgC/g2F177tyQZrSsGcXXxU7H8bNEi4EqFPIwrLaiBiLTPuhYzMTJzDU0vii5+2sCv1VMF49Sjw1dlhiT1nGtkLImerGHjk2kitUItVD4VuqX15pPje3sZRDMi9zaimWYanqpjsU8Qe67dNpQ/d8c77h8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647340428; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=My4K+eiCxAHtELn1btGGEyng+75fSZVgSXg21Pv6JpQ=; b=JDNIsMaGdsI/MOcST/mZuRYwvg/JQHRyzcGEcR/eAehIjHP8ATxfxJrWVPJno5h4N6Iq7b/3T+pG4C7WflbpS2wnaFQC7PhN5v9trnoS25ShucsOuLwsKShVfiF88s4J7ipyN5NUHravzZuykMR3mh2ziJgg2zXWbTgJW/1O8PI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647340428498172.05898020113875; Tue, 15 Mar 2022 03:33:48 -0700 (PDT) Received: from localhost ([::1]:60646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU4Ut-00021j-0b for importer@patchew.org; Tue, 15 Mar 2022 06:33:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU4Ka-0007NY-CG for qemu-devel@nongnu.org; Tue, 15 Mar 2022 06:23:08 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:53723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU4KY-0004Hn-Ox for qemu-devel@nongnu.org; Tue, 15 Mar 2022 06:23:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=My4K+eiCxAHtELn1btGGEyng+75fSZVgSXg21Pv6JpQ=; b=KbMoV jE8x+To7MnIVNmVdU4kuBSYI7DMyqjpf7xQd/SUs6itTujCZ4k8fLXaUlZ+47gmKhL48xqDh+Fexn RZfO6qkYFJrJCO+//aKAbNm1Cc5xFiwBvxa1oZEd1DdgcrV0wYrVSzQCu6lnb8cipQBgp8cQ0epnh PnmvUxZfydfAIjgZGTFo3hyXHMZ/a+IKn0D2c2knp2b8n7m/Easl5iXgMTbx77HxQjaR5QPOzjZ2J F5rMk//8ER+XtwI/Pq8bVN92n2rUw9Kd1JU+yxGo50t2BIom3EJsjPuACyY05fvPvMLADld1bqsdq PisgvubpbL2+a36jvHmd9UIqM07ig==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Tue, 15 Mar 2022 11:08:37 +0100 Subject: [PATCH v4 4/7] 9pfs: refactor 'name_idx' -> 'nwalked' in v9fs_walk() To: qemu-devel@nongnu.org Cc: Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=91.194.90.13; envelope-from=d506308e7e343023c4db95d0e6053dd2627ed3c1@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1647340430185100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The local variable 'name_idx' is used in two loops in function v9fs_walk(). Let the first loop use its own variable 'nwalked' instead, which we will use in subsequent patch as the number of (requested) path components successfully walked by background I/O thread. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz --- hw/9pfs/9p.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index a6d6b3f835..298f4e6548 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1764,7 +1764,7 @@ static bool same_stat_id(const struct stat *a, const = struct stat *b) =20 static void coroutine_fn v9fs_walk(void *opaque) { - int name_idx; + int name_idx, nwalked; g_autofree V9fsQID *qids =3D NULL; int i, err =3D 0; V9fsPath dpath, path; @@ -1842,17 +1842,17 @@ static void coroutine_fn v9fs_walk(void *opaque) break; } stbuf =3D fidst; - for (name_idx =3D 0; name_idx < nwnames; name_idx++) { + for (nwalked =3D 0; nwalked < nwnames; nwalked++) { if (v9fs_request_cancelled(pdu)) { err =3D -EINTR; break; } if (!same_stat_id(&pdu->s->root_st, &stbuf) || - strcmp("..", wnames[name_idx].data)) + strcmp("..", wnames[nwalked].data)) { err =3D s->ops->name_to_path(&s->ctx, &dpath, - wnames[name_idx].data, - &pathes[name_idx]); + wnames[nwalked].data, + &pathes[nwalked]); if (err < 0) { err =3D -errno; break; @@ -1861,13 +1861,13 @@ static void coroutine_fn v9fs_walk(void *opaque) err =3D -EINTR; break; } - err =3D s->ops->lstat(&s->ctx, &pathes[name_idx], &stbuf); + err =3D s->ops->lstat(&s->ctx, &pathes[nwalked], &stbuf); if (err < 0) { err =3D -errno; break; } - stbufs[name_idx] =3D stbuf; - v9fs_path_copy(&dpath, &pathes[name_idx]); + stbufs[nwalked] =3D stbuf; + v9fs_path_copy(&dpath, &pathes[nwalked]); } } }); --=20 2.30.2