path: root/block/genhd.c
diff options
authorChristoph Hellwig <>2017-11-02 21:29:52 +0300
committerJens Axboe <>2017-11-03 10:31:48 -0600
commit517bf3c306bad4fe0da631f90ae2ec40924dee2b (patch)
treecbe0e6bc91a51781ae4d3ac60af5e7abae54a37b /block/genhd.c
parentef71de8b15d891b27b8c983a9a8972b11cb4576a (diff)
block: don't look at the struct device dev_t in disk_devt
The hidden gendisks introduced in the next patch need to keep the dev field in their struct device empty so that udev won't try to create block device nodes for them. To support that rewrite disk_devt to look at the major and first_minor fields in the gendisk itself instead of looking into the struct device. Signed-off-by: Christoph Hellwig <> Reviewed-by: Johannes Thumshirn <> Reviewed-by: Hannes Reinecke <> Signed-off-by: Jens Axboe <>
Diffstat (limited to 'block/genhd.c')
1 files changed, 0 insertions, 4 deletions
diff --git a/block/genhd.c b/block/genhd.c
index dd305c6..1174d24 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -649,10 +649,6 @@ void device_add_disk(struct device *parent, struct gendisk *disk)
disk_to_dev(disk)->devt = devt;
- /* ->major and ->first_minor aren't supposed to be
- * dereferenced from here on, but set them just in case.
- */
disk->major = MAJOR(devt);
disk->first_minor = MINOR(devt);