cdev.h 610 B

123456789101112131415161718192021222324252627282930313233
  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 cdev {
  8. struct kobject kobj;
  9. struct module *owner;
  10. const struct file_operations *ops;
  11. struct list_head list;
  12. dev_t dev;
  13. unsigned int count;
  14. };
  15. void cdev_init(struct cdev *, const struct file_operations *);
  16. struct cdev *cdev_alloc(void);
  17. void cdev_put(struct cdev *p);
  18. int cdev_add(struct cdev *, dev_t, unsigned);
  19. void cdev_del(struct cdev *);
  20. void cd_forget(struct inode *);
  21. extern struct backing_dev_info directly_mappable_cdev_bdi;
  22. #endif
  23. #endif