Blame view

init/do_mounts.h 1.15 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
  #include <linux/kernel.h>
bff61975b   NeilBrown   md: move lots of ...
3
  #include <linux/blkdev.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
4
5
6
7
8
9
10
  #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>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
12
13
14
  void  change_floppy(char *fmt, ...);
  void  mount_block_root(char *name, int flags);
  void  mount_root(void);
  extern int root_mountflags;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
15

bdaf85293   Greg Kroah-Hartman   [PATCH] devfs: Re...
16
  static inline int create_dev(char *name, dev_t dev)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
17
18
19
20
  {
  	sys_unlink(name);
  	return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
21
22
  static inline u32 bstat(char *name)
  {
046aa1265   Arnd Bergmann   initramfs: use vf...
23
24
  	struct kstat stat;
  	if (vfs_stat(name, &stat) != 0)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
25
  		return 0;
046aa1265   Arnd Bergmann   initramfs: use vf...
26
  	if (!S_ISBLK(stat.mode))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
  		return 0;
046aa1265   Arnd Bergmann   initramfs: use vf...
28
  	return stat.rdev;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
29
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  
  #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
f057f3b22   Yaowei Bai   init/do_mounts: i...
44
  bool __init initrd_load(void);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
45
46
  
  #else
f057f3b22   Yaowei Bai   init/do_mounts: i...
47
  static inline bool initrd_load(void) { return false; }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
48
49
50
51
52
53
54
55
56
57
58
59
  
  #endif
  
  #ifdef CONFIG_BLK_DEV_MD
  
  void md_run_setup(void);
  
  #else
  
  static inline void md_run_setup(void) {}
  
  #endif