blob: 7a29ac3e427baba4650bd7ac7f1749f937aa59c6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#include <linux/kernel.h>
NeilBrownbff61972009-03-31 14:33:13 +11003#include <linux/blkdev.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <linux/init.h>
5#include <linux/syscalls.h>
6#include <linux/unistd.h>
7#include <linux/slab.h>
8#include <linux/mount.h>
9#include <linux/major.h>
10#include <linux/root_dev.h>
Christoph Hellwigc60166f2020-07-21 11:12:08 +020011#include <linux/init_syscalls.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013void mount_block_root(char *name, int flags);
14void mount_root(void);
15extern int root_mountflags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Christoph Hellwig09cbcec2020-07-21 12:20:16 +020017static inline __init int create_dev(char *name, dev_t dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070018{
Christoph Hellwig8fb9f732020-07-23 08:23:40 +020019 init_unlink(name);
Christoph Hellwig5fee64f2020-07-22 11:41:20 +020020 return init_mknod(name, S_IFBLK | 0600, new_encode_dev(dev));
Linus Torvalds1da177e2005-04-16 15:20:36 -070021}
22
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#ifdef CONFIG_BLK_DEV_RAM
24
25int __init rd_load_disk(int n);
26int __init rd_load_image(char *from);
27
28#else
29
30static inline int rd_load_disk(int n) { return 0; }
31static inline int rd_load_image(char *from) { return 0; }
32
33#endif
34
35#ifdef CONFIG_BLK_DEV_INITRD
36
Yaowei Baif057f3b2016-01-20 14:59:29 -080037bool __init initrd_load(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39#else
40
Yaowei Baif057f3b2016-01-20 14:59:29 -080041static inline bool initrd_load(void) { return false; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43#endif