From patchwork Tue Jun 13 16:59:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 13279047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75C91EB64D0 for ; Tue, 13 Jun 2023 17:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235186AbjFMREm (ORCPT ); Tue, 13 Jun 2023 13:04:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbjFMREk (ORCPT ); Tue, 13 Jun 2023 13:04:40 -0400 Received: from out203-205-221-239.mail.qq.com (out203-205-221-239.mail.qq.com [203.205.221.239]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 067B2187; Tue, 13 Jun 2023 10:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1686675570; bh=wNAYrdR1DOgfCkW7Ui555prk70VUh+otMs+riDcq/LU=; h=From:To:Cc:Subject:Date; b=yF81Q2UOw0dmjZttica/woTHNAuLSKx7Xjtok6WRTocsDUtqtsyqv9mSXsRQtlx75 8FDeai+LFGnTdnMqM4wTdK6OUm+99EH6Rq/xxWXXtNb22hYEmcbbNqpSgYrU1aQfHB QYcLwvQNpfTvyd3bYMDVjaUxzBvHpu2Yem2ysdlI= Received: from localhost.localdomain ([240e:331:cc9:d200:8f2b:c42a:801a:dea9]) by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP id EDA2A833; Wed, 14 Jun 2023 00:59:26 +0800 X-QQ-mid: xmsmtpt1686675566tszwp6qrv Message-ID: X-QQ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M8O5+wMIBSXQ= X-QQ-XMAILREADINFO: N4rxuMuubwLvS7ommv0RDVk= From: wenyang.linux@foxmail.com To: Alexander Viro , Jens Axboe , Christian Brauner Cc: Wen Yang , Christoph Hellwig , Dylan Yudaken , David Woodhouse , Matthew Wilcox , Eric Biggers , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] eventfd: add a uapi header for eventfd userspace APIs Date: Wed, 14 Jun 2023 00:59:11 +0800 X-OQ-MSGID: <20230613165911.6703-1-wenyang.linux@foxmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: Wen Yang Create a uapi header include/uapi/linux/eventfd.h, move the associated flags to the uapi header, and include it from linux/eventfd.h. Suggested-by: Christian Brauner Signed-off-by: Wen Yang Cc: Alexander Viro Cc: Jens Axboe Cc: Christian Brauner Cc: Christoph Hellwig Cc: Dylan Yudaken Cc: David Woodhouse Cc: Matthew Wilcox Cc: Eric Biggers Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- include/linux/eventfd.h | 6 +----- include/uapi/linux/eventfd.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 include/uapi/linux/eventfd.h diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 98d31cdaca40..b9d83652c097 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h @@ -9,12 +9,12 @@ #ifndef _LINUX_EVENTFD_H #define _LINUX_EVENTFD_H -#include #include #include #include #include #include +#include /* * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining @@ -23,10 +23,6 @@ * from eventfd, in order to leave a free define-space for * shared O_* flags. */ -#define EFD_SEMAPHORE (1 << 0) -#define EFD_CLOEXEC O_CLOEXEC -#define EFD_NONBLOCK O_NONBLOCK - #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) diff --git a/include/uapi/linux/eventfd.h b/include/uapi/linux/eventfd.h new file mode 100644 index 000000000000..9b3eb6fb20c6 --- /dev/null +++ b/include/uapi/linux/eventfd.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_EVENTFD_H +#define _UAPI_LINUX_EVENTFD_H + +#include + +/* For O_CLOEXEC and O_NONBLOCK */ +#include + +#define EFD_SEMAPHORE (1 << 0) +#define EFD_CLOEXEC O_CLOEXEC +#define EFD_NONBLOCK O_NONBLOCK + +#endif /* _UAPI_LINUX_EVENTFD_H */