From patchwork Mon Sep 20 09:56:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaelan Steele X-Patchwork-Id: 12505023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9A8AC4332F for ; Mon, 20 Sep 2021 09:57:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B90D360FBF for ; Mon, 20 Sep 2021 09:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232938AbhITJ7B (ORCPT ); Mon, 20 Sep 2021 05:59:01 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:50207 "EHLO wout4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231929AbhITJ7A (ORCPT ); Mon, 20 Sep 2021 05:59:00 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 20DA43202562; Mon, 20 Sep 2021 05:57:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 20 Sep 2021 05:57:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canishe.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=fzxVNUji38DpJbP6LjRwH3G943 FyfuC6dm8NxaQ7CXA=; b=KpbGNuGooDlzxeMYo2QgK+Ds6KK5thKZRPtuRYXxtM q2cJZIflym5vw1DFtN588N+EzO7aBbcrtbH6eWO7DpE59YQNkw+AKRiZUFak6HuA FMfJs0gdVfYKuUoGhf3jeEiWxqQFhQ6/G3ojcd4CYWruWFvv5OkbJapBxkbEqPR5 5DiUHp/2tLX7dnr8yFCNWmmKC0P/ki/ZwhKsyEw0VB/uBsqjk5yAJ43c+l9kh66F I5k51PNJ9iFlMwX8GT+L4OW0cSrrOl26cBgNjD89UkEY7/CBlfiChpn7r/lnWPGD 8l+GBTh3b1r1oa6AaQOrkv3PqPy0xGKfr6qUIytbn1iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=fzxVNUji38DpJbP6L jRwH3G943FyfuC6dm8NxaQ7CXA=; b=dicaiQtZZqj5Vcyazw643YzGUPFIynh0w Jp/mczHJURDKpmbwzuBKFkRmlANCfWa8cpnTCWi7KDO0JsNy6eHB8gPo0bSXL1EN HEy3jTL52LNps6bISoNdYhhds4h+uaJKgrMm6tdygQVawu22HyxI88snSc6iNKd4 mlspv1vmCyMtmM/FKzQgpuCY8ii0v2IuNRPA4fkQ248yGa6zYIung0Paf8XHEweJ 60my4ZK8rJJnXu0GBZFk++GHtvMaWlGSHgpoEW5jwbd0yUI+6e9q82FogIHF6noj B3LISFfgwvkJjN3L39SpSuaIOV0jSUbTOQrum8CwNyEMaq93lJ6og== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeivddgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefirggvlhgrnhcu ufhtvggvlhgvuceoghgsshestggrnhhishhhvgdrtghomheqnecuggftrfgrthhtvghrnh epkedujefgkedtvddttdfgvdejteelheethedukeevheefveefgedthfdtfeetgfeunecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghgsshestg grnhhishhhvgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Sep 2021 05:57:31 -0400 (EDT) From: Gaelan Steele To: Alexander Viro Cc: linux-man@vger.kernel.org, Michael Kerrisk , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Gaelan Steele Subject: [PATCH 1/2] fs: move struct linux_dirent into headers Date: Mon, 20 Sep 2021 10:56:48 +0100 Message-Id: <20210920095649.28600-1-gbs@canishe.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Move the definition of linux_dirent to include/linux/dirent.h, where the newer linux_dirent64 already lives. This is done in preparation for moving both of these struct definitions into uapi/ so userspace code doesn't need to duplicate them. Signed-off-by: Gaelan Steele --- fs/readdir.c | 8 +------- include/linux/dirent.h | 7 +++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/readdir.c b/fs/readdir.c index 09e8ed7d4161..51890aeafc53 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -202,14 +202,8 @@ SYSCALL_DEFINE3(old_readdir, unsigned int, fd, /* * New, all-improved, singing, dancing, iBCS2-compliant getdents() - * interface. + * interface. */ -struct linux_dirent { - unsigned long d_ino; - unsigned long d_off; - unsigned short d_reclen; - char d_name[1]; -}; struct getdents_callback { struct dir_context ctx; diff --git a/include/linux/dirent.h b/include/linux/dirent.h index 99002220cd45..48e119dd3694 100644 --- a/include/linux/dirent.h +++ b/include/linux/dirent.h @@ -2,6 +2,13 @@ #ifndef _LINUX_DIRENT_H #define _LINUX_DIRENT_H +struct linux_dirent { + unsigned long d_ino; + unsigned long d_off; + unsigned short d_reclen; + char d_name[1]; +}; + struct linux_dirent64 { u64 d_ino; s64 d_off; From patchwork Mon Sep 20 09:56:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaelan Steele X-Patchwork-Id: 12505025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF33FC433EF for ; Mon, 20 Sep 2021 09:58:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A850C60F6C for ; Mon, 20 Sep 2021 09:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232993AbhITJ7Z (ORCPT ); Mon, 20 Sep 2021 05:59:25 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:56407 "EHLO wout4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235312AbhITJ7L (ORCPT ); Mon, 20 Sep 2021 05:59:11 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D8CF232025CE; Mon, 20 Sep 2021 05:57:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 20 Sep 2021 05:57:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canishe.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=gZ88mz0rW7L9h 2hm6YlM1b+UyvR0muQml9/fmkII5yI=; b=a0CWsQ1fs9Tfzhi2KKrT4c7TfO2Nn mu0866qyaweF3e8rHiGIJ4DOJWL3UdegrdrwEjkjXePMtZGiuGUqrHCTXyi5C1um Mq1NKp63aRqyC4yrVkMo6/tazKCG8OUNs/sc4CkaRSLUti0iVbU417WON2viy8Y1 rn3Vjwtnp2qevleQvLmNEV+Z6VdeAsuharbJzsDF5cRgFWD5a7DSWDH6fBCECcAd UtzslhY/RgZJ8PJl3W7aC2eUHoNNJd7rhWpiAufdKjsRfDOWkQWlkW43MlXXNVDS +AejGCBLjWX0x36K4BezBpHk1oR7vGNn5n3iJ87DMSHhQjVk+ySSk1/9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=gZ88mz0rW7L9h2hm6YlM1b+UyvR0muQml9/fmkII5yI=; b=s6XSY8wM nLFqb8CVtEpVYEpXnp7zlBhtpB9lXgmYVmCkBEM81GGHUQeyAt4NQGKnY0jB7ay6 0EiDIpbzC4CaG/rMaZ/N9UdZ/iXqjvDUNt2L4rQAIBJ1MbkLYEJDSJzT0Uhc7Tb4 nd5m+unopTE0k8bW87R7UTQmqlbrHr+Bm19mY+WP6Vsk8xJciVufV1iFDBxu0N3s U/gHfUmebmIvBy5MhqLUyEW5tNICtLXpulq2uXkBpj3QKlnxYMjPdCLHPxRQM2A4 Nt2kUwLY2PdzsZ/gITWsHYooCgSLxLWOEP7oArcA5CDaFCGKDRg0RxbGfkXmg4yn NRS7Bz9O5VVxxA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeivddgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefirggvlhgr nhcuufhtvggvlhgvuceoghgsshestggrnhhishhhvgdrtghomheqnecuggftrfgrthhtvg hrnhepuefhleeuffdulefhteehheffieekuddvleejieeliefhieeujefgudeujeehkedv necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghgssh estggrnhhishhhvgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Sep 2021 05:57:43 -0400 (EDT) From: Gaelan Steele To: Alexander Viro Cc: linux-man@vger.kernel.org, Michael Kerrisk , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Gaelan Steele Subject: [PATCH 2/2] fs: move dirent.h into uapi Date: Mon, 20 Sep 2021 10:56:49 +0100 Message-Id: <20210920095649.28600-2-gbs@canishe.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20210920095649.28600-1-gbs@canishe.com> References: <20210920095649.28600-1-gbs@canishe.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The structures defined in dirent.h are part of Linux's uAPI, but it was previously necessary for user code to duplicate the struct definitions themselves. Let's make them public. Signed-off-by: Gaelan Steele --- include/{ => uapi}/linux/dirent.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename include/{ => uapi}/linux/dirent.h (66%) diff --git a/include/linux/dirent.h b/include/uapi/linux/dirent.h similarity index 66% rename from include/linux/dirent.h rename to include/uapi/linux/dirent.h index 48e119dd3694..99293c651612 100644 --- a/include/linux/dirent.h +++ b/include/uapi/linux/dirent.h @@ -1,6 +1,6 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _LINUX_DIRENT_H -#define _LINUX_DIRENT_H +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_DIRENT_H +#define _UAPI_LINUX_DIRENT_H struct linux_dirent { unsigned long d_ino;