Commit 8fb9f73e5a539ab3aa4785f30fb52c65fa98600c
1 parent
09267defa3
Exists in
smarc_imx_lf-5.15.y
and in
7 other branches
init: add an init_unlink helper
Add a simple helper to unlink with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_unlink. Signed-off-by: Christoph Hellwig <hch@lst.de>
Showing 7 changed files with 12 additions and 12 deletions Side-by-side Diff
fs/init.c
include/linux/init_syscalls.h
include/linux/syscalls.h
... | ... | @@ -1273,13 +1273,6 @@ |
1273 | 1273 | * The following kernel syscall equivalents are just wrappers to fs-internal |
1274 | 1274 | * functions. Therefore, provide stubs to be inlined at the callsites. |
1275 | 1275 | */ |
1276 | -extern long do_unlinkat(int dfd, struct filename *name); | |
1277 | - | |
1278 | -static inline long ksys_unlink(const char __user *pathname) | |
1279 | -{ | |
1280 | - return do_unlinkat(AT_FDCWD, getname(pathname)); | |
1281 | -} | |
1282 | - | |
1283 | 1276 | long do_rmdir(int dfd, struct filename *name); |
1284 | 1277 | |
1285 | 1278 | static inline long ksys_rmdir(const char __user *pathname) |
init/do_mounts.h
init/do_mounts_initrd.c
... | ... | @@ -137,12 +137,12 @@ |
137 | 137 | * mounted in the normal path. |
138 | 138 | */ |
139 | 139 | if (rd_load_image("/initrd.image") && ROOT_DEV != Root_RAM0) { |
140 | - ksys_unlink("/initrd.image"); | |
140 | + init_unlink("/initrd.image"); | |
141 | 141 | handle_initrd(); |
142 | 142 | return true; |
143 | 143 | } |
144 | 144 | } |
145 | - ksys_unlink("/initrd.image"); | |
145 | + init_unlink("/initrd.image"); | |
146 | 146 | return false; |
147 | 147 | } |
init/do_mounts_rd.c
init/initramfs.c
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | #include <linux/file.h> |
13 | 13 | #include <linux/memblock.h> |
14 | 14 | #include <linux/namei.h> |
15 | +#include <linux/init_syscalls.h> | |
15 | 16 | |
16 | 17 | static ssize_t __init xwrite(struct file *file, const char *p, size_t count, |
17 | 18 | loff_t *pos) |
... | ... | @@ -301,7 +302,7 @@ |
301 | 302 | if (S_ISDIR(st.mode)) |
302 | 303 | ksys_rmdir(path); |
303 | 304 | else |
304 | - ksys_unlink(path); | |
305 | + init_unlink(path); | |
305 | 306 | } |
306 | 307 | } |
307 | 308 |