From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yury Norov Subject: Re: [PATCH v2] UAPI: move RENAME_* definitions to separated file Date: Thu, 22 Nov 2018 12:16:54 +0000 Message-ID: <20181122121642.GB17424@yury-thinkpad> References: <20181114071346.31210-1-ynorov@caviumnetworks.com> <20181114072559.GA16695@yury-thinkpad> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20181114072559.GA16695@yury-thinkpad> Content-Language: en-US Content-ID: <3FF69DDBBFCB0F47AD9E8CDD916C5696@namprd07.prod.outlook.com> Sender: linux-kernel-owner@vger.kernel.org To: Andrew Morton , Alexander Viro , Florian Weimer Cc: "Norov, Yuri" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-api@vger.kernel.org" , "libc-alpha@sourceware.org" List-Id: linux-api@vger.kernel.org Ping? On Wed, Nov 14, 2018 at 07:26:07AM +0000, Yury Norov wrote: > Hi all,=20 >=20 > It seems that I forgot to rename guards in v2. This is the correct > version. My apologize for noise. >=20 > Yury >=20 > >From 61215b1cb559e69fb57f2a82864e72e3a1ef4b12 Mon Sep 17 00:00:00 2001 > From: Yury Norov > Date: Wed, 14 Nov 2018 09:51:49 +0300 > To: Andrew Morton , > Alexander Viro , > Florian Weimer > CC: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, > linux-api@vger.kernel.org, libc-alpha@sourceware.org > Subject: [PATCH v2] UAPI: move RENAME_* definitions to separated file >=20 > Discussion: > https://lore.kernel.org/lkml/20180702084622.GA15274@yury-thinkpad/ >=20 > Although RENAME_* macros are exposed in kernel headers, they are not > used by glibc. That's because linux/fs.h which hosts RENAME_* is > considered unsuitable by glibc developers: >=20 > As Florian Weimer wrote: >=20 > > undefines and defines macros not mentioned in the standard= s > > (and it even contains a few unrelated structs), so we cannot include it > > without _GNU_SOURCE. > > > > It might be possible to include it only for _GNU_SOURCE, but there are = a > > lot of things in , so that does not seem to be particularly > > advisable. >=20 > In this patch RENAME_* is removed to a separated header file that > conforms the standards and therefore is suitable for inclusion by glibc. >=20 > v2: > - rename dedicated file to 'rename-flags.h', as requested by Florian. >=20 > Signed-off-by: Yury Norov > --- > include/uapi/linux/fs.h | 4 +--- > include/uapi/linux/rename-flags.h | 12 ++++++++++++ > 2 files changed, 13 insertions(+), 3 deletions(-) > create mode 100644 include/uapi/linux/rename-flags.h >=20 > diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h > index 73e01918f996..34c308203746 100644 > --- a/include/uapi/linux/fs.h > +++ b/include/uapi/linux/fs.h > @@ -39,9 +39,7 @@ > #define SEEK_HOLE 4 /* seek to the next hole */ > #define SEEK_MAX SEEK_HOLE > =20 > -#define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */ > -#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */ > -#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */ > +#include > =20 > struct file_clone_range { > __s64 src_fd; > diff --git a/include/uapi/linux/rename-flags.h b/include/uapi/linux/renam= e-flags.h > new file mode 100644 > index 000000000000..7178f0565657 > --- /dev/null > +++ b/include/uapi/linux/rename-flags.h > @@ -0,0 +1,12 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > +#ifndef _UAPI_LINUX_RENAME_FLAGS_H > +#define _UAPI_LINUX_RENAME_FLAGS_H > + > +/* > + * Definitions for rename syscall family. > + */ > +#define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */ > +#define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */ > +#define RENAME_WHITEOUT (1 << 2) /* Whiteout source */ > + > +#endif /* _UAPI_LINUX_RENAME_FLAGS_H */ > --=20 > 2.17.1