From patchwork Wed Nov 14 07:26:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 30142 Received: (qmail 128033 invoked by alias); 14 Nov 2018 07:26:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 128016 invoked by uid 89); 14 Nov 2018 07:26:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: NAM04-BN3-obe.outbound.protection.outlook.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7tHiuUp39tpByBVR2CRCLTzFMJR3GVaFklE49BKPWto=; b=J9KNV+EgUPDz+tiY01d0ipHV+Dr+c2GCSaeCV0QHMflDodzCH8hMwAPjTDqGdu2YY41tcXAekqkPJ/xlfS2bbNdeN66z3mmYLnQMKVSzkfF2BxHEb9/sJccdiHCZmGu/TLi3o9fQEwBGbk8WrQ/AThLlfingobARdxjiIJI8Zjw= From: Yury Norov 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" Subject: Re: [PATCH v2] UAPI: move RENAME_* definitions to separated file Date: Wed, 14 Nov 2018 07:26:07 +0000 Message-ID: <20181114072559.GA16695@yury-thinkpad> References: <20181114071346.31210-1-ynorov@caviumnetworks.com> In-Reply-To: <20181114071346.31210-1-ynorov@caviumnetworks.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Content-ID: <3D1644F668FEBB4682C6DE6611F7C69B@namprd07.prod.outlook.com> MIME-Version: 1.0 Hi all, It seems that I forgot to rename guards in v2. This is the correct version. My apologize for noise. Yury 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 Discussion: https://lore.kernel.org/lkml/20180702084622.GA15274@yury-thinkpad/ 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: As Florian Weimer wrote: > undefines and defines macros not mentioned in the standards > (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. In this patch RENAME_* is removed to a separated header file that conforms the standards and therefore is suitable for inclusion by glibc. v2: - rename dedicated file to 'rename-flags.h', as requested by Florian. 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 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 -#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 struct file_clone_range { __s64 src_fd; diff --git a/include/uapi/linux/rename-flags.h b/include/uapi/linux/rename-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 */