diff mbox series

[2/5] kill getname_statx_lookup_flags()

Message ID 20241112202552.3393751-2-viro@zeniv.linux.org.uk (mailing list archive)
State New
Headers show
Series [1/5] io_statx_prep(): use getname_uflags() | expand

Commit Message

Al Viro Nov. 12, 2024, 8:25 p.m. UTC
LOOKUP_EMPTY is ignored by the only remaining user, and without
that 'getname_' prefix makes no sense.

Remove LOOKUP_EMPTY part, rename to statx_lookup_flags() and make
static.  It most likely is _not_ statx() specific, either, but
that's the next step.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/internal.h | 1 -
 fs/stat.c     | 6 ++----
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

Christian Brauner Nov. 13, 2024, 10:20 a.m. UTC | #1
On Tue, Nov 12, 2024 at 08:25:49PM +0000, Al Viro wrote:
> LOOKUP_EMPTY is ignored by the only remaining user, and without
> that 'getname_' prefix makes no sense.
> 
> Remove LOOKUP_EMPTY part, rename to statx_lookup_flags() and make
> static.  It most likely is _not_ statx() specific, either, but
> that's the next step.
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---

Reviewed-by: Christian Brauner <brauner@kernel.org>
diff mbox series

Patch

diff --git a/fs/internal.h b/fs/internal.h
index 8c1b7acbbe8f..8cf42b327e5e 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -246,7 +246,6 @@  int open_namespace(struct ns_common *ns);
  * fs/stat.c:
  */
 
-int getname_statx_lookup_flags(int flags);
 int do_statx(int dfd, struct filename *filename, unsigned int flags,
 	     unsigned int mask, struct statx __user *buffer);
 int do_statx_fd(int fd, unsigned int flags, unsigned int mask,
diff --git a/fs/stat.c b/fs/stat.c
index b74831dc7ae6..4e8698fa932f 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -231,7 +231,7 @@  int vfs_fstat(int fd, struct kstat *stat)
 	return error;
 }
 
-int getname_statx_lookup_flags(int flags)
+static int statx_lookup_flags(int flags)
 {
 	int lookup_flags = 0;
 
@@ -239,8 +239,6 @@  int getname_statx_lookup_flags(int flags)
 		lookup_flags |= LOOKUP_FOLLOW;
 	if (!(flags & AT_NO_AUTOMOUNT))
 		lookup_flags |= LOOKUP_AUTOMOUNT;
-	if (flags & AT_EMPTY_PATH)
-		lookup_flags |= LOOKUP_EMPTY;
 
 	return lookup_flags;
 }
@@ -301,7 +299,7 @@  static int vfs_statx(int dfd, struct filename *filename, int flags,
 	      struct kstat *stat, u32 request_mask)
 {
 	struct path path;
-	unsigned int lookup_flags = getname_statx_lookup_flags(flags);
+	unsigned int lookup_flags = statx_lookup_flags(flags);
 	int error;
 
 	if (flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | AT_EMPTY_PATH |