There really isn't any good reason to stash a method directly into struct gendisk. Move it together with the other block device operations.
Showing the changes to include/linux (2 of 4 files). Show all
Unified · Split
| @@ -1697,6 +1697,7 @@ struct block_device_operations { · 1696 unmodified lines | |||
| 1697 | void (*swap_slot_free_notify) (struct block_device *, unsigned long); | 1697 | void (*swap_slot_free_notify) (struct block_device *, unsigned long); |
| 1698 | int (*report_zones)(struct gendisk *, sector_t sector, | 1698 | int (*report_zones)(struct gendisk *, sector_t sector, |
| 1699 | unsigned int nr_zones, report_zones_cb cb, void *data); | 1699 | unsigned int nr_zones, report_zones_cb cb, void *data); |
| 1700 | char *(*devnode)(struct gendisk *disk, umode_t *mode); | ||
| 1700 | struct module *owner; | 1701 | struct module *owner; |
| 1701 | const struct pr_ops *pr_ops; | 1702 | const struct pr_ops *pr_ops; |
| 1702 | }; | 1703 | }; |
| @@ -191,7 +191,6 @@ struct gendisk { · 190 unmodified lines | |||
| 191 | * disks that can't be partitioned. */ | 191 | * disks that can't be partitioned. */ |
| 192 | 192 | ||
| 193 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 193 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
| 194 | char *(*devnode)(struct gendisk *gd, umode_t *mode); | ||
| 195 | 194 | ||
| 196 | unsigned short events; /* supported events */ | 195 | unsigned short events; /* supported events */ |
| 197 | unsigned short event_flags; /* flags related to event processing */ | 196 | unsigned short event_flags; /* flags related to event processing */ |