From: Willy Tarreau <w@1wt.eu>
To: chris.chenfeiyang@gmail.com
Cc: paulmck@kernel.org, Feiyang Chen <chenfeiyang@loongson.cn>,
arnd@arndb.de, chenhuacai@kernel.org, jiaxun.yang@flygoat.com,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/5] tools/nolibc: Add statx() and make stat() rely on statx() when available
Date: Wed, 8 Feb 2023 11:39:36 +0100 [thread overview]
Message-ID: <Y+N76C7hfcu5Ze/J@1wt.eu> (raw)
In-Reply-To: <b9bbf73286238bb4657d855c9d50983aa17953e2.1675851111.git.chenfeiyang@loongson.cn>
Hi Feiyang,
On Wed, Feb 08, 2023 at 06:17:51PM +0800, chris.chenfeiyang@gmail.com wrote:
> From: Feiyang Chen <chenfeiyang@loongson.cn>
>
> loongarch and riscv32 only have statx(). arc, hexagon, nios2 and
> openrisc have statx() and stat64() but not stat() or newstat().
> Add statx() and make stat() rely on statx() to make them happy.
Thanks for this, that's way better. I'm just having one small request
below:
> +/*
> + * int statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf);
> + */
> +
> +static __attribute__((unused))
> +int sys_statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
> +{
> + return my_syscall5(__NR_statx, fd, path, flags, mask, buf);
> +}
> +
> +static __attribute__((unused))
> +int statx(int fd, const char *path, int flags, unsigned int mask, struct statx *buf)
> +{
> + int ret = sys_statx(fd, path, flags, mask, buf);
> +
> + if (ret < 0) {
> + SET_ERRNO(-ret);
> + ret = -1;
> + }
> + return ret;
> +}
Please guard these inside #if defined(__NR_statx) so that this can still
be used as-is from slightly older toolchains that provide their own kernel
includes.
The rest of the series looks pretty good to me.
Thank you!
Willy
next prev parent reply other threads:[~2023-02-08 10:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 10:17 [PATCH v2 0/5] Add LoongArch support to nolibc chris.chenfeiyang
2023-02-08 10:17 ` [PATCH v2 1/5] tools/nolibc: Include linux/fcntl.h and remove duplicate code chris.chenfeiyang
2023-02-08 10:17 ` [PATCH v2 2/5] tools/nolibc: Add statx() and make stat() rely on statx() when available chris.chenfeiyang
2023-02-08 10:39 ` Arnd Bergmann
2023-02-09 2:06 ` Feiyang Chen
2023-02-08 10:39 ` Willy Tarreau [this message]
2023-02-09 2:02 ` Feiyang Chen
2023-02-08 11:00 ` Huacai Chen
2023-02-09 2:25 ` Feiyang Chen
2023-02-08 22:39 ` David Laight
2023-02-09 2:14 ` Feiyang Chen
2023-02-08 10:17 ` [PATCH v2 3/5] tools/nolibc: Add support for LoongArch chris.chenfeiyang
2023-02-08 10:17 ` [PATCH v2 4/5] selftests/nolibc: " chris.chenfeiyang
2023-02-08 10:17 ` [PATCH v2 5/5] selftests/nolibc: Adjust indentation for Makefile chris.chenfeiyang
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=Y+N76C7hfcu5Ze/J@1wt.eu \
--to=w@1wt.eu \
--cc=arnd@arndb.de \
--cc=chenfeiyang@loongson.cn \
--cc=chenhuacai@kernel.org \
--cc=chris.chenfeiyang@gmail.com \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=paulmck@kernel.org \
/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