do_mounts.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #if BITS_PER_LONG == 32
  20. static inline u32 bstat(char *name)
  21. {
  22. struct stat64 stat;
  23. if (sys_stat64(name, &stat) != 0)
  24. return 0;
  25. if (!S_ISBLK(stat.st_mode))
  26. return 0;
  27. if (stat.st_rdev != (u32)stat.st_rdev)
  28. return 0;
  29. return stat.st_rdev;
  30. }
  31. #else
  32. static inline u32 bstat(char *name)
  33. {
  34. struct stat stat;
  35. if (sys_newstat(name, &stat) != 0)
  36. return 0;
  37. if (!S_ISBLK(stat.st_mode))
  38. return 0;
  39. return stat.st_rdev;
  40. }
  41. #endif
  42. #ifdef CONFIG_BLK_DEV_RAM
  43. int __init rd_load_disk(int n);
  44. int __init rd_load_image(char *from);
  45. #else
  46. static inline int rd_load_disk(int n) { return 0; }
  47. static inline int rd_load_image(char *from) { return 0; }
  48. #endif
  49. #ifdef CONFIG_BLK_DEV_INITRD
  50. int __init initrd_load(void);
  51. #else
  52. static inline int initrd_load(void) { return 0; }
  53. #endif
  54. #ifdef CONFIG_BLK_DEV_MD
  55. void md_run_setup(void);
  56. #else
  57. static inline void md_run_setup(void) {}
  58. #endif