]> git.hungrycats.org Git - linux/commit
[PATCH] scsi device ref count (update)
authorMike Anderson <andmike@us.ibm.com>
Sat, 22 Nov 2003 03:13:02 +0000 (21:13 -0600)
committerJames Bottomley <jejb@mulgrave.(none)>
Sat, 22 Nov 2003 03:13:02 +0000 (21:13 -0600)
commite4df991070122260b9cb9864570cd1b52537fcae
treea71d14d1e0d20d97dd16e057d6f6f1e26d4ffb19
parent5995f96b46f5b791716f6004114986c06880810d
[PATCH] scsi device ref count (update)

This patch is against scsi-bugfixes-2.6. I updated it based on comments
received. It breaks up the reference count initialization for scsi_device
and restores calling slave_destroy for all scsi_devices configured or
not. I ran a small regression using the scsi_debug, aic7xxx, and qla2xxx
driver. I also had a debug patch for more verbose kobject cleanup and
patch for a badness check on atomic_dec going negative (previously
provided by Linus).

The object cleanup appears to being functioning correctly. I only saw
previously reported badness output:
- Synchronizing SCSI cache fails on cleanup.
- scsi_debug.c missing release (I believe Doug posted a patch)
- aic7xxx warnings on rmmod due to ahc_platform_free calling
  scsi_remove_host with ahc_list_lock held.

This patch splits the scsi device struct device register into init and
add. It also addresses memory leak issues of not calling slave_destroy
on scsi_devices that are not configured in.

Details:
* Make scsi_device_dev_release extern for scsi_scan to use in
alloc_sdev.
* Move scsi_free_sdev code to scsi_device_dev_release. Have
previous callers of scsi_free_sdev call slave_destroy plus put_device.
* Changed name of scsi_device_register to scsi_sysfs_add_sdev to
match host call and align with split struct device init.
* Move sdev_gendev device and class init to scsi_alloc_sdev.

Thu Nov 20 22:56:11 PST 2003

 drivers/scsi/scsi_priv.h  |    4 +-
 drivers/scsi/scsi_scan.c  |   63 +++++++++++++++++++++-------------------------
 drivers/scsi/scsi_sysfs.c |   58 ++++++++++++++++++++++--------------------
 3 files changed, 62 insertions(+), 63 deletions(-)
drivers/scsi/scsi_priv.h
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_sysfs.c