summaryrefslogtreecommitdiff
path: root/include/linux/cdev.h
diff options
context:
space:
mode:
authorAlexander Viro <viro@www.linux.org.uk>2003-05-24 21:42:29 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-24 21:42:29 -0700
commit9bda5f681fd216b6a856b72940195e5335317bf1 (patch)
treef41a2cf805156cd9336be8c2eab01fbbacddc62d /include/linux/cdev.h
parent787d458a0ce55dd6ca7595a3e9003d2e089cd60c (diff)
[PATCH] i_cdev/i_cindex
new fields in struct inode - i_cdev and i_cindex. When we do open() on a character device we cache result of cdev lookup in inode and put the inode on a cyclic list anchored in cdev. If we already have that done, we don't bother with any lookups. When inode disappears it's removed from the list. When cdev gets unregistered we remove all cached references to it (and remove such inodes from the list). cdev is held until final fput() now.
Diffstat (limited to 'include/linux/cdev.h')
-rw-r--r--include/linux/cdev.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/cdev.h b/include/linux/cdev.h
index faa67d2f4323..191c800fa127 100644
--- a/include/linux/cdev.h
+++ b/include/linux/cdev.h
@@ -6,17 +6,14 @@ struct cdev {
struct kobject kobj;
struct module *owner;
struct file_operations *ops;
+ struct list_head list;
};
void cdev_init(struct cdev *, struct file_operations *);
struct cdev *cdev_alloc(void);
-static inline void cdev_put(struct cdev *p)
-{
- if (p)
- kobject_put(&p->kobj);
-}
+void cdev_put(struct cdev *p);
struct kobject *cdev_get(struct cdev *);
@@ -26,5 +23,7 @@ void cdev_del(struct cdev *);
void cdev_unmap(dev_t, unsigned);
+void cd_forget(struct inode *);
+
#endif
#endif