From nobody Mon Feb 9 21:01:24 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=1655378549; cv=none; d=zohomail.com; s=zohoarc; b=KULmGi8e7m+yl1r7uawubrAVI5hyTB/NJMe0O2rhAut8VkkDFtPLiDYTUI39Acy5dNFUDSFn4xxQEaO7Rm5WmB9kIDyPIn+YHIKpPnj+LvMIQXWtcAyCJC+LOUXjdevbVAfIcIzKdFuXtirQTN9/AbLkF17U4UMXhUcZoQv4peU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655378549; 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=LfOg2LJMp+lzmauAGTMKtTKYtVr9WibU0AurDQsfIYI=; b=TOoH4e8mQxYSNCcahLdym6yXpaAVErzZT3QCgyRytzyrRRyXO0h48S241uc6T3YyNM9/d7qxRfc+4eWg6wt2IhEMgTTBfGjgHnHf7rxX1WeLyquPU+dltJ3lCe4w07riWpUFYMxjoRPrHPOID+kDeUQPfX6tGtqDF9Upbbwd1G4= 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 1655378549088839.8009266097928; Thu, 16 Jun 2022 04:22:29 -0700 (PDT) Received: from localhost ([::1]:42666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1nZz-0005MU-8D for importer@patchew.org; Thu, 16 Jun 2022 07:22:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1nLl-0007K0-I7 for qemu-devel@nongnu.org; Thu, 16 Jun 2022 07:07:45 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:57481) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1nLk-0003KI-5W for qemu-devel@nongnu.org; Thu, 16 Jun 2022 07:07:45 -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=LfOg2LJMp+lzmauAGTMKtTKYtVr9WibU0AurDQsfIYI=; b=d2SR/ QH//QplBsViZTxcD1trRxVz8DdOEMuir3n2KLLmkt3MKG+J6SkixraejP5OOtUYhZSVrJz8PTxboI dlXUUgwdfN4WpuF66Ynt0eb4iWTeorOVsG2hW7oChrcSEK4rWrwCJLnkIiNNqPyi1+IXvZ1QGCCZm zfs9Zh1bLkbLfgsZG8LVCOwjYP4rz7iOA6Xkjt8nr+06KqgDAqCBbP2D76u5azf54/bsn5WXvpGSw +702dvleeOX6CwdEK7STDgng4PRrs6z4hUlAy17MnAAvq/XBlwHLTUy4CJxfIZyuNrg/HQcEKGGRZ Ty4cKahG8BTrAou4KXQ/nHsHavp8w==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 16 Jun 2022 13:00:04 +0200 Subject: [PULL 4/7] 9pfs: refactor 'name_idx' -> 'nwalked' in v9fs_walk() To: qemu-devel@nongnu.org, Peter Maydell 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=fd6c979e651a2163062b746e01adf6f267c8e874@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: 1655378549958100003 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 Message-Id: --- 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 0cd0c14c2a..f29611e9ed 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1766,7 +1766,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; @@ -1844,17 +1844,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; @@ -1863,13 +1863,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