From patchwork Wed Nov 14 07:13:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 997497 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-97225-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="SprAHt0+"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=CAVIUMNETWORKS.onmicrosoft.com header.i=@CAVIUMNETWORKS.onmicrosoft.com header.b="YciM1raX"; 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 42vwj62LZLz9s7T for ; Wed, 14 Nov 2018 18:14:17 +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=Ego0gpkfp4oRa5SiqZ0stUDJrDEs6mGWFppE5QO5crJVBBXX4Ula/ bQDH35Z94aO3C23zZeKH3t455FIeGgcRfcl2uMcyrVIcYMmeZ2Y/OLEDJHJqrqC1 78Dm/hZpgIzW2xYsulyQjegcTynnq+/zfxSVpxhZOW9FNnflLw5O+w= 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=hAocvsKKMhk1/jTIOivBeAetr0Q=; b=SprAHt0+77IsVRUK1PNFUYKyjicA upktrBmc62GkhbbgT2+70/gmOt3UKS0Q8k1EEdiDl98WSOIC+cxhJ1ZKxBfC9J1p L61RfDiN+vHnmQUid69i7lIeHGsxm5w4g9UfEjJxfbr8pEs5WyyX2k1fuQBuUUXh CaojOvvvsTrZtfM= Received: (qmail 118241 invoked by alias); 14 Nov 2018 07:14:04 -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 118223 invoked by uid 89); 14 Nov 2018 07:14:03 -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= X-HELO: NAM03-CO1-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=Ji7E1PoSw62OepkWFOb+ouND7MoV9wYdADzZNPgSVig=; b=YciM1raXZmQA2OYKSHeytE/sGxvSUFlWMPUl2RswswMAIebzjcHfDHRAlnko153TgFxRMszAZ189or/N/1oSiTE6Rm968NAPeOi2zw8t9IMvQCWAI1d6ztp4cCMFEEYWzQYyjoNdjixer63H7PSkmm+S7LmHlIMIpf+oXHeb0kE= 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 v2] UAPI: move RENAME_* definitions to separated file Date: Wed, 14 Nov 2018 07:13:55 +0000 Message-ID: <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) 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 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 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_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 */