Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1915503pxb; Mon, 20 Sep 2021 08:06:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIY4DEZ5AIy1V+gRDkSTpEHtd/pmc5+nCgnYsbGyalQB6fx4HxL5qLZ/Ayu8G/LpEG1rjb X-Received: by 2002:a17:907:2658:: with SMTP id ar24mr30004248ejc.329.1632150380098; Mon, 20 Sep 2021 08:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632150380; cv=none; d=google.com; s=arc-20160816; b=noEsV3VgXNgacwPq/waT0GrGEarxT99F9cYq0oUXyh2SMg5i91w7O3AzDjpkZ3+Lfj DmFP6//pa/POhEXT3s9Opjo71Jaxtx16rpSDmKUpYbe02Aj+UsSMSB69L9baqRV9JX9l GwDhmz4nJSzQ6kqzgQmZHHswRBqkhrtugQWU2wUEFCTtKDw4hYra6UGnfSCdB155cK0Q F9lJwqGBzoSsXTfLc3+nbmxmFWaqbNK6CNUdznPRzlt7Kt3lUZaXMYzTflodYySv5vRI /ez9w5OBygsa3ildOJI0Qd54IwG+MScEl3zt91NyxrxteUPtVwv0w+MK2jBiqWO7qgGg As6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rChs5/Vl6IiUulFx+EO8Xr1saZf7rsrBIOZExImAM6M=; b=cyUrxw4MHv7WvKOLAz6ZVak38gJnC75jS0u4tkz2Gns/2PkV2Ygp4rYlI6ntgtCka/ 5VjgyZKT0Yt2MbvYwzdaq3SOVGGtZs3P3f0y4a3OtyWJAnr17yD1KySNKW1mYR3mbuvW raWIHBFVmr2qT/6NSt61bVDGd2cfXK1CmNwI4jI9RaxAodc3+Nj1AWZIXvvx4v3ISOS+ WCe0M+WKPpSzD6pedbGkMsYJpFwKT0EckKpn/dvGN5quteslLvZcBEUSXHQk7sX8G5Ke DwQdkBaJtDj9eY3Es6VjFuUTmaczzIK6QZ37Jpj5pT+jJGf1cGGKSmOu4XZQnuxTBHUO 9nNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dkZ2epxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si16466074edv.472.2021.09.20.08.05.35; Mon, 20 Sep 2021 08:06:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dkZ2epxC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232478AbhITKIE (ORCPT + 99 others); Mon, 20 Sep 2021 06:08:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:46718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbhITKIC (ORCPT ); Mon, 20 Sep 2021 06:08:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF671600D4; Mon, 20 Sep 2021 10:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632132396; bh=Y9K2peoP+053qe709BSIBNv+PSkuEnDu9beMJCEm1kc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dkZ2epxCWQxx9jGPfmKG17yir0Al78Bj8bxw0HJyH1jiDCtaQSMGtqhObnPzzvMpK 4V+BJYy+XemFXhVNC06d9O/SNjIZ99+fHu16NpYET3vJuvOZi3DtwYPiXrrP7JT8pA ZevrqQ1u94LO2H51eSLSYqKePMLKurQCKfR3vxKI= Date: Mon, 20 Sep 2021 12:06:33 +0200 From: Greg KH To: Gaelan Steele Cc: Alexander Viro , linux-man@vger.kernel.org, Michael Kerrisk , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH 1/2] fs: move struct linux_dirent into headers Message-ID: References: <20210920095649.28600-1-gbs@canishe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210920095649.28600-1-gbs@canishe.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 20, 2021 at 10:56:48AM +0100, Gaelan Steele wrote: > 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]; These are not valid user/kernel api types. If you want them in userspace, please use the correct ones (__u64, __u16, __u8, etc.) thanks, greg k-h