Skip to content

Commit 20cce02

Browse files
author
Christoph Hellwig
committed
init: add an init_rmdir helper
Add a simple helper to rmdir with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_rmdir. Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 8fb9f73 commit 20cce02

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

fs/init.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,8 @@ int __init init_unlink(const char *pathname)
4242
{
4343
return do_unlinkat(AT_FDCWD, getname_kernel(pathname));
4444
}
45+
46+
int __init init_rmdir(const char *pathname)
47+
{
48+
return do_rmdir(AT_FDCWD, getname_kernel(pathname));
49+
}

include/linux/init_syscalls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ int __init init_mount(const char *dev_name, const char *dir_name,
44
const char *type_page, unsigned long flags, void *data_page);
55
int __init init_umount(const char *name, int flags);
66
int __init init_unlink(const char *pathname);
7+
int __init init_rmdir(const char *pathname);

include/linux/syscalls.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,13 +1273,6 @@ int compat_ksys_ipc(u32 call, int first, int second,
12731273
* The following kernel syscall equivalents are just wrappers to fs-internal
12741274
* functions. Therefore, provide stubs to be inlined at the callsites.
12751275
*/
1276-
long do_rmdir(int dfd, struct filename *name);
1277-
1278-
static inline long ksys_rmdir(const char __user *pathname)
1279-
{
1280-
return do_rmdir(AT_FDCWD, getname(pathname));
1281-
}
1282-
12831276
extern long do_mkdirat(int dfd, const char __user *pathname, umode_t mode);
12841277

12851278
static inline long ksys_mkdir(const char __user *pathname, umode_t mode)

init/initramfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static void __init clean_path(char *path, umode_t fmode)
300300

301301
if (!vfs_lstat(path, &st) && (st.mode ^ fmode) & S_IFMT) {
302302
if (S_ISDIR(st.mode))
303-
ksys_rmdir(path);
303+
init_rmdir(path);
304304
else
305305
init_unlink(path);
306306
}

0 commit comments

Comments
 (0)