Skip to content

Commit

Permalink
fs: remove ksys_open
Browse files Browse the repository at this point in the history
Just open code it in the two callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Hellwig committed Jul 31, 2020
1 parent fb2da16 commit 166e07c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
11 changes: 8 additions & 3 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,9 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)

SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
{
return ksys_open(filename, flags, mode);
if (force_o_largefile())
flags |= O_LARGEFILE;
return do_sys_open(AT_FDCWD, filename, flags, mode);
}

SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
Expand Down Expand Up @@ -1270,9 +1272,12 @@ COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, fla
*/
SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
{
return ksys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
}
int flags = O_CREAT | O_WRONLY | O_TRUNC;

if (force_o_largefile())
flags |= O_LARGEFILE;
return do_sys_open(AT_FDCWD, pathname, flags, mode);
}
#endif

/*
Expand Down
11 changes: 0 additions & 11 deletions include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -1374,17 +1374,6 @@ static inline int ksys_close(unsigned int fd)
return __close_fd(current->files, fd);
}

extern long do_sys_open(int dfd, const char __user *filename, int flags,
umode_t mode);

static inline long ksys_open(const char __user *filename, int flags,
umode_t mode)
{
if (force_o_largefile())
flags |= O_LARGEFILE;
return do_sys_open(AT_FDCWD, filename, flags, mode);
}

extern long do_sys_truncate(const char __user *pathname, loff_t length);

static inline long ksys_truncate(const char __user *pathname, loff_t length)
Expand Down

0 comments on commit 166e07c

Please sign in to comment.