From nobody Mon Feb 9 00:07:33 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=1647087182; cv=none; d=zohomail.com; s=zohoarc; b=nwfHxE6vscWviDFXbR5qNCP5Q/EO3JRXP1JX/IVBWV1LhqSrgvw/qPvqM5i6OU5nj15GHN7KiM34SKb26Fl9k657Uwo7g0GK/Of2HQmv4+MearSSl7o6I2EFGkyvcS9ga+T4960qWi+9qvwkY5DiGQsItGi3YOKFXn+DhObJuoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647087182; 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=IjEXupc13ndq6nJGRDgPXr/inCCL9dJwmpYeynYHNI+QD8gASjEziw0I1MwoTnZ1GT/0cAdyA2vr7PwuxVXaWijuun1KpXtkafYk3FzzPzLWaBKr5TuxxiGz6gyRibB6fd8u71Orc+Kc0fHw6wIJtqm5OejShjCkCt4Kxe1ogN0= 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 1647087182797851.0812387684641; Sat, 12 Mar 2022 04:13:02 -0800 (PST) Received: from localhost ([::1]:55708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nT0cC-0007jG-0d for importer@patchew.org; Sat, 12 Mar 2022 07:12:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nT0Zo-0004hT-8U for qemu-devel@nongnu.org; Sat, 12 Mar 2022 07:10:28 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:51461) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nT0Zm-0005XM-Rg for qemu-devel@nongnu.org; Sat, 12 Mar 2022 07:10:27 -0500 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=G/hpJ h+rWP+bIjeby02goE3PfCb9lN4ahahV9oxB87fN/sdtFIS9xv7+KQRZGRQbqH5eB1qdJ63TD+QXFW JWvKdFLIcHcIGKUksDfXjiO2DsqApkNGGX2ZofU2QBBGyTUl8PY+yrXgeyIOfs2rI5JwauRf4heBN QBZuGCjyPnT5R8ZShS64PGhMmW15Ooap+cN4reBsXByAzcBcOy6rY4cNOwIlF9uZ+uLH+t6/7sHp8 p6/zoEFOjmJKzg0QxHAtevufg/S42ovNoPc7fYXad152jOZkWJWiMvx1yAftHiitdUNHbzMrPqUvv d5cU7MyUcOyjjdxfAtiitZjs43GMg==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Sat, 12 Mar 2022 12:06:45 +0100 Subject: [PATCH v2 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=eebd764c82b49f50d83b5d64ecc28ac802fbea3b@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: 1647087184970100001 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