[PATCH] Add release function to sd for scsi_disk structure
This patch removes the delay in calling device_del on the sdev struct
device during a surprise removal event. Reference counting functions for
sd's scsi_disk structure where also added to fix issues of unregistering
when a sd is open.
I have tested this patch using scsi_debug with differnt combinations of
adds / removes. I mounted both partitioned and un-partitioned sd disks,
remove the host, and then did a umount. The ref count debug output shows
the objects staying in place prior to the umount and cleaning up once
the umount is called.
This patch fixes an issue with a delayed call of device_del on the
sdev_gendev struct device.
- Remove the delayed call to device_del.
- Add kobject to sd scsi_disk structure.
- Add release function for scsi_disk kobject.
- Add get / put functions for scsi_disk and calls to these
functions.