diff options
author | Christoph Hellwig <hch@lst.de> | 2022-03-08 06:51:50 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-03-09 03:40:00 +0100 |
commit | fad45c3007a18064da759b4dba35eb722bc64e97 (patch) | |
tree | b6f211f8c6154271ad380b3209f0c3cc094714b1 /drivers/scsi/sd.h | |
parent | scsi: don't use disk->private_data to find the scsi_driver (diff) | |
download | linux-fad45c3007a18064da759b4dba35eb722bc64e97.tar.xz linux-fad45c3007a18064da759b4dba35eb722bc64e97.zip |
sd: rename the scsi_disk.dev field
dev is very hard to grep for. Give the field a more descriptive name and
documents its purpose.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220308055200.735835-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/sd.h')
-rw-r--r-- | drivers/scsi/sd.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h index 303aa1c23aef..0a33a4b68ffb 100644 --- a/drivers/scsi/sd.h +++ b/drivers/scsi/sd.h @@ -69,7 +69,12 @@ enum { struct scsi_disk { struct scsi_device *device; - struct device dev; + + /* + * disk_dev is used to show attributes in /sys/class/scsi_disk/, + * but otherwise not really needed. Do not use for refcounting. + */ + struct device disk_dev; struct gendisk *disk; struct opal_dev *opal_dev; #ifdef CONFIG_BLK_DEV_ZONED @@ -126,7 +131,7 @@ struct scsi_disk { unsigned security : 1; unsigned ignore_medium_access_errors : 1; }; -#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) +#define to_scsi_disk(obj) container_of(obj, struct scsi_disk, disk_dev) static inline struct scsi_disk *scsi_disk(struct gendisk *disk) { |