blob: 50d6c8941e15a1e68ca19b033d4b20dc9aa704d5 [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>
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012void change_floppy(char *fmt, ...);
13void mount_block_root(char *name, int flags);
14void mount_root(void);
15extern int root_mountflags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Greg Kroah-Hartmanbdaf8522005-06-20 21:15:16 -070017static inline int create_dev(char *name, dev_t dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070018{
Dominik Brodowski0f32ab82018-03-11 11:34:47 +010019 ksys_unlink(name);
Dominik Brodowski87c4e192018-03-11 11:34:50 +010020 return ksys_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