Skip to content

Commit 166e07c

Browse files
author
Christoph Hellwig
committed
fs: remove ksys_open
Just open code it in the two callers. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Linus Torvalds <[email protected]>
1 parent fb2da16 commit 166e07c

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

fs/open.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,9 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
12081208

12091209
SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
12101210
{
1211-
return ksys_open(filename, flags, mode);
1211+
if (force_o_largefile())
1212+
flags |= O_LARGEFILE;
1213+
return do_sys_open(AT_FDCWD, filename, flags, mode);
12121214
}
12131215

12141216
SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
@@ -1270,9 +1272,12 @@ COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, fla
12701272
*/
12711273
SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
12721274
{
1273-
return ksys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
1274-
}
1275+
int flags = O_CREAT | O_WRONLY | O_TRUNC;
12751276

1277+
if (force_o_largefile())
1278+
flags |= O_LARGEFILE;
1279+
return do_sys_open(AT_FDCWD, pathname, flags, mode);
1280+
}
12761281
#endif
12771282

12781283
/*

include/linux/syscalls.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,17 +1374,6 @@ static inline int ksys_close(unsigned int fd)
13741374
return __close_fd(current->files, fd);
13751375
}
13761376

1377-
extern long do_sys_open(int dfd, const char __user *filename, int flags,
1378-
umode_t mode);
1379-
1380-
static inline long ksys_open(const char __user *filename, int flags,
1381-
umode_t mode)
1382-
{
1383-
if (force_o_largefile())
1384-
flags |= O_LARGEFILE;
1385-
return do_sys_open(AT_FDCWD, filename, flags, mode);
1386-
}
1387-
13881377
extern long do_sys_truncate(const char __user *pathname, loff_t length);
13891378

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

0 commit comments

Comments
 (0)