diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-12-18 19:40:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:39 -0500 |
commit | 0f4dafc0563c6c49e17fe14b3f5f356e4c4b8806 (patch) | |
tree | f4ded2831853cb6ea328d15d72871db6f8c22610 /include/linux/kobject.h | |
parent | 12e339ac6e31a34fe42396aec8fb1c0b43caf61e (diff) |
Kobject: auto-cleanup on final unref
We save the current state in the object itself, so we can do proper
cleanup when the last reference is dropped.
If the initial reference is dropped, the object will be removed from
sysfs if needed, if an "add" event was sent, "remove" will be send, and
the allocated resources are released.
This allows us to clean up some driver core usage as well as allowing us
to do other such changes to the rest of the kernel.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/kobject.h')
-rw-r--r-- | include/linux/kobject.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 63967da073af..be03ce83f9cc 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -68,6 +68,11 @@ struct kobject { | |||
68 | struct kset * kset; | 68 | struct kset * kset; |
69 | struct kobj_type * ktype; | 69 | struct kobj_type * ktype; |
70 | struct sysfs_dirent * sd; | 70 | struct sysfs_dirent * sd; |
71 | unsigned int state_initialized:1; | ||
72 | unsigned int state_name_set:1; | ||
73 | unsigned int state_in_sysfs:1; | ||
74 | unsigned int state_add_uevent_sent:1; | ||
75 | unsigned int state_remove_uevent_sent:1; | ||
71 | }; | 76 | }; |
72 | 77 | ||
73 | extern int kobject_set_name(struct kobject *, const char *, ...) | 78 | extern int kobject_set_name(struct kobject *, const char *, ...) |