do_mounts.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #include <linux/config.h>
  2. #include <linux/kernel.h>
  3. #include <linux/devfs_fs_kernel.h>
  4. #include <linux/init.h>
  5. #include <linux/syscalls.h>
  6. #include <linux/unistd.h>
  7. #include <linux/slab.h>
  8. #include <linux/mount.h>
  9. #include <linux/major.h>
  10. #include <linux/root_dev.h>
  11. void change_floppy(char *fmt, ...);
  12. void mount_block_root(char *name, int flags);
  13. void mount_root(void);
  14. extern int root_mountflags;
  15. extern char *root_device_name;
  16. #ifdef CONFIG_DEVFS_FS
  17. void mount_devfs(void);
  18. void umount_devfs(char *path);
  19. int create_dev(char *name, dev_t dev, char *devfs_name);
  20. #else
  21. static inline void mount_devfs(void) {}
  22. static inline void umount_devfs(const char *path) {}
  23. static inline int create_dev(char *name, dev_t dev, char *devfs_name)
  24. {
  25. sys_unlink(name);
  26. return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
  27. }
  28. #endif
  29. #if BITS_PER_LONG == 32
  30. static inline u32 bstat(char *name)
  31. {
  32. struct stat64 stat;
  33. if (sys_stat64(name, &stat) != 0)
  34. return 0;
  35. if (!S_ISBLK(stat.st_mode))
  36. return 0;
  37. if (stat.st_rdev != (u32)stat.st_rdev)
  38. return 0;
  39. return stat.st_rdev;
  40. }
  41. #else
  42. static inline u32 bstat(char *name)
  43. {
  44. struct stat stat;
  45. if (sys_newstat(name, &stat) != 0)
  46. return 0;
  47. if (!S_ISBLK(stat.st_mode))
  48. return 0;
  49. return stat.st_rdev;
  50. }
  51. #endif
  52. #ifdef CONFIG_BLK_DEV_RAM
  53. int __init rd_load_disk(int n);
  54. int __init rd_load_image(char *from);
  55. #else
  56. static inline int rd_load_disk(int n) { return 0; }
  57. static inline int rd_load_image(char *from) { return 0; }
  58. #endif
  59. #ifdef CONFIG_BLK_DEV_INITRD
  60. int __init initrd_load(void);
  61. #else
  62. static inline int initrd_load(void) { return 0; }
  63. #endif
  64. #ifdef CONFIG_BLK_DEV_MD
  65. void md_run_setup(void);
  66. #else
  67. static inline void md_run_setup(void) {}
  68. #endif