Sorry pelting you with duplicate patches. Here is yet
another version of my init_disk() patch.
I changed init_disk to take the disk partitions pointer
as a parameter to make it hard for users of this interface to
forget to set it.
Also, I replaced disk.destructor() with disk.kfree_arg,
to avoid having to write a bunch of destructors that look like this:
void foo_destructor(struct gendisk *disk)
{
struct foo_private *foo_priv =
container_of(disk, struct foo_private, mygendisk);
kfree(foo_priv);
}
foo's hardware removal function would call put_disk,
and the disk's destructor would be called when the disk's reference
count dropped to zero. However, I'd rather not have to write
a bunch of duplicative destructor functions and I think they
all would just call kfree.
By the way, I believe that the example of the IDE changes that
I posted does not currently have this issue because the gendisks are in
the static hwifs[] array, which is not deallocated until the module is
unloaded, and the module is protected by a reference count.
-- Adam J. Richter __ ______________ 575 Oroville Road adam@yggdrasil.com \ / Milpitas, California 95035 +1 408 309-6081 | g g d r a s i l United States of America "Free Software For The Rest Of Us."
This archive was generated by hypermail 2b29 : Thu Nov 07 2002 - 22:00:43 EST