diff options
| author | Alexander Viro <viro@www.linux.org.uk> | 2003-05-24 21:42:20 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-05-24 21:42:20 -0700 |
| commit | 787d458a0ce55dd6ca7595a3e9003d2e089cd60c (patch) | |
| tree | db6940dddd2ba2472c35999533c1fbfd036d1cf7 /include/linux/fs.h | |
| parent | 6abc19b443e0df3a63500d184b756878a4692332 (diff) | |
[PATCH] cdev-cidr, part 1
New object: struct cdev. It contains a kobject, a pointer to
file_operations and a pointer to owner module. These guys have a search
structure of the same sort as gendisks and chrdev_open() picks
file_operations from them.
Intended use: embed such animal in driver-owned structure (e.g.
tty_driver) and register it as associated with given range of device
numbers. Generic code will do lookup for such object and use it for the
rest.
The behaviour of register_chrdev() is _not_ changed - it allocates
struct cdev and registers it; any old driver will work as if nothing had
changed.
On that stage we only use it during chrdev_open() to find
file_operations. Later it will be cached in inode->i_cdev (and index in
range - in inode->i_cindex) so that ->open() could get whatever objects
it wants directly without any special-cased lookups, etc.
Diffstat (limited to 'include/linux/fs.h')
| -rw-r--r-- | include/linux/fs.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1b7fac010f1f..6b32c6ab8727 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1056,10 +1056,8 @@ extern void bd_release(struct block_device *); extern void blk_run_queues(void); /* fs/char_dev.c */ -extern int alloc_chrdev_region(dev_t *, unsigned, char *, - struct file_operations *); -extern int register_chrdev_region(dev_t, unsigned, char *, - struct file_operations *); +extern int alloc_chrdev_region(dev_t *, unsigned, char *); +extern int register_chrdev_region(dev_t, unsigned, char *); extern int register_chrdev(unsigned int, const char *, struct file_operations *); extern int unregister_chrdev(unsigned int, const char *); |
