Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | void change_floppy(char *fmt, ...); |
| 13 | void mount_block_root(char *name, int flags); |
| 14 | void mount_root(void); |
| 15 | extern int root_mountflags; |
| 16 | extern char *root_device_name; |
| 17 | |
Greg Kroah-Hartman | bdaf852 | 2005-06-20 21:15:16 -0700 | [diff] [blame^] | 18 | static inline int create_dev(char *name, dev_t dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | { |
| 20 | sys_unlink(name); |
| 21 | return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev)); |
| 22 | } |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #if BITS_PER_LONG == 32 |
| 25 | static 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 |
| 37 | static 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 | |
| 50 | int __init rd_load_disk(int n); |
| 51 | int __init rd_load_image(char *from); |
| 52 | |
| 53 | #else |
| 54 | |
| 55 | static inline int rd_load_disk(int n) { return 0; } |
| 56 | static inline int rd_load_image(char *from) { return 0; } |
| 57 | |
| 58 | #endif |
| 59 | |
| 60 | #ifdef CONFIG_BLK_DEV_INITRD |
| 61 | |
| 62 | int __init initrd_load(void); |
| 63 | |
| 64 | #else |
| 65 | |
| 66 | static inline int initrd_load(void) { return 0; } |
| 67 | |
| 68 | #endif |
| 69 | |
| 70 | #ifdef CONFIG_BLK_DEV_MD |
| 71 | |
| 72 | void md_run_setup(void); |
| 73 | |
| 74 | #else |
| 75 | |
| 76 | static inline void md_run_setup(void) {} |
| 77 | |
| 78 | #endif |