cdev.h 664 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _LINUX_CDEV_H
  2. #define _LINUX_CDEV_H
  3. #ifdef __KERNEL__
  4. #include <linux/kobject.h>
  5. #include <linux/kdev_t.h>
  6. #include <linux/list.h>
  7. struct file_operations;
  8. struct inode;
  9. struct module;
  10. struct cdev {
  11. struct kobject kobj;
  12. struct module *owner;
  13. const struct file_operations *ops;
  14. struct list_head list;
  15. dev_t dev;
  16. unsigned int count;
  17. };
  18. void cdev_init(struct cdev *, const struct file_operations *);
  19. struct cdev *cdev_alloc(void);
  20. void cdev_put(struct cdev *p);
  21. int cdev_add(struct cdev *, dev_t, unsigned);
  22. void cdev_del(struct cdev *);
  23. void cd_forget(struct inode *);
  24. extern struct backing_dev_info directly_mappable_cdev_bdi;
  25. #endif
  26. #endif