From fad45c3007a18064da759b4dba35eb722bc64e97 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 8 Mar 2022 06:51:50 +0100 Subject: 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 Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-5-hch@lst.de Signed-off-by: Jens Axboe --- drivers/scsi/sd.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/sd.h') 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) { -- cgit