do_mounts.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #include <linux/kernel.h>
  2. #include <linux/init.h>
  3. #include <linux/syscalls.h>
  4. #include <linux/unistd.h>
  5. #include <linux/slab.h>
  6. #include <linux/mount.h>
  7. #include <linux/major.h>
  8. #include <linux/root_dev.h>
  9. void change_floppy(char *fmt, ...);
  10. void mount_block_root(char *name, int flags);
  11. void mount_root(void);
  12. extern int root_mountflags;
  13. extern char *root_device_name;
  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