cdev.h 677 字节
Newer Older
L
Linus Torvalds 已提交
1 2 3
#ifndef _LINUX_CDEV_H
#define _LINUX_CDEV_H

4 5 6 7
#include <linux/kobject.h>
#include <linux/kdev_t.h>
#include <linux/list.h>

8 9 10 11
struct file_operations;
struct inode;
struct module;

L
Linus Torvalds 已提交
12 13 14
struct cdev {
	struct kobject kobj;
	struct module *owner;
15
	const struct file_operations *ops;
L
Linus Torvalds 已提交
16 17 18 19 20
	struct list_head list;
	dev_t dev;
	unsigned int count;
};

21
void cdev_init(struct cdev *, const struct file_operations *);
L
Linus Torvalds 已提交
22 23 24 25 26 27 28 29 30

struct cdev *cdev_alloc(void);

void cdev_put(struct cdev *p);

int cdev_add(struct cdev *, dev_t, unsigned);

void cdev_del(struct cdev *);

31 32
int cdev_index(struct inode *inode);

L
Linus Torvalds 已提交
33 34
void cd_forget(struct inode *);

35 36
extern struct backing_dev_info directly_mappable_cdev_bdi;

L
Linus Torvalds 已提交
37
#endif