Re: [patch 6/7] SCSI: save disk in scsi_device - resend

Previous thread: [patch 4/7] libata: expose AN to user space - resend by Kristen Carlson Accardi on Friday, May 4, 2007 - 11:16 am. (1 message)

Next thread: Re: cpufreq longhaul locks up by Rafał Bilski on Friday, May 4, 2007 - 12:00 pm. (1 message)
From: Kristen Carlson Accardi
Date: Friday, May 4, 2007 - 11:17 am

Give anyone who has access to scsi_device access to the genhd struct as well.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Index: 2.6-git/drivers/scsi/sd.c
===================================================================
--- 2.6-git.orig/drivers/scsi/sd.c
+++ 2.6-git/drivers/scsi/sd.c
@@ -1711,6 +1711,7 @@ static int sd_probe(struct device *dev)
 
 	dev_set_drvdata(dev, sdkp);
 	add_disk(gd);
+	sdp->disk = gd;
 
 	sdev_printk(KERN_NOTICE, sdp, "Attached scsi %sdisk %s\n",
 		    sdp->removable ? "removable " : "", gd->disk_name);
Index: 2.6-git/drivers/scsi/sr.c
===================================================================
--- 2.6-git.orig/drivers/scsi/sr.c
+++ 2.6-git/drivers/scsi/sr.c
@@ -604,6 +604,7 @@ static int sr_probe(struct device *dev)
 	if (sdev->media_change_notify)
 		disk->flags |= GENHD_FL_MEDIA_CHANGE_NOTIFY;
 	add_disk(disk);
+	sdev->disk = disk;
 
 	sdev_printk(KERN_DEBUG, sdev,
 		    "Attached scsi CD-ROM %s\n", cd->cdi.name);
Index: 2.6-git/include/scsi/scsi_device.h
===================================================================
--- 2.6-git.orig/include/scsi/scsi_device.h
+++ 2.6-git/include/scsi/scsi_device.h
@@ -138,7 +138,7 @@ struct scsi_device {
 
 	struct device		sdev_gendev;
 	struct class_device	sdev_classdev;
-
+	struct gendisk 		*disk;
 	struct execute_work	ew; /* used to get process context on put */
 
 	enum scsi_device_state sdev_state;

-- 
-

From: James Bottomley
Date: Friday, May 4, 2007 - 1:30 pm

If you're going to do this, you need to take on board removing the
struct gendisk from all the ULD structures (since it's now become
generic).

James


-

From: Kristen Carlson Accardi
Date: Monday, May 7, 2007 - 8:29 am

On Fri, 04 May 2007 15:30:48 -0500

Ok - I can send that as a separate patch series, or I can include it
in this one.  Which is preferred?
-

From: Kristen Carlson Accardi
Date: Wednesday, May 9, 2007 - 3:50 pm

On Mon, 7 May 2007 08:29:28 -0700

I interpret the lack of response to this question to mean that I can just
decide for myself - in which case I prefer to send this as a separate 
patchset after this one is integrated.

Thanks!
Kristen
-

From: James Bottomley
Date: Wednesday, May 9, 2007 - 4:04 pm

Sorry ... was sidetracked getting tree into shape.

Yes, separate patch is preferred.

James


-

Previous thread: [patch 4/7] libata: expose AN to user space - resend by Kristen Carlson Accardi on Friday, May 4, 2007 - 11:16 am. (1 message)

Next thread: Re: cpufreq longhaul locks up by Rafał Bilski on Friday, May 4, 2007 - 12:00 pm. (1 message)