Skip to content

Commit

Permalink
kill getname_statx_lookup_flags()
Browse files Browse the repository at this point in the history
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.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Nov 13, 2024
1 parent 8e15e12 commit 88a2062
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion fs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions fs/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,14 @@ 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;

if (!(flags & AT_SYMLINK_NOFOLLOW))
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;
}
Expand Down Expand Up @@ -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 |
Expand Down

0 comments on commit 88a2062

Please sign in to comment.