From d6ae4333e648492721a098bdc329bbd82d25eb67 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Sun, 29 Nov 2009 16:25:26 +0200 Subject: [SCSI] osduld: Use device->release instead of internal kref The true logic of this patch will be clear in the next patch where we use the class_find_device() API. When doing so the use of an internal kref leaves us a narrow window where a find is started while the actual object can go away. Using the device's kobj reference solves this problem because now the same kref is used for both operations. (Remove and find) Core changes * Embed a struct device in uld_ structure and use device_register instead of devie_create. Set __remove to be the device release function. * __uld_get/put is just get_/put_device. Now every thing is accounted for on the device object. Internal kref is removed. * At __remove() we can safely de-allocate the uld_ structure. (The function has moved to avoid forward declaration) Some cleanups * Use class register/unregister is cleaner for this driver now. * cdev ref-counting games are no longer necessary I have incremented the device version string in case of new bugs. Note: Previous bugfix of taking the reference around fput() still applies. Signed-off-by: Boaz Harrosh Signed-off-by: James Bottomley --- include/scsi/osd_initiator.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/scsi') diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index f787d24d3bab..589e5f0d67b1 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h @@ -48,7 +48,6 @@ enum osd_std_version { */ struct osd_dev { struct scsi_device *scsi_device; - struct file *file; unsigned def_timeout; #ifdef OSD_VER1_SUPPORT -- cgit v1.2.3-58-ga151