Linux 2.6.17.7
[linux/fpc-iii.git] / init / do_mounts.h
blobe0a7ac9649e1e4c10c080a7691744ce62e6bc497
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>
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;
18 #ifdef CONFIG_DEVFS_FS
20 void mount_devfs(void);
21 void umount_devfs(char *path);
22 int create_dev(char *name, dev_t dev, char *devfs_name);
24 #else
26 static inline void mount_devfs(void) {}
27 static inline void umount_devfs(const char *path) {}
29 static inline int create_dev(char *name, dev_t dev, char *devfs_name)
31 sys_unlink(name);
32 return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
35 #endif
37 #if BITS_PER_LONG == 32
38 static inline u32 bstat(char *name)
40 struct stat64 stat;
41 if (sys_stat64(name, &stat) != 0)
42 return 0;
43 if (!S_ISBLK(stat.st_mode))
44 return 0;
45 if (stat.st_rdev != (u32)stat.st_rdev)
46 return 0;
47 return stat.st_rdev;
49 #else
50 static inline u32 bstat(char *name)
52 struct stat stat;
53 if (sys_newstat(name, &stat) != 0)
54 return 0;
55 if (!S_ISBLK(stat.st_mode))
56 return 0;
57 return stat.st_rdev;
59 #endif
61 #ifdef CONFIG_BLK_DEV_RAM
63 int __init rd_load_disk(int n);
64 int __init rd_load_image(char *from);
66 #else
68 static inline int rd_load_disk(int n) { return 0; }
69 static inline int rd_load_image(char *from) { return 0; }
71 #endif
73 #ifdef CONFIG_BLK_DEV_INITRD
75 int __init initrd_load(void);
77 #else
79 static inline int initrd_load(void) { return 0; }
81 #endif
83 #ifdef CONFIG_BLK_DEV_MD
85 void md_run_setup(void);
87 #else
89 static inline void md_run_setup(void) {}
91 #endif