All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gaelan Steele <gbs@canishe.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-man@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, Gaelan Steele <gbs@canishe.com>
Subject: [PATCH 1/2] fs: move struct linux_dirent into headers
Date: Mon, 20 Sep 2021 10:56:48 +0100	[thread overview]
Message-ID: <20210920095649.28600-1-gbs@canishe.com> (raw)

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 <gbs@canishe.com>
---
 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;
-- 
2.30.1 (Apple Git-130)


             reply	other threads:[~2021-09-20  9:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  9:56 Gaelan Steele [this message]
2021-09-20  9:56 ` [PATCH 2/2] fs: move dirent.h into uapi Gaelan Steele
2021-09-20 10:06 ` [PATCH 1/2] fs: move struct linux_dirent into headers Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210920095649.28600-1-gbs@canishe.com \
    --to=gbs@canishe.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.