From: Carlos Llamas <cmllamas@google.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alessio Balsini <balsini@android.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
kernel-team <kernel-team@android.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fuse: fix integer type usage in uapi header
Date: Mon, 21 Mar 2022 02:07:19 +0000 [thread overview]
Message-ID: <Yjfd1+k83U+meSbi@google.com> (raw)
In-Reply-To: <CAJfpegsT6BO5P122wrKbni3qFkyHuq_0Qq4ibr05_SOa7gfvcw@mail.gmail.com>
On Fri, Mar 18, 2022 at 08:24:55PM +0100, Miklos Szeredi wrote:
> On Fri, 18 Mar 2022 at 18:14, Carlos Llamas <cmllamas@google.com> wrote:
> >
> > Kernel uapi headers are supposed to use __[us]{8,16,32,64} defined by
> > <linux/types.h> instead of 'uint32_t' and similar. This patch changes
> > all the definitions in this header to use the correct type. Previous
> > discussion of this topic can be found here:
> >
> > https://lkml.org/lkml/2019/6/5/18
>
> This is effectively a revert of these two commits:
>
> 4c82456eeb4d ("fuse: fix type definitions in uapi header")
> 7e98d53086d1 ("Synchronize fuse header with one used in library")
>
> And so we've gone full circle and back to having to modify the header
> to be usable in the cross platform library...
>
> And also made lots of churn for what reason exactly?
There are currently only two uapi headers making use of C99 types and
one is <linux/fuse.h>. This approach results in different typedefs being
selected when compiling for userspace vs the kernel. Plus only __u32 and
similar types align with the coding style as described in 5(e).
Yet, there is still the cross platform concern you mention. I think the
best way to accommodate this while still conforming with the __u32 types
is to follow something similar to 1a95916f5465 ("drm: Add compatibility
#ifdefs for *BSD"). Basically doing this:
#if defined(__KERNEL__) || defined(__linux__)
#include <linux/types.h>
#else
#include <stdint.h>
typedef uint16_t __u16;
typedef int32_t __s32;
typedef uint32_t __u32;
typedef int64_t __s64;
typedef uint64_t __u64;
#endif
This alternative selects the correct uapi types for both __KERNEL__ and
__linux__ cases which is the main goal of this patch and it's just minor
fixes from 7e98d53086d1 ("Synchronize header with one used in library").
I see there where previous attempts to address similar changes here:
https://lkml.org/lkml/2013/3/11/620
https://lkml.org/lkml/2013/4/15/487
So, if you agree with the approach above I'd be happy to send a separate
patch on top to address the *BSD compatibility.
Thanks,
Carlos Llamas
next prev parent reply other threads:[~2022-03-21 2:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 17:14 [PATCH] fuse: fix integer type usage in uapi header Carlos Llamas
2022-03-18 17:23 ` Masahiro Yamada
2022-03-18 19:24 ` Miklos Szeredi
2022-03-19 6:40 ` Greg Kroah-Hartman
2022-03-21 2:07 ` Carlos Llamas [this message]
2022-03-21 8:40 ` Miklos Szeredi
2022-03-21 8:50 ` Greg Kroah-Hartman
2022-03-21 9:36 ` Miklos Szeredi
2022-03-21 10:01 ` Greg Kroah-Hartman
2022-03-21 11:25 ` Miklos Szeredi
2022-03-21 12:28 ` Greg Kroah-Hartman
2022-03-19 6:40 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yjfd1+k83U+meSbi@google.com \
--to=cmllamas@google.com \
--cc=arnd@arndb.de \
--cc=balsini@android.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox