diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-11-25 03:46:55 -0600 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-11-25 03:46:55 -0600 |
| commit | b26ca10f9fb9db8b164bb9225424cceee13cbeea (patch) | |
| tree | 82346dd5ec96571d4f1206ab90355e1905650865 /kernel/fork.c | |
| parent | 03c84d71ae50d05ca5991a63c261ca8c3e009fa1 (diff) | |
fix up block device usage of kobjects.
alloc_disk() should set the kobject's subsystem before calling kobject_init(),
which would increment the subsystem's refcount (to be decremented in
kobject_cleanup()). Since it was being set after the call, the subsystem's
refcount was being pushed to 0 if the floppy driver was enabled, but there
were no floppy drives found (the driver would alloc_disk(), then put_disk() if
no drives were found).
Partitions use kobject_register(), so they don't have to do kobject_init()
(it's done for them).
add_disk() should use kobject_add() instead of kobject_register(), since
it's already done kobject_init() in alloc_disk().
Also, del_gendisk() doesn't have to do extra refcount and call
kobject_unregister(); it should just call kobject_del(). The block device
will be freed up later when put_disk() pushes the refcount to 0.
Diffstat (limited to 'kernel/fork.c')
0 files changed, 0 insertions, 0 deletions
