From nobody Mon Feb 9 06:07:53 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=1625486157; cv=none; d=zohomail.com; s=zohoarc; b=nwHzFCfQEaDkimp/A2s+lFWyINhzAAxSwcIOnnt4wxmuN14avSiQjfgvJYSayB/OHSHvfi86y6G5Cdx6W8t6FETzNVLBn5HL9jiwdhlRid7TmCYacKncZ7G8ZX/llor28ueWnObWigw7Ys+XWukIP19M435vOPZvTX9SE28PekU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625486157; 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=e4656rS0PFVUGSZuE2ckdD7eWHsp5wNR2O/nh560HaU=; b=DIqlXl8juywjSCknkyPClTqxQONWIHhi6KE4tVFV7P9EHvLF22jAcBth8Ar5FqrfzR4RlRvcuNoAdscVVOuMpOZMumNB65T3DYYUEY6cyzlxBOHueJ+JzpuH94nRMEAp8VzGFVWy6yhcV9iAbmi30alKJSwCsufMhuUu6GgzrTU= 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 1625486157707777.3599161078608; Mon, 5 Jul 2021 04:55:57 -0700 (PDT) Received: from localhost ([::1]:55918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0NCd-0005X0-RC for importer@patchew.org; Mon, 05 Jul 2021 07:55:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <1d0fc0d0eef057dc02055f531907188d19a83cb2@lizzy.crudebyte.com>) id 1m0NBL-0004on-O9 for qemu-devel@nongnu.org; Mon, 05 Jul 2021 07:54:35 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:38651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <1d0fc0d0eef057dc02055f531907188d19a83cb2@lizzy.crudebyte.com>) id 1m0NBJ-0005pj-6Z for qemu-devel@nongnu.org; Mon, 05 Jul 2021 07:54:35 -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=e4656rS0PFVUGSZuE2ckdD7eWHsp5wNR2O/nh560HaU=; b=ptf/T yVyi1oW+AX8JRS8hqVHc8/guIzr5ex/8udJAU6aHBtnUqs0iV8fv/aqohddw/JakYG6H2vjcHmoDe 4b5YefW0naahD38Fi/dY+jCAu1bSr5JqPXBvk2oplQopIWUHBgNHIUgsGcYaSvA7DEA1KDlWlKNeK vdb15FnZsntFkSB02f52j4n/Jk5ajUle7ZtFLsoLGN1CCYDPAn9wJSMoBfiefmiN00upu/NgXVoCF 673PC/ZunTQxqS53cmbFD6lk4+iwV2gg/cBxbkFxWXNseRxoGBokg9vIJCwY2mXbratNYjqmtX6Uz zht7gLW3g3sBV/rnu5FVBTW9jFi3Q==; Message-Id: <1d0fc0d0eef057dc02055f531907188d19a83cb2.1625483630.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Mon, 05 Jul 2021 13:13:51 +0200 Subject: [PULL 5/8] 9pfs: drop fid_to_qid() 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=1d0fc0d0eef057dc02055f531907188d19a83cb2@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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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: 1625486161177100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There is only one user of fid_to_qid() which is v9fs_walk(). Let's open-code fid_to_qid() directly within v9fs_walk(), because fid_to_qid() hides the POSIX stat buffer which we are going to need in the subsequent patch. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/9p.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index eb15ec2082..0e3857798d 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -971,23 +971,6 @@ static int stat_to_qid(V9fsPDU *pdu, const struct stat= *stbuf, V9fsQID *qidp) return 0; } =20 -static int coroutine_fn fid_to_qid(V9fsPDU *pdu, V9fsFidState *fidp, - V9fsQID *qidp) -{ - struct stat stbuf; - int err; - - err =3D v9fs_co_lstat(pdu, &fidp->path, &stbuf); - if (err < 0) { - return err; - } - err =3D stat_to_qid(pdu, &stbuf, qidp); - if (err < 0) { - return err; - } - return 0; -} - V9fsPDU *pdu_alloc(V9fsState *s) { V9fsPDU *pdu =3D NULL; @@ -1772,7 +1755,11 @@ static void coroutine_fn v9fs_walk(void *opaque) v9fs_path_init(&dpath); v9fs_path_init(&path); =20 - err =3D fid_to_qid(pdu, fidp, &qid); + err =3D v9fs_co_lstat(pdu, &fidp->path, &stbuf); + if (err < 0) { + goto out; + } + err =3D stat_to_qid(pdu, &stbuf, &qid); if (err < 0) { goto out; } --=20 2.20.1