aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-07-28 17:49:47 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2020-08-04 21:02:38 -0400
commitf073531070d24bbb82cb2658952d949f4851024b (patch)
tree064d6a4ec00df1fe854f6266e6e14432126ca2c8 /init
parent235e57935bf328c4cce371ffc4dd1d8fab4885cd (diff)
init: add an init_dup helper
Add a simple helper to grab a reference to a file and install it at the next available fd, and switch the early init code over to it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'init')
-rw-r--r--init/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/init/main.c b/init/main.c
index 1c710d3e1d46..9dae9c4f806b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1467,10 +1467,10 @@ void __init console_on_rootfs(void)
pr_err("Warning: unable to open an initial console.\n");
return;
}
- get_file_rcu_many(file, 2);
- fd_install(get_unused_fd_flags(0), file);
- fd_install(get_unused_fd_flags(0), file);
- fd_install(get_unused_fd_flags(0), file);
+ init_dup(file);
+ init_dup(file);
+ init_dup(file);
+ fput(file);
}
static noinline void __init kernel_init_freeable(void)