From patchwork Tue Nov 13 08:51:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 996953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-97200-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=caviumnetworks.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="TlSx0RRZ"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=CAVIUMNETWORKS.onmicrosoft.com header.i=@CAVIUMNETWORKS.onmicrosoft.com header.b="SrPFiTBw"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42vLvf3wfPz9s3x for ; Tue, 13 Nov 2018 19:51:25 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=AdoIG3wLuO3AGwN2JC3z5TZntHdZ9vmh0P68QQarERbh7cStCk9ON d62cdwXNtjpl0O+PR+/ELSBnpyb+DWzVQFn+3CaFlxJxSaiKD3XvUk/7RaL409Xn hjXaIJI/Jkf0zGpYBwm/AXrQ1RUSwybki4KbkNSn/nJLVbJF0Ojad8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :content-type:content-transfer-encoding:mime-version; s=default; bh=exo2L0ds/A/586suVrqi8zLrcTI=; b=TlSx0RRZ9G1BM+baNx4ea+Ds7XIz 09ufwqeZPBEM99KpTtCSXsDC2nWQltZ4K82PLGFhQWjQZPgeq4/UfBeADXrOLzCA 7k6KhX6vLW6ARLtSUVB90jTPHZvW/DS1nrNibCNDO3xlvFvYYQVhblYjAKHeI/mj r16jB5DzppZUDvg= Received: (qmail 49239 invoked by alias); 13 Nov 2018 08:51:19 -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 49224 invoked by uid 89); 13 Nov 2018 08:51:18 -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, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=advisable, H*r:15.20.1294.045, sk:linuxs, Hx-spam-relays-external:15.20.1294.045 X-HELO: NAM02-CY1-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=UVQUu0R9RwdoJoKWLnfy1SA1D442bsK0Lhcxdk25WxM=; b=SrPFiTBw8fxY/abTaWhY+ageRywt3mzKs8lWCLMFNGHCKURU5izTJwm2RQI1SnSgRLGa6SpvYecMWbGhjvGNVX3SJxKyl000KlOS37ilqxwdZpBDgyMFRbd2J9yVhcmwsYQ+9Kg0efzBrokji6Y/gAR6ZomRgfxhsuR1P+n2bSY= 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: [PATCH RESEND] UAPI: move RENAME_* definitions to separated file Date: Tue, 13 Nov 2018 08:51:12 +0000 Message-ID: <20181113085102.3079-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) MIME-Version: 1.0 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 separated header file that conforms standards and therefore is suitable for inclusion by glibc. Signed-off-by: Yury Norov --- include/uapi/linux/fs.h | 4 +--- include/uapi/linux/rename.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 include/uapi/linux/rename.h diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 53a22e8e0408..dbf58bbf5bad 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -44,9 +44,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.h b/include/uapi/linux/rename.h new file mode 100644 index 000000000000..7178f0565657 --- /dev/null +++ b/include/uapi/linux/rename.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_RENAME_H +#define _UAPI_LINUX_RENAME_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_H */