blob: 66548efe4c3c7e8d94fd283c1bb875fa6b69e358 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/config.h>
2#include <linux/kernel.h>
3#include <linux/devfs_fs_kernel.h>
4#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;
16extern char *root_device_name;
17
Greg Kroah-Hartmanbdaf8522005-06-20 21:15:16 -070018static inline int create_dev(char *name, dev_t dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070019{
20 sys_unlink(name);
21 return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
22}
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#if BITS_PER_LONG == 32
25static inline u32 bstat(char *name)
26{
27 struct stat64 stat;
28 if (sys_stat64(name, &stat) != 0)
29 return 0;
30 if (!S_ISBLK(stat.st_mode))
31 return 0;
32 if (stat.st_rdev != (u32)stat.st_rdev)
33 return 0;
34 return stat.st_rdev;
35}
36#else
37static inline u32 bstat(char *name)
38{
39 struct stat stat;
40 if (sys_newstat(name, &stat) != 0)
41 return 0;
42 if (!S_ISBLK(stat.st_mode))
43 return 0;
44 return stat.st_rdev;
45}
46#endif
47
48#ifdef CONFIG_BLK_DEV_RAM
49
50int __init rd_load_disk(int n);
51int __init rd_load_image(char *from);
52
53#else
54
55static inline int rd_load_disk(int n) { return 0; }
56static inline int rd_load_image(char *from) { return 0; }
57
58#endif
59
60#ifdef CONFIG_BLK_DEV_INITRD
61
62int __init initrd_load(void);
63
64#else
65
66static inline int initrd_load(void) { return 0; }
67
68#endif
69
70#ifdef CONFIG_BLK_DEV_MD
71
72void md_run_setup(void);
73
74#else
75
76static inline void md_run_setup(void) {}
77
78#endif