do_mounts.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include <linux/kernel.h>
  2. #include <linux/blkdev.h>
  3. #include <linux/init.h>
  4. #include <linux/syscalls.h>
  5. #include <linux/unistd.h>
  6. #include <linux/slab.h>
  7. #include <linux/mount.h>
  8. #include <linux/major.h>
  9. #include <linux/root_dev.h>
  10. void change_floppy(char *fmt, ...);
  11. void mount_block_root(char *name, int flags);
  12. void mount_root(void);
  13. extern int root_mountflags;
  14. static inline int create_dev(char *name, dev_t dev)
  15. {
  16. sys_unlink(name);
  17. return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
  18. }
  19. static inline u32 bstat(char *name)
  20. {
  21. struct kstat stat;
  22. if (vfs_stat(name, &stat) != 0)
  23. return 0;
  24. if (!S_ISBLK(stat.mode))
  25. return 0;
  26. return stat.rdev;
  27. }
  28. #ifdef CONFIG_BLK_DEV_RAM
  29. int __init rd_load_disk(int n);
  30. int __init rd_load_image(char *from);
  31. #else
  32. static inline int rd_load_disk(int n) { return 0; }
  33. static inline int rd_load_image(char *from) { return 0; }
  34. #endif
  35. #ifdef CONFIG_BLK_DEV_INITRD
  36. bool __init initrd_load(void);
  37. #else
  38. static inline bool initrd_load(void) { return false; }
  39. #endif
  40. #ifdef CONFIG_BLK_DEV_MD
  41. void md_run_setup(void);
  42. #else
  43. static inline void md_run_setup(void) {}
  44. #endif