* Add ->set_capacity block device method and use it in rescan_partitions() to attempt enabling native capacity of the device upon detecting the partition which exceeds device capacity. * Add GENHD_FL_NATIVE_CAPACITY flag to try limit attempts of enabling native capacity during partition scan. Together with the consecutive patch implementing ->set_capacity method in ide-gd device driver this allows automatic disabling of Host Protected Area (HPA) if any partitions overlapping HPA are detected.
Showing the changes to include/linux/blkdev.h (1 of 3 files). Show all
Unified · Split
| @@ -1106,6 +1106,8 @@ struct block_device_operations { · 1105 unmodified lines | |||
| 1106 | int (*direct_access) (struct block_device *, sector_t, | 1106 | int (*direct_access) (struct block_device *, sector_t, |
| 1107 | void **, unsigned long *); | 1107 | void **, unsigned long *); |
| 1108 | int (*media_changed) (struct gendisk *); | 1108 | int (*media_changed) (struct gendisk *); |
| 1109 | unsigned long long (*set_capacity) (struct gendisk *, | ||
| 1110 | unsigned long long); | ||
| 1109 | int (*revalidate_disk) (struct gendisk *); | 1111 | int (*revalidate_disk) (struct gendisk *); |
| 1110 | int (*getgeo)(struct block_device *, struct hd_geometry *); | 1112 | int (*getgeo)(struct block_device *, struct hd_geometry *); |
| 1111 | struct module *owner; | 1113 | struct module *owner; |