From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10640C433EF for ; Wed, 2 Feb 2022 03:42:18 +0000 (UTC) Received: from localhost ([::1]:53674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nF6XB-000058-Ny for qemu-devel@archiver.kernel.org; Tue, 01 Feb 2022 22:42:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nF2zh-0007Ea-4k for qemu-devel@nongnu.org; Tue, 01 Feb 2022 18:55:29 -0500 Received: from [2607:f8b0:4864:20::936] (port=43864 helo=mail-ua1-x936.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nF2zc-00011J-BT for qemu-devel@nongnu.org; Tue, 01 Feb 2022 18:55:28 -0500 Received: by mail-ua1-x936.google.com with SMTP id a24so2442848uat.10 for ; Tue, 01 Feb 2022 15:55:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eYwcAQB27IFQPf3klG0J04uXC8Gvw8FYtCcP5ReUBuo=; b=6DDhm7VP8ZWWAHzOuzqRJA7p3kmEI1ZQ9GtcoE9xOOsWw9mIq01xaQppRZiw9tMh93 uHSdClhOki4CnKvFINN+fRtT+yEpmcwlNm9hWwLP73QYDbT3N2VlC9EStbcyVO/ahQFD oiO+1JVUOFiRE8WQ2WImZyTJcikk7cK5E7SRH/ew9+s9kXGW4/OhMlnnDC3xPgFsJ5Xm 916ZAk5HlpWVeYWR7lyAAgA3pl3N5vMEzL1ZZLv/RObQCNsYSE6IxLc2zVYe/iOeyk6L xoe4Ow6xfkFVVFQ8gZljcYAKyrsMCqGc8+LNDaKmDtwCtVMeiH9y7L26M9pCrZRgvgNk 7MlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eYwcAQB27IFQPf3klG0J04uXC8Gvw8FYtCcP5ReUBuo=; b=tdfyyRPStXN+dzfmjSUMy3WPOLg9JX4D+uY1a+giVA+EAJMfYKs7LCy4/ouQYC8pqw gIMRcbMOBqQN/9nmEtCescqYIpNfyM1YGYZeOUTv6ynF8bcPVSSvqUzCNPRVlqKKRwkU RjUaDcuUuqyV5t6HYYsESFsYpbuTimwQNGCYCXKfFatykH9zsSNBOembfpMwkqdWLQ3i H52WeZqOgPxE9Xb75ghRYJoS6fJlc4q+eJ5vch3wyQFaYTbytatmHMpH6ma2Slex3jol 4JJ0c9CptmnQu6t723AXSl9DIrxYVz8vCKk5V/cEzbxrlt7yubjVV4Ulpc7m6TUsjIze F1zA== X-Gm-Message-State: AOAM533SFO9OA6dCa3Qrec9EwG6sHlRqKzf25J3UvLe8ufR5PobU0yaE 7uQKj4wxG5pv9fCGfoywzCT94aSGn36VbRKfEl+0ow== X-Google-Smtp-Source: ABdhPJxEtqFTkvgX16+qhl9KzvYZY5UkrX4WSYXoY0I9x90JV+K8NBHCC1Mg+RncBub3bMFwp2UyVX7dCAfgRDKGhLQ= X-Received: by 2002:ab0:2a07:: with SMTP id o7mr11554060uar.39.1643759722005; Tue, 01 Feb 2022 15:55:22 -0800 (PST) MIME-Version: 1.0 References: <20220201111455.52511-1-imp@bsdimp.com> <20220201111455.52511-14-imp@bsdimp.com> <021f966e-b664-b27f-f24a-fc6dc9f960bb@linaro.org> In-Reply-To: <021f966e-b664-b27f-f24a-fc6dc9f960bb@linaro.org> From: Warner Losh Date: Tue, 1 Feb 2022 16:55:11 -0700 Message-ID: Subject: Re: [PATCH 13/22] bsd-user/bsd-file.h: Implementation details for the filesystem calls To: Richard Henderson Content-Type: multipart/alternative; boundary="000000000000539e7a05d6fda22d" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::936 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::936; envelope-from=wlosh@bsdimp.com; helo=mail-ua1-x936.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Peter Maydell , Gleb Popov , Kyle Evans , QEMU Developers , Konrad Witaszczyk , Jessica Clarke , Brad Smith Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000539e7a05d6fda22d Content-Type: text/plain; charset="UTF-8" On Tue, Feb 1, 2022 at 10:43 AM Richard Henderson < richard.henderson@linaro.org> wrote: > On 2/1/22 22:14, Warner Losh wrote: > > +#ifndef BSD_FILE_H_ > > +#define BSD_FILE_H_ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > Many of these should be done by "qemu/osdep.h" already. Otherwise I > question putting them > into this header, as opposed to as needed by other syscall handling c > files. > I can remove the ones that are done by qemu/osdep.h easily enough. That's changed over time and these used to be required. I'm hesitant to remove the others since that's starting to get into restructuring the code we have working upstream. On the other hand, the ordering of these files make it such that these are often included just once, so moving to a bsd-file.h that's just the functions and bsd-file.c that's the definition and relying on LTO to optimize. That would make things less fragile than they are now. So I'm torn since part of floating these patches is to do a small sliver to get feedback... I may need to sleep on this to figure out how to weigh the 'cleaner code' vs 'risk of introducing regressions during refactoring'. Warner --000000000000539e7a05d6fda22d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Feb 1, 2022 at 10:43 AM Richa= rd Henderson <richard.he= nderson@linaro.org> wrote:
On 2/1/22 22:14, Warner Losh wrote:
> +#ifndef BSD_FILE_H_
> +#define BSD_FILE_H_
> +
> +#include <sys/types.h>
> +#include <sys/mount.h>
> +#include <sys/uio.h>
> +#include <fcntl.h>
> +#include <poll.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <unistd.h>

Many of these should be done by "qemu/osdep.h" already.=C2=A0 Oth= erwise I question putting them
into this header, as opposed to as needed by other syscall handling c files= .

I can remove the ones that are done b= y qemu/osdep.h easily enough. That's changed over time
and th= ese used to be required. I'm hesitant to remove the others since that&#= 39;s starting to get
into restructuring the code we have working = upstream. On the other hand, the ordering of these
files make it = such that these are often included just once, so moving to a bsd-file.h tha= t's just the
functions and bsd-file.c that's the definiti= on and relying on LTO to optimize. That would make things
less fr= agile than they are now. So I'm torn since part of floating these patch= es is to do a small sliver
to get feedback...=C2=A0 I may need to= sleep on this to figure out how to weigh=C2=A0the 'cleaner code' v= s 'risk
of introducing regressions during refactoring'.

Warner
--000000000000539e7a05d6fda22d--