]> git.ipfire.org Git - people/ms/linux.git/commit
scsi: fix our current target reap infrastructure
authorJames Bottomley <JBottomley@Parallels.com>
Tue, 21 Jan 2014 15:00:50 +0000 (07:00 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 May 2014 09:38:05 +0000 (11:38 +0200)
commitb51845d41c715e18ffbb413da213e72667e852ec
treec331c36c771221949effb859a448e90ee19e45f8
parent99565b6c9eb1ae28ab633d7104e654e6dc6a6679
scsi: fix our current target reap infrastructure

commit e63ed0d7a98014fdfc2cfeb3f6dada313dcabb59 upstream.

This patch eliminates the reap_ref and replaces it with a proper kref.
On last put of this kref, the target is removed from visibility in
sysfs.  The final call to scsi_target_reap() for the device is done from
__scsi_remove_device() and only if the device was made visible.  This
ensures that the target disappears as soon as the last device is gone
rather than waiting until final release of the device (which is often
too long).

Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_sysfs.c
include/scsi/scsi_device.h