]> bbs.cooldavid.org Git - net-next-2.6.git/blame - init/do_mounts.h
[PATCH] devfs: Remove devfs from the partition code
[net-next-2.6.git] / init / do_mounts.h
CommitLineData
1da177e4
LT
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
1da177e4
LT
12void 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
18#ifdef CONFIG_DEVFS_FS
19
20void mount_devfs(void);
21void umount_devfs(char *path);
22int create_dev(char *name, dev_t dev, char *devfs_name);
23
24#else
25
26static inline void mount_devfs(void) {}
27static inline void umount_devfs(const char *path) {}
28
29static inline int create_dev(char *name, dev_t dev, char *devfs_name)
30{
31 sys_unlink(name);
32 return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
33}
34
35#endif
36
37#if BITS_PER_LONG == 32
38static inline u32 bstat(char *name)
39{
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;
48}
49#else
50static inline u32 bstat(char *name)
51{
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;
58}
59#endif
60
61#ifdef CONFIG_BLK_DEV_RAM
62
63int __init rd_load_disk(int n);
64int __init rd_load_image(char *from);
65
66#else
67
68static inline int rd_load_disk(int n) { return 0; }
69static inline int rd_load_image(char *from) { return 0; }
70
71#endif
72
73#ifdef CONFIG_BLK_DEV_INITRD
74
75int __init initrd_load(void);
76
77#else
78
79static inline int initrd_load(void) { return 0; }
80
81#endif
82
83#ifdef CONFIG_BLK_DEV_MD
84
85void md_run_setup(void);
86
87#else
88
89static inline void md_run_setup(void) {}
90
91#endif