On 3/6/22 00:40, Christoph Hellwig wrote:
On Sat, Mar 05, 2022 at 05:38:40PM -0800, Bart Van Assche wrote:
On 3/4/22 08:03, Christoph Hellwig wrote:
+ /*
+ * This device is mostly just used to show a bunch of attributes in a
+ * weird place. In doubt don't add any new users, and most importantly
+ * don't use if for any actual refcounting.
+ */
+ struct device disk_dev;
Isn't "weird place" subjective? How about mentioning the sysfs path
explicitly (/sys/class/scsi_disk/H:C:I:L)? How about explaining why no new
sysfs attributes should be added to that device instance?
Well, weird place means that all normale drivers would just use
attributes on the gendisk for it, but sd creates a completely pointless
device under the gendisk device for it. If you have a better wording
I can change it.
It's not that important. I wish it would be possible to get rid of this
struct device instance. I think this instance was introduced in 2006 by
patch "[SCSI] allow displaying and setting of cache type via sysfs".
Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>