blob: 021e2f60223e25c832b55cf963596c8e083e7b55 [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 mount_block_root(char *name, int flags);
13void mount_root(void);
14extern int root_mountflags;
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Christoph Hellwig09cbcec2020-07-21 12:20:16 +020016static inline __init int create_dev(char *name, dev_t dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070017{
Dominik Brodowski0f32ab82018-03-11 11:34:47 +010018 ksys_unlink(name);
Dominik Brodowski87c4e192018-03-11 11:34:50 +010019 return ksys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
Linus Torvalds1da177e2005-04-16 15:20:36 -070020}
21
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#ifdef CONFIG_BLK_DEV_RAM
23
24int __init rd_load_disk(int n);
25int __init rd_load_image(char *from);
26
27#else
28
29static inline int rd_load_disk(int n) { return 0; }
30static inline int rd_load_image(char *from) { return 0; }
31
32#endif
33
34#ifdef CONFIG_BLK_DEV_INITRD
35
Yaowei Baif057f3b2016-01-20 14:59:29 -080036bool __init initrd_load(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38#else
39
Yaowei Baif057f3b2016-01-20 14:59:29 -080040static inline bool initrd_load(void) { return false; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42#endif