devfs_fs_kernel.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef _LINUX_DEVFS_FS_KERNEL_H
  2. #define _LINUX_DEVFS_FS_KERNEL_H
  3. #include <linux/fs.h>
  4. #include <linux/config.h>
  5. #include <linux/spinlock.h>
  6. #include <linux/types.h>
  7. #include <asm/semaphore.h>
  8. #define DEVFS_SUPER_MAGIC 0x1373
  9. #ifdef CONFIG_DEVFS_FS
  10. extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
  11. __attribute__ ((format(printf, 3, 4)));
  12. extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
  13. __attribute__ ((format(printf, 3, 4)));
  14. extern int devfs_mk_symlink(const char *name, const char *link);
  15. extern int devfs_mk_dir(const char *fmt, ...)
  16. __attribute__ ((format(printf, 1, 2)));
  17. extern void devfs_remove(const char *fmt, ...)
  18. __attribute__ ((format(printf, 1, 2)));
  19. extern int devfs_register_tape(const char *name);
  20. extern void devfs_unregister_tape(int num);
  21. extern void mount_devfs_fs(void);
  22. #else /* CONFIG_DEVFS_FS */
  23. static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
  24. {
  25. return 0;
  26. }
  27. static inline int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
  28. {
  29. return 0;
  30. }
  31. static inline int devfs_mk_symlink(const char *name, const char *link)
  32. {
  33. return 0;
  34. }
  35. static inline int devfs_mk_dir(const char *fmt, ...)
  36. {
  37. return 0;
  38. }
  39. static inline void devfs_remove(const char *fmt, ...)
  40. {
  41. }
  42. static inline int devfs_register_tape(const char *name)
  43. {
  44. return -1;
  45. }
  46. static inline void devfs_unregister_tape(int num)
  47. {
  48. }
  49. static inline void mount_devfs_fs(void)
  50. {
  51. return;
  52. }
  53. #endif /* CONFIG_DEVFS_FS */
  54. #endif /* _LINUX_DEVFS_FS_KERNEL_H */