]> git.hungrycats.org Git - linux/commit
[PATCH] Add release function to sd for scsi_disk structure
authorMike Anderson <andmike@us.ibm.com>
Thu, 23 Oct 2003 04:16:59 +0000 (23:16 -0500)
committerJames Bottomley <jejb@raven.il.steeleye.com>
Thu, 23 Oct 2003 04:16:59 +0000 (23:16 -0500)
commitf7ad20118d63e1e1d50151e041ba3d8c45a8fc8f
tree5580dd56788bfbba068d09c6283e499379bdbf6d
parent929335183b36817842a54e5d775a1c331e51afca
[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.

 drivers/scsi/scsi.c       |    4 --
 drivers/scsi/scsi_sysfs.c |    3 --
 drivers/scsi/sd.c         |   63 ++++++++++++++++++++++++++++++++++++++++------
 3 files changed, 57 insertions(+), 13 deletions(-)
drivers/scsi/scsi.c
drivers/scsi/scsi_sysfs.c
drivers/scsi/sd.c