diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2008-06-25 11:22:41 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-12 08:22:31 -0500 |
commit | 5b635da11e3a6387172abd651d26d8ef54b1fbc7 (patch) | |
tree | 0b7018d5008902e96aa4f69db3807a00c0307027 /drivers/scsi/sd.h | |
parent | aa91696e56a0870db5754610e9f9b937e77507e0 (diff) | |
download | lwn-5b635da11e3a6387172abd651d26d8ef54b1fbc7.tar.gz lwn-5b635da11e3a6387172abd651d26d8ef54b1fbc7.zip |
[SCSI] sd: Move scsi_disk() accessor function to sd.h
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/sd.h')
-rw-r--r-- | drivers/scsi/sd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h index 4f032d48cb6e..03a3d45cfa42 100644 --- a/drivers/scsi/sd.h +++ b/drivers/scsi/sd.h @@ -48,6 +48,11 @@ struct scsi_disk { }; #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) +static inline struct scsi_disk *scsi_disk(struct gendisk *disk) +{ + return container_of(disk->private_data, struct scsi_disk, driver); +} + #define sd_printk(prefix, sdsk, fmt, a...) \ (sdsk)->disk ? \ sdev_printk(prefix, (sdsk)->device, "[%s] " fmt, \ |