do_mounts.h 1.11 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
#include <linux/kernel.h>
2
#include <linux/blkdev.h>
Linus Torvalds's avatar
Linus Torvalds committed
3 4 5 6 7 8 9 10 11 12 13 14 15
#include <linux/init.h>
#include <linux/syscalls.h>
#include <linux/unistd.h>
#include <linux/slab.h>
#include <linux/mount.h>
#include <linux/major.h>
#include <linux/root_dev.h>

void  change_floppy(char *fmt, ...);
void  mount_block_root(char *name, int flags);
void  mount_root(void);
extern int root_mountflags;

16
static inline int create_dev(char *name, dev_t dev)
Linus Torvalds's avatar
Linus Torvalds committed
17 18 19 20 21 22 23
{
	sys_unlink(name);
	return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
}

static inline u32 bstat(char *name)
{
24 25
	struct kstat stat;
	if (vfs_stat(name, &stat) != 0)
Linus Torvalds's avatar
Linus Torvalds committed
26
		return 0;
27
	if (!S_ISBLK(stat.mode))
Linus Torvalds's avatar
Linus Torvalds committed
28
		return 0;
29
	return stat.rdev;
Linus Torvalds's avatar
Linus Torvalds committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
}

#ifdef CONFIG_BLK_DEV_RAM

int __init rd_load_disk(int n);
int __init rd_load_image(char *from);

#else

static inline int rd_load_disk(int n) { return 0; }
static inline int rd_load_image(char *from) { return 0; }

#endif

#ifdef CONFIG_BLK_DEV_INITRD

46
bool __init initrd_load(void);
Linus Torvalds's avatar
Linus Torvalds committed
47 48 49

#else

50
static inline bool initrd_load(void) { return false; }
Linus Torvalds's avatar
Linus Torvalds committed
51 52 53 54 55 56 57 58 59 60 61 62

#endif

#ifdef CONFIG_BLK_DEV_MD

void md_run_setup(void);

#else

static inline void md_run_setup(void) {}

#endif