fs: add ksys_open() wrapper; remove in-kernel calls to sys_open()

Using this wrapper allows us to avoid the in-kernel calls to the
sys_open() syscall. The ksys_ prefix denotes that this function is meant
as a drop-in replacement for the syscall. In particular, it uses the
same calling convention as sys_open().

This patch is part of a series which removes in-kernel calls to syscalls.
On this basis, the syscall entry path can be streamlined. For details, see
http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Dominik Brodowski
2018-03-11 11:34:56 +01:00
szülő 2ca2a09d62
commit bae217ea8c
8 fájl változott, egészen pontosan 26 új sor hozzáadva és 15 régi sor törölve

Fájl megtekintése

@@ -181,7 +181,7 @@ static void __init md_setup_drive(void)
partitioned ? "_d" : "", minor,
md_setup_args[ent].device_names);
fd = sys_open(name, 0, 0);
fd = ksys_open(name, 0, 0);
if (fd < 0) {
printk(KERN_ERR "md: open failed - cannot start "
"array %s\n", name);
@@ -244,7 +244,7 @@ static void __init md_setup_drive(void)
* array without it
*/
ksys_close(fd);
fd = sys_open(name, 0, 0);
fd = ksys_open(name, 0, 0);
sys_ioctl(fd, BLKRRPART, 0);
}
ksys_close(fd);
@@ -294,7 +294,7 @@ static void __init autodetect_raid(void)
wait_for_device_probe();
fd = sys_open("/dev/md0", 0, 0);
fd = ksys_open("/dev/md0", 0, 0);
if (fd >= 0) {
sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
ksys_close(fd);