do_mounts.h 1.3 KB

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