do_mounts.h 1.7 KB

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